var _a, _b, _c, _d;
import { r as requireReact, a as requireReactDom, b as reactExports, u as useIsomorphicLayoutEffect, R as React, c as ReactReduxContext, d as createSubscription, K as KEY_PREFIX, P as PERSIST, D as DEFAULT_VERSION, e as PURGE, F as FLUSH, f as PAUSE, g as REHYDRATE, h as createStore, i as REGISTER, j as getDefaultExportFromCjs, k as combineReducers, l as configureStore, m as PostReducer, A as AppReducer, n as rcWindow, s as setLocaleData, _ as __vitePreload, o as jsxRuntimeExports, L as Li, p as nr, q as si, E as Er, t as __, v as L8e, w as r9e, S as Ske, x as gh, y as uf, V as Vo, Q as Q8e, z as e9e, B as li, C as Ln, G as q8e, H as Kt, I as S8e, J as D8e, M as jp, N as ai, O as useAppDispatch, T as J8e, U as j8e, W as NEe, X as OnboardingStore, Z as Z8e, Y as O8e, $ as useSelector, a0 as debounce, a1 as N8e, a2 as reactDomExports, a3 as Va, a4 as SeoStore, a5 as B8e, a6 as seoStore, a7 as AppSlice, a8 as $8e, a9 as tb, aa as OptimiserStore, ab as classNames, ac as X8e, ad as useDispatch, ae as sprintf, af as DSe, ag as Id, ah as PluginInformationStore, ai as fetchPost, aj as getPathId, ak as GutenbergSidebar, al as App, am as MetatagsStore } from "./app.C275KGnI.js";
/* empty css                */
var client = { exports: {} };
var reactDomClient_production = {};
var scheduler = { exports: {} };
var scheduler_production = {};
/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var hasRequiredScheduler_production;
function requireScheduler_production() {
  if (hasRequiredScheduler_production) return scheduler_production;
  hasRequiredScheduler_production = 1;
  (function(exports) {
    function push(heap, node) {
      var index = heap.length;
      heap.push(node);
      a: for (; 0 < index; ) {
        var parentIndex = index - 1 >>> 1, parent = heap[parentIndex];
        if (0 < compare(parent, node))
          heap[parentIndex] = node, heap[index] = parent, index = parentIndex;
        else break a;
      }
    }
    function peek(heap) {
      return 0 === heap.length ? null : heap[0];
    }
    function pop(heap) {
      if (0 === heap.length) return null;
      var first = heap[0], last = heap.pop();
      if (last !== first) {
        heap[0] = last;
        a: for (var index = 0, length = heap.length, halfLength = length >>> 1; index < halfLength; ) {
          var leftIndex = 2 * (index + 1) - 1, left = heap[leftIndex], rightIndex = leftIndex + 1, right = heap[rightIndex];
          if (0 > compare(left, last))
            rightIndex < length && 0 > compare(right, left) ? (heap[index] = right, heap[rightIndex] = last, index = rightIndex) : (heap[index] = left, heap[leftIndex] = last, index = leftIndex);
          else if (rightIndex < length && 0 > compare(right, last))
            heap[index] = right, heap[rightIndex] = last, index = rightIndex;
          else break a;
        }
      }
      return first;
    }
    function compare(a, b) {
      var diff = a.sortIndex - b.sortIndex;
      return 0 !== diff ? diff : a.id - b.id;
    }
    exports.unstable_now = void 0;
    if ("object" === typeof performance && "function" === typeof performance.now) {
      var localPerformance = performance;
      exports.unstable_now = function() {
        return localPerformance.now();
      };
    } else {
      var localDate = Date, initialTime = localDate.now();
      exports.unstable_now = function() {
        return localDate.now() - initialTime;
      };
    }
    var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
    function advanceTimers(currentTime) {
      for (var timer = peek(timerQueue); null !== timer; ) {
        if (null === timer.callback) pop(timerQueue);
        else if (timer.startTime <= currentTime)
          pop(timerQueue), timer.sortIndex = timer.expirationTime, push(taskQueue, timer);
        else break;
        timer = peek(timerQueue);
      }
    }
    function handleTimeout(currentTime) {
      isHostTimeoutScheduled = false;
      advanceTimers(currentTime);
      if (!isHostCallbackScheduled)
        if (null !== peek(taskQueue))
          isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline());
        else {
          var firstTimer = peek(timerQueue);
          null !== firstTimer && requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
        }
    }
    var isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
    function shouldYieldToHost() {
      return needsPaint ? true : exports.unstable_now() - startTime < frameInterval ? false : true;
    }
    function performWorkUntilDeadline() {
      needsPaint = false;
      if (isMessageLoopRunning) {
        var currentTime = exports.unstable_now();
        startTime = currentTime;
        var hasMoreWork = true;
        try {
          a: {
            isHostCallbackScheduled = false;
            isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);
            isPerformingWork = true;
            var previousPriorityLevel = currentPriorityLevel;
            try {
              b: {
                advanceTimers(currentTime);
                for (currentTask = peek(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) {
                  var callback = currentTask.callback;
                  if ("function" === typeof callback) {
                    currentTask.callback = null;
                    currentPriorityLevel = currentTask.priorityLevel;
                    var continuationCallback = callback(
                      currentTask.expirationTime <= currentTime
                    );
                    currentTime = exports.unstable_now();
                    if ("function" === typeof continuationCallback) {
                      currentTask.callback = continuationCallback;
                      advanceTimers(currentTime);
                      hasMoreWork = true;
                      break b;
                    }
                    currentTask === peek(taskQueue) && pop(taskQueue);
                    advanceTimers(currentTime);
                  } else pop(taskQueue);
                  currentTask = peek(taskQueue);
                }
                if (null !== currentTask) hasMoreWork = true;
                else {
                  var firstTimer = peek(timerQueue);
                  null !== firstTimer && requestHostTimeout(
                    handleTimeout,
                    firstTimer.startTime - currentTime
                  );
                  hasMoreWork = false;
                }
              }
              break a;
            } finally {
              currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false;
            }
            hasMoreWork = void 0;
          }
        } finally {
          hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false;
        }
      }
    }
    var schedulePerformWorkUntilDeadline;
    if ("function" === typeof localSetImmediate)
      schedulePerformWorkUntilDeadline = function() {
        localSetImmediate(performWorkUntilDeadline);
      };
    else if ("undefined" !== typeof MessageChannel) {
      var channel = new MessageChannel(), port = channel.port2;
      channel.port1.onmessage = performWorkUntilDeadline;
      schedulePerformWorkUntilDeadline = function() {
        port.postMessage(null);
      };
    } else
      schedulePerformWorkUntilDeadline = function() {
        localSetTimeout(performWorkUntilDeadline, 0);
      };
    function requestHostTimeout(callback, ms) {
      taskTimeoutID = localSetTimeout(function() {
        callback(exports.unstable_now());
      }, ms);
    }
    exports.unstable_IdlePriority = 5;
    exports.unstable_ImmediatePriority = 1;
    exports.unstable_LowPriority = 4;
    exports.unstable_NormalPriority = 3;
    exports.unstable_Profiling = null;
    exports.unstable_UserBlockingPriority = 2;
    exports.unstable_cancelCallback = function(task) {
      task.callback = null;
    };
    exports.unstable_forceFrameRate = function(fps) {
      0 > fps || 125 < fps ? console.error(
        "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
      ) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
    };
    exports.unstable_getCurrentPriorityLevel = function() {
      return currentPriorityLevel;
    };
    exports.unstable_next = function(eventHandler) {
      switch (currentPriorityLevel) {
        case 1:
        case 2:
        case 3:
          var priorityLevel = 3;
          break;
        default:
          priorityLevel = currentPriorityLevel;
      }
      var previousPriorityLevel = currentPriorityLevel;
      currentPriorityLevel = priorityLevel;
      try {
        return eventHandler();
      } finally {
        currentPriorityLevel = previousPriorityLevel;
      }
    };
    exports.unstable_requestPaint = function() {
      needsPaint = true;
    };
    exports.unstable_runWithPriority = function(priorityLevel, eventHandler) {
      switch (priorityLevel) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          priorityLevel = 3;
      }
      var previousPriorityLevel = currentPriorityLevel;
      currentPriorityLevel = priorityLevel;
      try {
        return eventHandler();
      } finally {
        currentPriorityLevel = previousPriorityLevel;
      }
    };
    exports.unstable_scheduleCallback = function(priorityLevel, callback, options) {
      var currentTime = exports.unstable_now();
      "object" === typeof options && null !== options ? (options = options.delay, options = "number" === typeof options && 0 < options ? currentTime + options : currentTime) : options = currentTime;
      switch (priorityLevel) {
        case 1:
          var timeout = -1;
          break;
        case 2:
          timeout = 250;
          break;
        case 5:
          timeout = 1073741823;
          break;
        case 4:
          timeout = 1e4;
          break;
        default:
          timeout = 5e3;
      }
      timeout = options + timeout;
      priorityLevel = {
        id: taskIdCounter++,
        callback,
        priorityLevel,
        startTime: options,
        expirationTime: timeout,
        sortIndex: -1
      };
      options > currentTime ? (priorityLevel.sortIndex = options, push(timerQueue, priorityLevel), null === peek(taskQueue) && priorityLevel === peek(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options - currentTime))) : (priorityLevel.sortIndex = timeout, push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
      return priorityLevel;
    };
    exports.unstable_shouldYield = shouldYieldToHost;
    exports.unstable_wrapCallback = function(callback) {
      var parentPriorityLevel = currentPriorityLevel;
      return function() {
        var previousPriorityLevel = currentPriorityLevel;
        currentPriorityLevel = parentPriorityLevel;
        try {
          return callback.apply(this, arguments);
        } finally {
          currentPriorityLevel = previousPriorityLevel;
        }
      };
    };
  })(scheduler_production);
  return scheduler_production;
}
var hasRequiredScheduler;
function requireScheduler() {
  if (hasRequiredScheduler) return scheduler.exports;
  hasRequiredScheduler = 1;
  {
    scheduler.exports = requireScheduler_production();
  }
  return scheduler.exports;
}
/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var hasRequiredReactDomClient_production;
function requireReactDomClient_production() {
  if (hasRequiredReactDomClient_production) return reactDomClient_production;
  hasRequiredReactDomClient_production = 1;
  var Scheduler = requireScheduler(), React2 = requireReact(), ReactDOM = requireReactDom();
  function formatProdErrorMessage(code) {
    var url = "https://react.dev/errors/" + code;
    if (1 < arguments.length) {
      url += "?args[]=" + encodeURIComponent(arguments[1]);
      for (var i = 2; i < arguments.length; i++)
        url += "&args[]=" + encodeURIComponent(arguments[i]);
    }
    return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  function isValidContainer(node) {
    return !(!node || 1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType);
  }
  function getNearestMountedFiber(fiber) {
    var node = fiber, nearestMounted = fiber;
    if (fiber.alternate) for (; node.return; ) node = node.return;
    else {
      fiber = node;
      do
        node = fiber, 0 !== (node.flags & 4098) && (nearestMounted = node.return), fiber = node.return;
      while (fiber);
    }
    return 3 === node.tag ? nearestMounted : null;
  }
  function getSuspenseInstanceFromFiber(fiber) {
    if (13 === fiber.tag) {
      var suspenseState = fiber.memoizedState;
      null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState));
      if (null !== suspenseState) return suspenseState.dehydrated;
    }
    return null;
  }
  function getActivityInstanceFromFiber(fiber) {
    if (31 === fiber.tag) {
      var activityState = fiber.memoizedState;
      null === activityState && (fiber = fiber.alternate, null !== fiber && (activityState = fiber.memoizedState));
      if (null !== activityState) return activityState.dehydrated;
    }
    return null;
  }
  function assertIsMounted(fiber) {
    if (getNearestMountedFiber(fiber) !== fiber)
      throw Error(formatProdErrorMessage(188));
  }
  function findCurrentFiberUsingSlowPath(fiber) {
    var alternate = fiber.alternate;
    if (!alternate) {
      alternate = getNearestMountedFiber(fiber);
      if (null === alternate) throw Error(formatProdErrorMessage(188));
      return alternate !== fiber ? null : fiber;
    }
    for (var a = fiber, b = alternate; ; ) {
      var parentA = a.return;
      if (null === parentA) break;
      var parentB = parentA.alternate;
      if (null === parentB) {
        b = parentA.return;
        if (null !== b) {
          a = b;
          continue;
        }
        break;
      }
      if (parentA.child === parentB.child) {
        for (parentB = parentA.child; parentB; ) {
          if (parentB === a) return assertIsMounted(parentA), fiber;
          if (parentB === b) return assertIsMounted(parentA), alternate;
          parentB = parentB.sibling;
        }
        throw Error(formatProdErrorMessage(188));
      }
      if (a.return !== b.return) a = parentA, b = parentB;
      else {
        for (var didFindChild = false, child$0 = parentA.child; child$0; ) {
          if (child$0 === a) {
            didFindChild = true;
            a = parentA;
            b = parentB;
            break;
          }
          if (child$0 === b) {
            didFindChild = true;
            b = parentA;
            a = parentB;
            break;
          }
          child$0 = child$0.sibling;
        }
        if (!didFindChild) {
          for (child$0 = parentB.child; child$0; ) {
            if (child$0 === a) {
              didFindChild = true;
              a = parentB;
              b = parentA;
              break;
            }
            if (child$0 === b) {
              didFindChild = true;
              b = parentB;
              a = parentA;
              break;
            }
            child$0 = child$0.sibling;
          }
          if (!didFindChild) throw Error(formatProdErrorMessage(189));
        }
      }
      if (a.alternate !== b) throw Error(formatProdErrorMessage(190));
    }
    if (3 !== a.tag) throw Error(formatProdErrorMessage(188));
    return a.stateNode.current === a ? fiber : alternate;
  }
  function findCurrentHostFiberImpl(node) {
    var tag = node.tag;
    if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
    for (node = node.child; null !== node; ) {
      tag = findCurrentHostFiberImpl(node);
      if (null !== tag) return tag;
      node = node.sibling;
    }
    return null;
  }
  var assign2 = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
  var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
  var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
  var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
  function getIteratorFn(maybeIterable) {
    if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
    maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
    return "function" === typeof maybeIterable ? maybeIterable : null;
  }
  var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
  function getComponentNameFromType(type) {
    if (null == type) return null;
    if ("function" === typeof type)
      return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
    if ("string" === typeof type) return type;
    switch (type) {
      case REACT_FRAGMENT_TYPE:
        return "Fragment";
      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";
      case REACT_ACTIVITY_TYPE:
        return "Activity";
    }
    if ("object" === typeof type)
      switch (type.$$typeof) {
        case REACT_PORTAL_TYPE:
          return "Portal";
        case REACT_CONTEXT_TYPE:
          return type.displayName || "Context";
        case REACT_CONSUMER_TYPE:
          return (type._context.displayName || "Context") + ".Consumer";
        case REACT_FORWARD_REF_TYPE:
          var innerType = type.render;
          type = type.displayName;
          type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
          return type;
        case REACT_MEMO_TYPE:
          return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
        case REACT_LAZY_TYPE:
          innerType = type._payload;
          type = type._init;
          try {
            return getComponentNameFromType(type(innerType));
          } catch (x) {
          }
      }
    return null;
  }
  var isArrayImpl = Array.isArray, ReactSharedInternals = React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = {
    pending: false,
    data: null,
    method: null,
    action: null
  }, valueStack = [], index = -1;
  function createCursor(defaultValue) {
    return { current: defaultValue };
  }
  function pop(cursor) {
    0 > index || (cursor.current = valueStack[index], valueStack[index] = null, index--);
  }
  function push(cursor, value) {
    index++;
    valueStack[index] = cursor.current;
    cursor.current = value;
  }
  var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null);
  function pushHostContainer(fiber, nextRootInstance) {
    push(rootInstanceStackCursor, nextRootInstance);
    push(contextFiberStackCursor, fiber);
    push(contextStackCursor, null);
    switch (nextRootInstance.nodeType) {
      case 9:
      case 11:
        fiber = (fiber = nextRootInstance.documentElement) ? (fiber = fiber.namespaceURI) ? getOwnHostContext(fiber) : 0 : 0;
        break;
      default:
        if (fiber = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI)
          nextRootInstance = getOwnHostContext(nextRootInstance), fiber = getChildHostContextProd(nextRootInstance, fiber);
        else
          switch (fiber) {
            case "svg":
              fiber = 1;
              break;
            case "math":
              fiber = 2;
              break;
            default:
              fiber = 0;
          }
    }
    pop(contextStackCursor);
    push(contextStackCursor, fiber);
  }
  function popHostContainer() {
    pop(contextStackCursor);
    pop(contextFiberStackCursor);
    pop(rootInstanceStackCursor);
  }
  function pushHostContext(fiber) {
    null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);
    var context = contextStackCursor.current;
    var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
    context !== JSCompiler_inline_result && (push(contextFiberStackCursor, fiber), push(contextStackCursor, JSCompiler_inline_result));
  }
  function popHostContext(fiber) {
    contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor));
    hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor), HostTransitionContext._currentValue = sharedNotPendingObject);
  }
  var prefix2, suffix;
  function describeBuiltInComponentFrame(name) {
    if (void 0 === prefix2)
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix2 = match && match[1] || "";
        suffix = -1 < x.stack.indexOf("\n    at") ? " (<anonymous>)" : -1 < x.stack.indexOf("@") ? "@unknown:0:0" : "";
      }
    return "\n" + prefix2 + name + suffix;
  }
  var reentry = false;
  function describeNativeComponentFrame(fn, construct) {
    if (!fn || reentry) return "";
    reentry = true;
    var previousPrepareStackTrace = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      var RunInRootFrame = {
        DetermineComponentFrameRoot: function() {
          try {
            if (construct) {
              var Fake = function() {
                throw Error();
              };
              Object.defineProperty(Fake.prototype, "props", {
                set: function() {
                  throw Error();
                }
              });
              if ("object" === typeof Reflect && Reflect.construct) {
                try {
                  Reflect.construct(Fake, []);
                } catch (x) {
                  var control = x;
                }
                Reflect.construct(fn, [], Fake);
              } else {
                try {
                  Fake.call();
                } catch (x$1) {
                  control = x$1;
                }
                fn.call(Fake.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (x$2) {
                control = x$2;
              }
              (Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() {
              });
            }
          } catch (sample) {
            if (sample && control && "string" === typeof sample.stack)
              return [sample.stack, control.stack];
          }
          return [null, null];
        }
      };
      RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
      var namePropDescriptor = Object.getOwnPropertyDescriptor(
        RunInRootFrame.DetermineComponentFrameRoot,
        "name"
      );
      namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
        RunInRootFrame.DetermineComponentFrameRoot,
        "name",
        { value: "DetermineComponentFrameRoot" }
      );
      var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
      if (sampleStack && controlStack) {
        var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
        for (namePropDescriptor = RunInRootFrame = 0; RunInRootFrame < sampleLines.length && !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); )
          RunInRootFrame++;
        for (; namePropDescriptor < controlLines.length && !controlLines[namePropDescriptor].includes(
          "DetermineComponentFrameRoot"
        ); )
          namePropDescriptor++;
        if (RunInRootFrame === sampleLines.length || namePropDescriptor === controlLines.length)
          for (RunInRootFrame = sampleLines.length - 1, namePropDescriptor = controlLines.length - 1; 1 <= RunInRootFrame && 0 <= namePropDescriptor && sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; )
            namePropDescriptor--;
        for (; 1 <= RunInRootFrame && 0 <= namePropDescriptor; RunInRootFrame--, namePropDescriptor--)
          if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
            if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
              do
                if (RunInRootFrame--, namePropDescriptor--, 0 > namePropDescriptor || sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
                  var frame = "\n" + sampleLines[RunInRootFrame].replace(" at new ", " at ");
                  fn.displayName && frame.includes("<anonymous>") && (frame = frame.replace("<anonymous>", fn.displayName));
                  return frame;
                }
              while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
            }
            break;
          }
      }
    } finally {
      reentry = false, Error.prepareStackTrace = previousPrepareStackTrace;
    }
    return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(previousPrepareStackTrace) : "";
  }
  function describeFiber(fiber, childFiber) {
    switch (fiber.tag) {
      case 26:
      case 27:
      case 5:
        return describeBuiltInComponentFrame(fiber.type);
      case 16:
        return describeBuiltInComponentFrame("Lazy");
      case 13:
        return fiber.child !== childFiber && null !== childFiber ? describeBuiltInComponentFrame("Suspense Fallback") : describeBuiltInComponentFrame("Suspense");
      case 19:
        return describeBuiltInComponentFrame("SuspenseList");
      case 0:
      case 15:
        return describeNativeComponentFrame(fiber.type, false);
      case 11:
        return describeNativeComponentFrame(fiber.type.render, false);
      case 1:
        return describeNativeComponentFrame(fiber.type, true);
      case 31:
        return describeBuiltInComponentFrame("Activity");
      default:
        return "";
    }
  }
  function getStackByFiberInDevAndProd(workInProgress2) {
    try {
      var info = "", previous = null;
      do
        info += describeFiber(workInProgress2, previous), previous = workInProgress2, workInProgress2 = workInProgress2.return;
      while (workInProgress2);
      return info;
    } catch (x) {
      return "\nError generating stack: " + x.message + "\n" + x.stack;
    }
  }
  var hasOwnProperty = Object.prototype.hasOwnProperty, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now2 = Scheduler.unstable_now, getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null;
  function setIsStrictModeForDevtools(newIsStrictMode) {
    "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);
    if (injectedHook && "function" === typeof injectedHook.setStrictMode)
      try {
        injectedHook.setStrictMode(rendererID, newIsStrictMode);
      } catch (err) {
      }
  }
  var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2;
  function clz32Fallback(x) {
    x >>>= 0;
    return 0 === x ? 32 : 31 - (log(x) / LN2 | 0) | 0;
  }
  var nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304;
  function getHighestPriorityLanes(lanes) {
    var pendingSyncLanes = lanes & 42;
    if (0 !== pendingSyncLanes) return pendingSyncLanes;
    switch (lanes & -lanes) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
        return 64;
      case 128:
        return 128;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
        return lanes & 261888;
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return lanes & 3932160;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return lanes & 62914560;
      case 67108864:
        return 67108864;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 0;
      default:
        return lanes;
    }
  }
  function getNextLanes(root2, wipLanes, rootHasPendingCommit) {
    var pendingLanes = root2.pendingLanes;
    if (0 === pendingLanes) return 0;
    var nextLanes = 0, suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
    root2 = root2.warmLanes;
    var nonIdlePendingLanes = pendingLanes & 134217727;
    0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
    return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
  }
  function checkIfRootIsPrerendering(root2, renderLanes2) {
    return 0 === (root2.pendingLanes & ~(root2.suspendedLanes & ~root2.pingedLanes) & renderLanes2);
  }
  function computeExpirationTime(lane, currentTime) {
    switch (lane) {
      case 1:
      case 2:
      case 4:
      case 8:
      case 64:
        return currentTime + 250;
      case 16:
      case 32:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return currentTime + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        return -1;
      case 67108864:
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function claimNextRetryLane() {
    var lane = nextRetryLane;
    nextRetryLane <<= 1;
    0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
    return lane;
  }
  function createLaneMap(initial) {
    for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
    return laneMap;
  }
  function markRootUpdated$1(root2, updateLane) {
    root2.pendingLanes |= updateLane;
    268435456 !== updateLane && (root2.suspendedLanes = 0, root2.pingedLanes = 0, root2.warmLanes = 0);
  }
  function markRootFinished(root2, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
    var previouslyPendingLanes = root2.pendingLanes;
    root2.pendingLanes = remainingLanes;
    root2.suspendedLanes = 0;
    root2.pingedLanes = 0;
    root2.warmLanes = 0;
    root2.expiredLanes &= remainingLanes;
    root2.entangledLanes &= remainingLanes;
    root2.errorRecoveryDisabledLanes &= remainingLanes;
    root2.shellSuspendCounter = 0;
    var entanglements = root2.entanglements, expirationTimes = root2.expirationTimes, hiddenUpdates = root2.hiddenUpdates;
    for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
      var index$7 = 31 - clz32(remainingLanes), lane = 1 << index$7;
      entanglements[index$7] = 0;
      expirationTimes[index$7] = -1;
      var hiddenUpdatesForLane = hiddenUpdates[index$7];
      if (null !== hiddenUpdatesForLane)
        for (hiddenUpdates[index$7] = null, index$7 = 0; index$7 < hiddenUpdatesForLane.length; index$7++) {
          var update2 = hiddenUpdatesForLane[index$7];
          null !== update2 && (update2.lane &= -536870913);
        }
      remainingLanes &= ~lane;
    }
    0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, 0);
    0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root2.tag && (root2.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
  }
  function markSpawnedDeferredLane(root2, spawnedLane, entangledLanes) {
    root2.pendingLanes |= spawnedLane;
    root2.suspendedLanes &= ~spawnedLane;
    var spawnedLaneIndex = 31 - clz32(spawnedLane);
    root2.entangledLanes |= spawnedLane;
    root2.entanglements[spawnedLaneIndex] = root2.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930;
  }
  function markRootEntangled(root2, entangledLanes) {
    var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
    for (root2 = root2.entanglements; rootEntangledLanes; ) {
      var index$8 = 31 - clz32(rootEntangledLanes), lane = 1 << index$8;
      lane & entangledLanes | root2[index$8] & entangledLanes && (root2[index$8] |= entangledLanes);
      rootEntangledLanes &= ~lane;
    }
  }
  function getBumpedLaneForHydration(root2, renderLanes2) {
    var renderLane = renderLanes2 & -renderLanes2;
    renderLane = 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);
    return 0 !== (renderLane & (root2.suspendedLanes | renderLanes2)) ? 0 : renderLane;
  }
  function getBumpedLaneForHydrationByLane(lane) {
    switch (lane) {
      case 2:
        lane = 1;
        break;
      case 8:
        lane = 4;
        break;
      case 32:
        lane = 16;
        break;
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
        lane = 128;
        break;
      case 268435456:
        lane = 134217728;
        break;
      default:
        lane = 0;
    }
    return lane;
  }
  function lanesToEventPriority(lanes) {
    lanes &= -lanes;
    return 2 < lanes ? 8 < lanes ? 0 !== (lanes & 134217727) ? 32 : 268435456 : 8 : 2;
  }
  function resolveUpdatePriority() {
    var updatePriority = ReactDOMSharedInternals.p;
    if (0 !== updatePriority) return updatePriority;
    updatePriority = window.event;
    return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);
  }
  function runWithPriority(priority2, fn) {
    var previousPriority = ReactDOMSharedInternals.p;
    try {
      return ReactDOMSharedInternals.p = priority2, fn();
    } finally {
      ReactDOMSharedInternals.p = previousPriority;
    }
  }
  var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey, internalEventHandlerListenersKey = "__reactListeners$" + randomKey, internalEventHandlesSetKey = "__reactHandles$" + randomKey, internalRootNodeResourcesKey = "__reactResources$" + randomKey, internalHoistableMarker = "__reactMarker$" + randomKey;
  function detachDeletedInstance(node) {
    delete node[internalInstanceKey];
    delete node[internalPropsKey];
    delete node[internalEventHandlersKey];
    delete node[internalEventHandlerListenersKey];
    delete node[internalEventHandlesSetKey];
  }
  function getClosestInstanceFromNode(targetNode) {
    var targetInst = targetNode[internalInstanceKey];
    if (targetInst) return targetInst;
    for (var parentNode = targetNode.parentNode; parentNode; ) {
      if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) {
        parentNode = targetInst.alternate;
        if (null !== targetInst.child || null !== parentNode && null !== parentNode.child)
          for (targetNode = getParentHydrationBoundary(targetNode); null !== targetNode; ) {
            if (parentNode = targetNode[internalInstanceKey]) return parentNode;
            targetNode = getParentHydrationBoundary(targetNode);
          }
        return targetInst;
      }
      targetNode = parentNode;
      parentNode = targetNode.parentNode;
    }
    return null;
  }
  function getInstanceFromNode(node) {
    if (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) {
      var tag = node.tag;
      if (5 === tag || 6 === tag || 13 === tag || 31 === tag || 26 === tag || 27 === tag || 3 === tag)
        return node;
    }
    return null;
  }
  function getNodeFromInstance(inst) {
    var tag = inst.tag;
    if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;
    throw Error(formatProdErrorMessage(33));
  }
  function getResourcesFromRoot(root2) {
    var resources = root2[internalRootNodeResourcesKey];
    resources || (resources = root2[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() });
    return resources;
  }
  function markNodeAsHoistable(node) {
    node[internalHoistableMarker] = true;
  }
  var allNativeEvents = /* @__PURE__ */ new Set(), registrationNameDependencies = {};
  function registerTwoPhaseEvent(registrationName, dependencies) {
    registerDirectEvent(registrationName, dependencies);
    registerDirectEvent(registrationName + "Capture", dependencies);
  }
  function registerDirectEvent(registrationName, dependencies) {
    registrationNameDependencies[registrationName] = dependencies;
    for (registrationName = 0; registrationName < dependencies.length; registrationName++)
      allNativeEvents.add(dependencies[registrationName]);
  }
  var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
    "^[: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][: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\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
  ), illegalAttributeNameCache = {}, validatedAttributeNameCache = {};
  function isAttributeNameSafe(attributeName) {
    if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
      return true;
    if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false;
    if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
      return validatedAttributeNameCache[attributeName] = true;
    illegalAttributeNameCache[attributeName] = true;
    return false;
  }
  function setValueForAttribute(node, name, value) {
    if (isAttributeNameSafe(name))
      if (null === value) node.removeAttribute(name);
      else {
        switch (typeof value) {
          case "undefined":
          case "function":
          case "symbol":
            node.removeAttribute(name);
            return;
          case "boolean":
            var prefix$10 = name.toLowerCase().slice(0, 5);
            if ("data-" !== prefix$10 && "aria-" !== prefix$10) {
              node.removeAttribute(name);
              return;
            }
        }
        node.setAttribute(name, "" + value);
      }
  }
  function setValueForKnownAttribute(node, name, value) {
    if (null === value) node.removeAttribute(name);
    else {
      switch (typeof value) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          node.removeAttribute(name);
          return;
      }
      node.setAttribute(name, "" + value);
    }
  }
  function setValueForNamespacedAttribute(node, namespace, name, value) {
    if (null === value) node.removeAttribute(name);
    else {
      switch (typeof value) {
        case "undefined":
        case "function":
        case "symbol":
        case "boolean":
          node.removeAttribute(name);
          return;
      }
      node.setAttributeNS(namespace, name, "" + value);
    }
  }
  function getToStringValue(value) {
    switch (typeof value) {
      case "bigint":
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return value;
      case "object":
        return value;
      default:
        return "";
    }
  }
  function isCheckable(elem) {
    var type = elem.type;
    return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type);
  }
  function trackValueOnNode(node, valueField, currentValue) {
    var descriptor = Object.getOwnPropertyDescriptor(
      node.constructor.prototype,
      valueField
    );
    if (!node.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) {
      var get = descriptor.get, set = descriptor.set;
      Object.defineProperty(node, valueField, {
        configurable: true,
        get: function() {
          return get.call(this);
        },
        set: function(value) {
          currentValue = "" + value;
          set.call(this, value);
        }
      });
      Object.defineProperty(node, valueField, {
        enumerable: descriptor.enumerable
      });
      return {
        getValue: function() {
          return currentValue;
        },
        setValue: function(value) {
          currentValue = "" + value;
        },
        stopTracking: function() {
          node._valueTracker = null;
          delete node[valueField];
        }
      };
    }
  }
  function track(node) {
    if (!node._valueTracker) {
      var valueField = isCheckable(node) ? "checked" : "value";
      node._valueTracker = trackValueOnNode(
        node,
        valueField,
        "" + node[valueField]
      );
    }
  }
  function updateValueIfChanged(node) {
    if (!node) return false;
    var tracker = node._valueTracker;
    if (!tracker) return true;
    var lastValue = tracker.getValue();
    var value = "";
    node && (value = isCheckable(node) ? node.checked ? "true" : "false" : node.value);
    node = value;
    return node !== lastValue ? (tracker.setValue(node), true) : false;
  }
  function getActiveElement(doc) {
    doc = doc || ("undefined" !== typeof document ? document : void 0);
    if ("undefined" === typeof doc) return null;
    try {
      return doc.activeElement || doc.body;
    } catch (e2) {
      return doc.body;
    }
  }
  var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g;
  function escapeSelectorAttributeValueInsideDoubleQuotes(value) {
    return value.replace(
      escapeSelectorAttributeValueInsideDoubleQuotesRegex,
      function(ch) {
        return "\\" + ch.charCodeAt(0).toString(16) + " ";
      }
    );
  }
  function updateInput(element, value, defaultValue, lastDefaultValue, checked, defaultChecked, type, name) {
    element.name = "";
    null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? element.type = type : element.removeAttribute("type");
    if (null != value)
      if ("number" === type) {
        if (0 === value && "" === element.value || element.value != value)
          element.value = "" + getToStringValue(value);
      } else
        element.value !== "" + getToStringValue(value) && (element.value = "" + getToStringValue(value));
    else
      "submit" !== type && "reset" !== type || element.removeAttribute("value");
    null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) : null != lastDefaultValue && element.removeAttribute("value");
    null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked);
    null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked);
    null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name ? element.name = "" + getToStringValue(name) : element.removeAttribute("name");
  }
  function initInput(element, value, defaultValue, checked, defaultChecked, type, name, isHydrating2) {
    null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (element.type = type);
    if (null != value || null != defaultValue) {
      if (!("submit" !== type && "reset" !== type || void 0 !== value && null !== value)) {
        track(element);
        return;
      }
      defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
      value = null != value ? "" + getToStringValue(value) : defaultValue;
      isHydrating2 || value === element.value || (element.value = value);
      element.defaultValue = value;
    }
    checked = null != checked ? checked : defaultChecked;
    checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
    element.checked = isHydrating2 ? element.checked : !!checked;
    element.defaultChecked = !!checked;
    null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name && (element.name = name);
    track(element);
  }
  function setDefaultValue(node, type, value) {
    "number" === type && getActiveElement(node.ownerDocument) === node || node.defaultValue === "" + value || (node.defaultValue = "" + value);
  }
  function updateOptions(node, multiple, propValue, setDefaultSelected) {
    node = node.options;
    if (multiple) {
      multiple = {};
      for (var i = 0; i < propValue.length; i++)
        multiple["$" + propValue[i]] = true;
      for (propValue = 0; propValue < node.length; propValue++)
        i = multiple.hasOwnProperty("$" + node[propValue].value), node[propValue].selected !== i && (node[propValue].selected = i), i && setDefaultSelected && (node[propValue].defaultSelected = true);
    } else {
      propValue = "" + getToStringValue(propValue);
      multiple = null;
      for (i = 0; i < node.length; i++) {
        if (node[i].value === propValue) {
          node[i].selected = true;
          setDefaultSelected && (node[i].defaultSelected = true);
          return;
        }
        null !== multiple || node[i].disabled || (multiple = node[i]);
      }
      null !== multiple && (multiple.selected = true);
    }
  }
  function updateTextarea(element, value, defaultValue) {
    if (null != value && (value = "" + getToStringValue(value), value !== element.value && (element.value = value), null == defaultValue)) {
      element.defaultValue !== value && (element.defaultValue = value);
      return;
    }
    element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
  }
  function initTextarea(element, value, defaultValue, children) {
    if (null == value) {
      if (null != children) {
        if (null != defaultValue) throw Error(formatProdErrorMessage(92));
        if (isArrayImpl(children)) {
          if (1 < children.length) throw Error(formatProdErrorMessage(93));
          children = children[0];
        }
        defaultValue = children;
      }
      null == defaultValue && (defaultValue = "");
      value = defaultValue;
    }
    defaultValue = getToStringValue(value);
    element.defaultValue = defaultValue;
    children = element.textContent;
    children === defaultValue && "" !== children && null !== children && (element.value = children);
    track(element);
  }
  function setTextContent(node, text2) {
    if (text2) {
      var firstChild = node.firstChild;
      if (firstChild && firstChild === node.lastChild && 3 === firstChild.nodeType) {
        firstChild.nodeValue = text2;
        return;
      }
    }
    node.textContent = text2;
  }
  var unitlessNumbers = new Set(
    "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
      " "
    )
  );
  function setValueForStyle(style2, styleName, value) {
    var isCustomProperty = 0 === styleName.indexOf("--");
    null == value || "boolean" === typeof value || "" === value ? isCustomProperty ? style2.setProperty(styleName, "") : "float" === styleName ? style2.cssFloat = "" : style2[styleName] = "" : isCustomProperty ? style2.setProperty(styleName, value) : "number" !== typeof value || 0 === value || unitlessNumbers.has(styleName) ? "float" === styleName ? style2.cssFloat = value : style2[styleName] = ("" + value).trim() : style2[styleName] = value + "px";
  }
  function setValueForStyles(node, styles2, prevStyles) {
    if (null != styles2 && "object" !== typeof styles2)
      throw Error(formatProdErrorMessage(62));
    node = node.style;
    if (null != prevStyles) {
      for (var styleName in prevStyles)
        !prevStyles.hasOwnProperty(styleName) || null != styles2 && styles2.hasOwnProperty(styleName) || (0 === styleName.indexOf("--") ? node.setProperty(styleName, "") : "float" === styleName ? node.cssFloat = "" : node[styleName] = "");
      for (var styleName$16 in styles2)
        styleName = styles2[styleName$16], styles2.hasOwnProperty(styleName$16) && prevStyles[styleName$16] !== styleName && setValueForStyle(node, styleName$16, styleName);
    } else
      for (var styleName$17 in styles2)
        styles2.hasOwnProperty(styleName$17) && setValueForStyle(node, styleName$17, styles2[styleName$17]);
  }
  function isCustomElement(tagName) {
    if (-1 === tagName.indexOf("-")) return false;
    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 aliases = /* @__PURE__ */ new Map([
    ["acceptCharset", "accept-charset"],
    ["htmlFor", "for"],
    ["httpEquiv", "http-equiv"],
    ["crossOrigin", "crossorigin"],
    ["accentHeight", "accent-height"],
    ["alignmentBaseline", "alignment-baseline"],
    ["arabicForm", "arabic-form"],
    ["baselineShift", "baseline-shift"],
    ["capHeight", "cap-height"],
    ["clipPath", "clip-path"],
    ["clipRule", "clip-rule"],
    ["colorInterpolation", "color-interpolation"],
    ["colorInterpolationFilters", "color-interpolation-filters"],
    ["colorProfile", "color-profile"],
    ["colorRendering", "color-rendering"],
    ["dominantBaseline", "dominant-baseline"],
    ["enableBackground", "enable-background"],
    ["fillOpacity", "fill-opacity"],
    ["fillRule", "fill-rule"],
    ["floodColor", "flood-color"],
    ["floodOpacity", "flood-opacity"],
    ["fontFamily", "font-family"],
    ["fontSize", "font-size"],
    ["fontSizeAdjust", "font-size-adjust"],
    ["fontStretch", "font-stretch"],
    ["fontStyle", "font-style"],
    ["fontVariant", "font-variant"],
    ["fontWeight", "font-weight"],
    ["glyphName", "glyph-name"],
    ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
    ["glyphOrientationVertical", "glyph-orientation-vertical"],
    ["horizAdvX", "horiz-adv-x"],
    ["horizOriginX", "horiz-origin-x"],
    ["imageRendering", "image-rendering"],
    ["letterSpacing", "letter-spacing"],
    ["lightingColor", "lighting-color"],
    ["markerEnd", "marker-end"],
    ["markerMid", "marker-mid"],
    ["markerStart", "marker-start"],
    ["overlinePosition", "overline-position"],
    ["overlineThickness", "overline-thickness"],
    ["paintOrder", "paint-order"],
    ["panose-1", "panose-1"],
    ["pointerEvents", "pointer-events"],
    ["renderingIntent", "rendering-intent"],
    ["shapeRendering", "shape-rendering"],
    ["stopColor", "stop-color"],
    ["stopOpacity", "stop-opacity"],
    ["strikethroughPosition", "strikethrough-position"],
    ["strikethroughThickness", "strikethrough-thickness"],
    ["strokeDasharray", "stroke-dasharray"],
    ["strokeDashoffset", "stroke-dashoffset"],
    ["strokeLinecap", "stroke-linecap"],
    ["strokeLinejoin", "stroke-linejoin"],
    ["strokeMiterlimit", "stroke-miterlimit"],
    ["strokeOpacity", "stroke-opacity"],
    ["strokeWidth", "stroke-width"],
    ["textAnchor", "text-anchor"],
    ["textDecoration", "text-decoration"],
    ["textRendering", "text-rendering"],
    ["transformOrigin", "transform-origin"],
    ["underlinePosition", "underline-position"],
    ["underlineThickness", "underline-thickness"],
    ["unicodeBidi", "unicode-bidi"],
    ["unicodeRange", "unicode-range"],
    ["unitsPerEm", "units-per-em"],
    ["vAlphabetic", "v-alphabetic"],
    ["vHanging", "v-hanging"],
    ["vIdeographic", "v-ideographic"],
    ["vMathematical", "v-mathematical"],
    ["vectorEffect", "vector-effect"],
    ["vertAdvY", "vert-adv-y"],
    ["vertOriginX", "vert-origin-x"],
    ["vertOriginY", "vert-origin-y"],
    ["wordSpacing", "word-spacing"],
    ["writingMode", "writing-mode"],
    ["xmlnsXlink", "xmlns:xlink"],
    ["xHeight", "x-height"]
  ]), 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;
  function sanitizeURL(url) {
    return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url;
  }
  function noop$1() {
  }
  var currentReplayingEvent = null;
  function getEventTarget(nativeEvent) {
    nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
    nativeEvent.correspondingUseElement && (nativeEvent = nativeEvent.correspondingUseElement);
    return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
  }
  var restoreTarget = null, restoreQueue = null;
  function restoreStateOfTarget(target) {
    var internalInstance = getInstanceFromNode(target);
    if (internalInstance && (target = internalInstance.stateNode)) {
      var props = target[internalPropsKey] || null;
      a: switch (target = internalInstance.stateNode, internalInstance.type) {
        case "input":
          updateInput(
            target,
            props.value,
            props.defaultValue,
            props.defaultValue,
            props.checked,
            props.defaultChecked,
            props.type,
            props.name
          );
          internalInstance = props.name;
          if ("radio" === props.type && null != internalInstance) {
            for (props = target; props.parentNode; ) props = props.parentNode;
            props = props.querySelectorAll(
              'input[name="' + escapeSelectorAttributeValueInsideDoubleQuotes(
                "" + internalInstance
              ) + '"][type="radio"]'
            );
            for (internalInstance = 0; internalInstance < props.length; internalInstance++) {
              var otherNode = props[internalInstance];
              if (otherNode !== target && otherNode.form === target.form) {
                var otherProps = otherNode[internalPropsKey] || null;
                if (!otherProps) throw Error(formatProdErrorMessage(90));
                updateInput(
                  otherNode,
                  otherProps.value,
                  otherProps.defaultValue,
                  otherProps.defaultValue,
                  otherProps.checked,
                  otherProps.defaultChecked,
                  otherProps.type,
                  otherProps.name
                );
              }
            }
            for (internalInstance = 0; internalInstance < props.length; internalInstance++)
              otherNode = props[internalInstance], otherNode.form === target.form && updateValueIfChanged(otherNode);
          }
          break a;
        case "textarea":
          updateTextarea(target, props.value, props.defaultValue);
          break a;
        case "select":
          internalInstance = props.value, null != internalInstance && updateOptions(target, !!props.multiple, internalInstance, false);
      }
    }
  }
  var isInsideEventHandler = false;
  function batchedUpdates$1(fn, a, b) {
    if (isInsideEventHandler) return fn(a, b);
    isInsideEventHandler = true;
    try {
      var JSCompiler_inline_result = fn(a);
      return JSCompiler_inline_result;
    } finally {
      if (isInsideEventHandler = false, null !== restoreTarget || null !== restoreQueue) {
        if (flushSyncWork$1(), restoreTarget && (a = restoreTarget, fn = restoreQueue, restoreQueue = restoreTarget = null, restoreStateOfTarget(a), fn))
          for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]);
      }
    }
  }
  function getListener(inst, registrationName) {
    var stateNode = inst.stateNode;
    if (null === stateNode) return null;
    var props = stateNode[internalPropsKey] || null;
    if (null === props) return null;
    stateNode = props[registrationName];
    a: switch (registrationName) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (props = !props.disabled) || (inst = inst.type, props = !("button" === inst || "input" === inst || "select" === inst || "textarea" === inst));
        inst = !props;
        break a;
      default:
        inst = false;
    }
    if (inst) return null;
    if (stateNode && "function" !== typeof stateNode)
      throw Error(
        formatProdErrorMessage(231, registrationName, typeof stateNode)
      );
    return stateNode;
  }
  var canUseDOM = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), 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 (e2) {
      passiveBrowserEventsSupported = false;
    }
  var root = null, startText = null, fallbackText = null;
  function getData() {
    if (fallbackText) return fallbackText;
    var start2, startValue = startText, startLength = startValue.length, end, endValue = "value" in root ? root.value : root.textContent, endLength = endValue.length;
    for (start2 = 0; start2 < startLength && startValue[start2] === endValue[start2]; start2++) ;
    var minEnd = startLength - start2;
    for (end = 1; end <= minEnd && startValue[startLength - end] === endValue[endLength - end]; end++) ;
    return fallbackText = endValue.slice(start2, 1 < end ? 1 - end : void 0);
  }
  function getEventCharCode(nativeEvent) {
    var keyCode = nativeEvent.keyCode;
    "charCode" in nativeEvent ? (nativeEvent = nativeEvent.charCode, 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) : nativeEvent = keyCode;
    10 === nativeEvent && (nativeEvent = 13);
    return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 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)
        Interface.hasOwnProperty(propName) && (reactName = Interface[propName], this[propName] = reactName ? reactName(nativeEvent) : nativeEvent[propName]);
      this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse;
      this.isPropagationStopped = functionThatReturnsFalse;
      return this;
    }
    assign2(SyntheticBaseEvent.prototype, {
      preventDefault: function() {
        this.defaultPrevented = true;
        var event = this.nativeEvent;
        event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue);
      },
      stopPropagation: function() {
        var event = this.nativeEvent;
        event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue);
      },
      persist: function() {
      },
      isPersistent: functionThatReturnsTrue
    });
    return SyntheticBaseEvent;
  }
  var EventInterface = {
    eventPhase: 0,
    bubbles: 0,
    cancelable: 0,
    timeStamp: function(event) {
      return event.timeStamp || Date.now();
    },
    defaultPrevented: 0,
    isTrusted: 0
  }, SyntheticEvent = createSyntheticEvent(EventInterface), UIEventInterface = assign2({}, EventInterface, { view: 0, detail: 0 }), SyntheticUIEvent = createSyntheticEvent(UIEventInterface), lastMovementX, lastMovementY, lastMouseEvent, MouseEventInterface = assign2({}, 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) {
      return void 0 === event.relatedTarget ? event.fromElement === event.srcElement ? event.toElement : event.fromElement : event.relatedTarget;
    },
    movementX: function(event) {
      if ("movementX" in event) return event.movementX;
      event !== lastMouseEvent && (lastMouseEvent && "mousemove" === event.type ? (lastMovementX = event.screenX - lastMouseEvent.screenX, lastMovementY = event.screenY - lastMouseEvent.screenY) : lastMovementY = lastMovementX = 0, lastMouseEvent = event);
      return lastMovementX;
    },
    movementY: function(event) {
      return "movementY" in event ? event.movementY : lastMovementY;
    }
  }), SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), DragEventInterface = assign2({}, MouseEventInterface, { dataTransfer: 0 }), SyntheticDragEvent = createSyntheticEvent(DragEventInterface), FocusEventInterface = assign2({}, UIEventInterface, { relatedTarget: 0 }), SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), AnimationEventInterface = assign2({}, EventInterface, {
    animationName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), ClipboardEventInterface = assign2({}, EventInterface, {
    clipboardData: function(event) {
      return "clipboardData" in event ? event.clipboardData : window.clipboardData;
    }
  }), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign2({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, 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"
  }, modifierKeyToProp = {
    Alt: "altKey",
    Control: "ctrlKey",
    Meta: "metaKey",
    Shift: "shiftKey"
  };
  function modifierStateGetter(keyArg) {
    var nativeEvent = this.nativeEvent;
    return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) ? !!nativeEvent[keyArg] : false;
  }
  function getEventModifierState() {
    return modifierStateGetter;
  }
  var KeyboardEventInterface = assign2({}, UIEventInterface, {
    key: function(nativeEvent) {
      if (nativeEvent.key) {
        var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
        if ("Unidentified" !== key) return key;
      }
      return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
    },
    code: 0,
    location: 0,
    ctrlKey: 0,
    shiftKey: 0,
    altKey: 0,
    metaKey: 0,
    repeat: 0,
    locale: 0,
    getModifierState: getEventModifierState,
    charCode: function(event) {
      return "keypress" === event.type ? getEventCharCode(event) : 0;
    },
    keyCode: function(event) {
      return "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
    },
    which: function(event) {
      return "keypress" === event.type ? getEventCharCode(event) : "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
    }
  }), SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), PointerEventInterface = assign2({}, MouseEventInterface, {
    pointerId: 0,
    width: 0,
    height: 0,
    pressure: 0,
    tangentialPressure: 0,
    tiltX: 0,
    tiltY: 0,
    twist: 0,
    pointerType: 0,
    isPrimary: 0
  }), SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), TouchEventInterface = assign2({}, UIEventInterface, {
    touches: 0,
    targetTouches: 0,
    changedTouches: 0,
    altKey: 0,
    metaKey: 0,
    ctrlKey: 0,
    shiftKey: 0,
    getModifierState: getEventModifierState
  }), SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), TransitionEventInterface = assign2({}, EventInterface, {
    propertyName: 0,
    elapsedTime: 0,
    pseudoElement: 0
  }), SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), WheelEventInterface = assign2({}, MouseEventInterface, {
    deltaX: function(event) {
      return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
    },
    deltaY: function(event) {
      return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), ToggleEventInterface = assign2({}, EventInterface, {
    newState: 0,
    oldState: 0
  }), SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), END_KEYCODES = [9, 13, 27, 32], canUseCompositionEvent = canUseDOM && "CompositionEvent" in window, documentMode = null;
  canUseDOM && "documentMode" in document && (documentMode = document.documentMode);
  var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode, useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && 8 < documentMode && 11 >= documentMode), SPACEBAR_CHAR = String.fromCharCode(32), hasSpaceKeypress = false;
  function isFallbackCompositionEnd(domEventName, nativeEvent) {
    switch (domEventName) {
      case "keyup":
        return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
      case "keydown":
        return 229 !== nativeEvent.keyCode;
      case "keypress":
      case "mousedown":
      case "focusout":
        return true;
      default:
        return false;
    }
  }
  function getDataFromCustomEvent(nativeEvent) {
    nativeEvent = nativeEvent.detail;
    return "object" === typeof nativeEvent && "data" in nativeEvent ? nativeEvent.data : null;
  }
  var isComposing = false;
  function getNativeBeforeInputChars(domEventName, nativeEvent) {
    switch (domEventName) {
      case "compositionend":
        return getDataFromCustomEvent(nativeEvent);
      case "keypress":
        if (32 !== nativeEvent.which) return null;
        hasSpaceKeypress = true;
        return SPACEBAR_CHAR;
      case "textInput":
        return domEventName = nativeEvent.data, domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName;
      default:
        return null;
    }
  }
  function getFallbackBeforeInputChars(domEventName, nativeEvent) {
    if (isComposing)
      return "compositionend" === domEventName || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent) ? (domEventName = getData(), fallbackText = startText = root = null, isComposing = false, domEventName) : null;
    switch (domEventName) {
      case "paste":
        return null;
      case "keypress":
        if (!(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || nativeEvent.ctrlKey && nativeEvent.altKey) {
          if (nativeEvent.char && 1 < nativeEvent.char.length)
            return nativeEvent.char;
          if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);
        }
        return null;
      case "compositionend":
        return useFallbackCompositionData && "ko" !== nativeEvent.locale ? null : nativeEvent.data;
      default:
        return null;
    }
  }
  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();
    return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName ? true : false;
  }
  function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
    restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [target] : restoreTarget = target;
    inst = accumulateTwoPhaseListeners(inst, "onChange");
    0 < inst.length && (nativeEvent = new SyntheticEvent(
      "onChange",
      "change",
      null,
      nativeEvent,
      target
    ), dispatchQueue.push({ event: nativeEvent, listeners: inst }));
  }
  var activeElement$1 = null, activeElementInst$1 = null;
  function runEventInBatch(dispatchQueue) {
    processDispatchQueue(dispatchQueue, 0);
  }
  function getInstIfValueChanged(targetInst) {
    var targetNode = getNodeFromInstance(targetInst);
    if (updateValueIfChanged(targetNode)) return targetInst;
  }
  function getTargetInstForChangeEvent(domEventName, targetInst) {
    if ("change" === domEventName) return targetInst;
  }
  var isInputEventSupported = false;
  if (canUseDOM) {
    var JSCompiler_inline_result$jscomp$286;
    if (canUseDOM) {
      var isSupported$jscomp$inline_427 = "oninput" in document;
      if (!isSupported$jscomp$inline_427) {
        var element$jscomp$inline_428 = document.createElement("div");
        element$jscomp$inline_428.setAttribute("oninput", "return;");
        isSupported$jscomp$inline_427 = "function" === typeof element$jscomp$inline_428.oninput;
      }
      JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_427;
    } else JSCompiler_inline_result$jscomp$286 = false;
    isInputEventSupported = JSCompiler_inline_result$jscomp$286 && (!document.documentMode || 9 < document.documentMode);
  }
  function stopWatchingForValueChange() {
    activeElement$1 && (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), activeElementInst$1 = activeElement$1 = null);
  }
  function handlePropertyChange(nativeEvent) {
    if ("value" === nativeEvent.propertyName && getInstIfValueChanged(activeElementInst$1)) {
      var dispatchQueue = [];
      createAndAccumulateChangeEvent(
        dispatchQueue,
        activeElementInst$1,
        nativeEvent,
        getEventTarget(nativeEvent)
      );
      batchedUpdates$1(runEventInBatch, dispatchQueue);
    }
  }
  function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
    "focusin" === domEventName ? (stopWatchingForValueChange(), activeElement$1 = target, activeElementInst$1 = targetInst, activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) : "focusout" === domEventName && stopWatchingForValueChange();
  }
  function getTargetInstForInputEventPolyfill(domEventName) {
    if ("selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName)
      return getInstIfValueChanged(activeElementInst$1);
  }
  function getTargetInstForClickEvent(domEventName, targetInst) {
    if ("click" === domEventName) return getInstIfValueChanged(targetInst);
  }
  function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
    if ("input" === domEventName || "change" === domEventName)
      return getInstIfValueChanged(targetInst);
  }
  function is2(x, y) {
    return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
  }
  var objectIs = "function" === typeof Object.is ? Object.is : is2;
  function shallowEqual(objA, objB) {
    if (objectIs(objA, objB)) return true;
    if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB)
      return false;
    var keysA = Object.keys(objA), keysB = Object.keys(objB);
    if (keysA.length !== keysB.length) return false;
    for (keysB = 0; keysB < keysA.length; keysB++) {
      var currentKey = keysA[keysB];
      if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
        return false;
    }
    return true;
  }
  function getLeafNode(node) {
    for (; node && node.firstChild; ) node = node.firstChild;
    return node;
  }
  function getNodeForCharacterOffset(root2, offset) {
    var node = getLeafNode(root2);
    root2 = 0;
    for (var nodeEnd; node; ) {
      if (3 === node.nodeType) {
        nodeEnd = root2 + node.textContent.length;
        if (root2 <= offset && nodeEnd >= offset)
          return { node, offset: offset - root2 };
        root2 = nodeEnd;
      }
      a: {
        for (; node; ) {
          if (node.nextSibling) {
            node = node.nextSibling;
            break a;
          }
          node = node.parentNode;
        }
        node = void 0;
      }
      node = getLeafNode(node);
    }
  }
  function containsNode(outerNode, innerNode) {
    return outerNode && innerNode ? outerNode === innerNode ? true : outerNode && 3 === outerNode.nodeType ? false : innerNode && 3 === innerNode.nodeType ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : outerNode.compareDocumentPosition ? !!(outerNode.compareDocumentPosition(innerNode) & 16) : false : false;
  }
  function getActiveElementDeep(containerInfo) {
    containerInfo = null != containerInfo && null != containerInfo.ownerDocument && null != containerInfo.ownerDocument.defaultView ? containerInfo.ownerDocument.defaultView : window;
    for (var element = getActiveElement(containerInfo.document); element instanceof containerInfo.HTMLIFrameElement; ) {
      try {
        var JSCompiler_inline_result = "string" === typeof element.contentWindow.location.href;
      } catch (err) {
        JSCompiler_inline_result = false;
      }
      if (JSCompiler_inline_result) containerInfo = element.contentWindow;
      else break;
      element = getActiveElement(containerInfo.document);
    }
    return element;
  }
  function hasSelectionCapabilities(elem) {
    var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
    return nodeName && ("input" === nodeName && ("text" === elem.type || "search" === elem.type || "tel" === elem.type || "url" === elem.type || "password" === elem.type) || "textarea" === nodeName || "true" === elem.contentEditable);
  }
  var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, activeElementInst = null, lastSelection = null, mouseDown = false;
  function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
    var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : 9 === nativeEventTarget.nodeType ? nativeEventTarget : nativeEventTarget.ownerDocument;
    mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || (doc = activeElement, "selectionStart" in doc && hasSelectionCapabilities(doc) ? doc = { start: doc.selectionStart, end: doc.selectionEnd } : (doc = (doc.ownerDocument && doc.ownerDocument.defaultView || window).getSelection(), doc = {
      anchorNode: doc.anchorNode,
      anchorOffset: doc.anchorOffset,
      focusNode: doc.focusNode,
      focusOffset: doc.focusOffset
    }), lastSelection && shallowEqual(lastSelection, doc) || (lastSelection = doc, doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect"), 0 < doc.length && (nativeEvent = new SyntheticEvent(
      "onSelect",
      "select",
      null,
      nativeEvent,
      nativeEventTarget
    ), dispatchQueue.push({ event: nativeEvent, listeners: doc }), nativeEvent.target = activeElement)));
  }
  function makePrefixMap(styleProp, eventName) {
    var prefixes2 = {};
    prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
    prefixes2["Webkit" + styleProp] = "webkit" + eventName;
    prefixes2["Moz" + styleProp] = "moz" + eventName;
    return prefixes2;
  }
  var vendorPrefixes = {
    animationend: makePrefixMap("Animation", "AnimationEnd"),
    animationiteration: makePrefixMap("Animation", "AnimationIteration"),
    animationstart: makePrefixMap("Animation", "AnimationStart"),
    transitionrun: makePrefixMap("Transition", "TransitionRun"),
    transitionstart: makePrefixMap("Transition", "TransitionStart"),
    transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
    transitionend: makePrefixMap("Transition", "TransitionEnd")
  }, prefixedEventNames = {}, style = {};
  canUseDOM && (style = document.createElement("div").style, "AnimationEvent" in window || (delete vendorPrefixes.animationend.animation, delete vendorPrefixes.animationiteration.animation, delete vendorPrefixes.animationstart.animation), "TransitionEvent" in window || delete vendorPrefixes.transitionend.transition);
  function getVendorPrefixedEventName(eventName) {
    if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
    if (!vendorPrefixes[eventName]) return eventName;
    var prefixMap = vendorPrefixes[eventName], styleProp;
    for (styleProp in prefixMap)
      if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)
        return prefixedEventNames[eventName] = prefixMap[styleProp];
    return eventName;
  }
  var ANIMATION_END = getVendorPrefixedEventName("animationend"), ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), ANIMATION_START = getVendorPrefixedEventName("animationstart"), TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), TRANSITION_START = getVendorPrefixedEventName("transitionstart"), TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), TRANSITION_END = getVendorPrefixedEventName("transitionend"), topLevelEventsToReactNames = /* @__PURE__ */ new Map(), simpleEventPluginEvents = "abort auxClick beforeToggle 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".split(
    " "
  );
  simpleEventPluginEvents.push("scrollEnd");
  function registerSimpleEvent(domEventName, reactName) {
    topLevelEventsToReactNames.set(domEventName, reactName);
    registerTwoPhaseEvent(reactName, [domEventName]);
  }
  var reportGlobalError = "function" === typeof reportError ? reportError : function(error2) {
    if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
      var event = new window.ErrorEvent("error", {
        bubbles: true,
        cancelable: true,
        message: "object" === typeof error2 && null !== error2 && "string" === typeof error2.message ? String(error2.message) : String(error2),
        error: error2
      });
      if (!window.dispatchEvent(event)) return;
    } else if ("object" === typeof process && "function" === typeof process.emit) {
      process.emit("uncaughtException", error2);
      return;
    }
    console.error(error2);
  }, concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0;
  function finishQueueingConcurrentUpdates() {
    for (var endIndex = concurrentQueuesIndex, i = concurrentlyUpdatedLanes = concurrentQueuesIndex = 0; i < endIndex; ) {
      var fiber = concurrentQueues[i];
      concurrentQueues[i++] = null;
      var queue = concurrentQueues[i];
      concurrentQueues[i++] = null;
      var update2 = concurrentQueues[i];
      concurrentQueues[i++] = null;
      var lane = concurrentQueues[i];
      concurrentQueues[i++] = null;
      if (null !== queue && null !== update2) {
        var pending = queue.pending;
        null === pending ? update2.next = update2 : (update2.next = pending.next, pending.next = update2);
        queue.pending = update2;
      }
      0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update2, lane);
    }
  }
  function enqueueUpdate$1(fiber, queue, update2, lane) {
    concurrentQueues[concurrentQueuesIndex++] = fiber;
    concurrentQueues[concurrentQueuesIndex++] = queue;
    concurrentQueues[concurrentQueuesIndex++] = update2;
    concurrentQueues[concurrentQueuesIndex++] = lane;
    concurrentlyUpdatedLanes |= lane;
    fiber.lanes |= lane;
    fiber = fiber.alternate;
    null !== fiber && (fiber.lanes |= lane);
  }
  function enqueueConcurrentHookUpdate(fiber, queue, update2, lane) {
    enqueueUpdate$1(fiber, queue, update2, lane);
    return getRootForUpdatedFiber(fiber);
  }
  function enqueueConcurrentRenderForLane(fiber, lane) {
    enqueueUpdate$1(fiber, null, null, lane);
    return getRootForUpdatedFiber(fiber);
  }
  function markUpdateLaneFromFiberToRoot(sourceFiber, update2, lane) {
    sourceFiber.lanes |= lane;
    var alternate = sourceFiber.alternate;
    null !== alternate && (alternate.lanes |= lane);
    for (var isHidden = false, parent = sourceFiber.return; null !== parent; )
      parent.childLanes |= lane, alternate = parent.alternate, null !== alternate && (alternate.childLanes |= lane), 22 === parent.tag && (sourceFiber = parent.stateNode, null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = true)), sourceFiber = parent, parent = parent.return;
    return 3 === sourceFiber.tag ? (parent = sourceFiber.stateNode, isHidden && null !== update2 && (isHidden = 31 - clz32(lane), sourceFiber = parent.hiddenUpdates, alternate = sourceFiber[isHidden], null === alternate ? sourceFiber[isHidden] = [update2] : alternate.push(update2), update2.lane = lane | 536870912), parent) : null;
  }
  function getRootForUpdatedFiber(sourceFiber) {
    if (50 < nestedUpdateCount)
      throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error(formatProdErrorMessage(185));
    for (var parent = sourceFiber.return; null !== parent; )
      sourceFiber = parent, parent = sourceFiber.return;
    return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
  }
  var emptyContextObject = {};
  function FiberNode(tag, pendingProps, key, mode) {
    this.tag = tag;
    this.key = key;
    this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
    this.index = 0;
    this.refCleanup = this.ref = null;
    this.pendingProps = pendingProps;
    this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
    this.mode = mode;
    this.subtreeFlags = this.flags = 0;
    this.deletions = null;
    this.childLanes = this.lanes = 0;
    this.alternate = null;
  }
  function createFiberImplClass(tag, pendingProps, key, mode) {
    return new FiberNode(tag, pendingProps, key, mode);
  }
  function shouldConstruct(Component) {
    Component = Component.prototype;
    return !(!Component || !Component.isReactComponent);
  }
  function createWorkInProgress(current, pendingProps) {
    var workInProgress2 = current.alternate;
    null === workInProgress2 ? (workInProgress2 = createFiberImplClass(
      current.tag,
      pendingProps,
      current.key,
      current.mode
    ), workInProgress2.elementType = current.elementType, workInProgress2.type = current.type, workInProgress2.stateNode = current.stateNode, workInProgress2.alternate = current, current.alternate = workInProgress2) : (workInProgress2.pendingProps = pendingProps, workInProgress2.type = current.type, workInProgress2.flags = 0, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null);
    workInProgress2.flags = current.flags & 65011712;
    workInProgress2.childLanes = current.childLanes;
    workInProgress2.lanes = current.lanes;
    workInProgress2.child = current.child;
    workInProgress2.memoizedProps = current.memoizedProps;
    workInProgress2.memoizedState = current.memoizedState;
    workInProgress2.updateQueue = current.updateQueue;
    pendingProps = current.dependencies;
    workInProgress2.dependencies = null === pendingProps ? null : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
    workInProgress2.sibling = current.sibling;
    workInProgress2.index = current.index;
    workInProgress2.ref = current.ref;
    workInProgress2.refCleanup = current.refCleanup;
    return workInProgress2;
  }
  function resetWorkInProgress(workInProgress2, renderLanes2) {
    workInProgress2.flags &= 65011714;
    var current = workInProgress2.alternate;
    null === current ? (workInProgress2.childLanes = 0, workInProgress2.lanes = renderLanes2, workInProgress2.child = null, workInProgress2.subtreeFlags = 0, workInProgress2.memoizedProps = null, workInProgress2.memoizedState = null, workInProgress2.updateQueue = null, workInProgress2.dependencies = null, workInProgress2.stateNode = null) : (workInProgress2.childLanes = current.childLanes, workInProgress2.lanes = current.lanes, workInProgress2.child = current.child, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.memoizedProps = current.memoizedProps, workInProgress2.memoizedState = current.memoizedState, workInProgress2.updateQueue = current.updateQueue, workInProgress2.type = current.type, renderLanes2 = current.dependencies, workInProgress2.dependencies = null === renderLanes2 ? null : {
      lanes: renderLanes2.lanes,
      firstContext: renderLanes2.firstContext
    });
    return workInProgress2;
  }
  function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
    var fiberTag = 0;
    owner = type;
    if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
    else if ("string" === typeof type)
      fiberTag = isHostHoistableType(
        type,
        pendingProps,
        contextStackCursor.current
      ) ? 26 : "html" === type || "head" === type || "body" === type ? 27 : 5;
    else
      a: switch (type) {
        case REACT_ACTIVITY_TYPE:
          return type = createFiberImplClass(31, pendingProps, key, mode), type.elementType = REACT_ACTIVITY_TYPE, type.lanes = lanes, type;
        case REACT_FRAGMENT_TYPE:
          return createFiberFromFragment(pendingProps.children, mode, lanes, key);
        case REACT_STRICT_MODE_TYPE:
          fiberTag = 8;
          mode |= 24;
          break;
        case REACT_PROFILER_TYPE:
          return type = createFiberImplClass(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type;
        case REACT_SUSPENSE_TYPE:
          return type = createFiberImplClass(13, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type;
        case REACT_SUSPENSE_LIST_TYPE:
          return type = createFiberImplClass(19, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type;
        default:
          if ("object" === typeof type && null !== type)
            switch (type.$$typeof) {
              case REACT_CONTEXT_TYPE:
                fiberTag = 10;
                break a;
              case REACT_CONSUMER_TYPE:
                fiberTag = 9;
                break a;
              case REACT_FORWARD_REF_TYPE:
                fiberTag = 11;
                break a;
              case REACT_MEMO_TYPE:
                fiberTag = 14;
                break a;
              case REACT_LAZY_TYPE:
                fiberTag = 16;
                owner = null;
                break a;
            }
          fiberTag = 29;
          pendingProps = Error(
            formatProdErrorMessage(130, null === type ? "null" : typeof type, "")
          );
          owner = null;
      }
    key = createFiberImplClass(fiberTag, pendingProps, key, mode);
    key.elementType = type;
    key.type = owner;
    key.lanes = lanes;
    return key;
  }
  function createFiberFromFragment(elements, mode, lanes, key) {
    elements = createFiberImplClass(7, elements, key, mode);
    elements.lanes = lanes;
    return elements;
  }
  function createFiberFromText(content2, mode, lanes) {
    content2 = createFiberImplClass(6, content2, null, mode);
    content2.lanes = lanes;
    return content2;
  }
  function createFiberFromDehydratedFragment(dehydratedNode) {
    var fiber = createFiberImplClass(18, null, null, 0);
    fiber.stateNode = dehydratedNode;
    return fiber;
  }
  function createFiberFromPortal(portal, mode, lanes) {
    mode = createFiberImplClass(
      4,
      null !== portal.children ? portal.children : [],
      portal.key,
      mode
    );
    mode.lanes = lanes;
    mode.stateNode = {
      containerInfo: portal.containerInfo,
      pendingChildren: null,
      implementation: portal.implementation
    };
    return mode;
  }
  var CapturedStacks = /* @__PURE__ */ new WeakMap();
  function createCapturedValueAtFiber(value, source) {
    if ("object" === typeof value && null !== value) {
      var existing = CapturedStacks.get(value);
      if (void 0 !== existing) return existing;
      source = {
        value,
        source,
        stack: getStackByFiberInDevAndProd(source)
      };
      CapturedStacks.set(value, source);
      return source;
    }
    return {
      value,
      source,
      stack: getStackByFiberInDevAndProd(source)
    };
  }
  var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "";
  function pushTreeFork(workInProgress2, totalChildren) {
    forkStack[forkStackIndex++] = treeForkCount;
    forkStack[forkStackIndex++] = treeForkProvider;
    treeForkProvider = workInProgress2;
    treeForkCount = totalChildren;
  }
  function pushTreeId(workInProgress2, totalChildren, index2) {
    idStack[idStackIndex++] = treeContextId;
    idStack[idStackIndex++] = treeContextOverflow;
    idStack[idStackIndex++] = treeContextProvider;
    treeContextProvider = workInProgress2;
    var baseIdWithLeadingBit = treeContextId;
    workInProgress2 = treeContextOverflow;
    var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
    baseIdWithLeadingBit &= ~(1 << baseLength);
    index2 += 1;
    var length = 32 - clz32(totalChildren) + baseLength;
    if (30 < length) {
      var numberOfOverflowBits = baseLength - baseLength % 5;
      length = (baseIdWithLeadingBit & (1 << numberOfOverflowBits) - 1).toString(32);
      baseIdWithLeadingBit >>= numberOfOverflowBits;
      baseLength -= numberOfOverflowBits;
      treeContextId = 1 << 32 - clz32(totalChildren) + baseLength | index2 << baseLength | baseIdWithLeadingBit;
      treeContextOverflow = length + workInProgress2;
    } else
      treeContextId = 1 << length | index2 << baseLength | baseIdWithLeadingBit, treeContextOverflow = workInProgress2;
  }
  function pushMaterializedTreeId(workInProgress2) {
    null !== workInProgress2.return && (pushTreeFork(workInProgress2, 1), pushTreeId(workInProgress2, 1, 0));
  }
  function popTreeContext(workInProgress2) {
    for (; workInProgress2 === treeForkProvider; )
      treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, treeForkCount = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null;
    for (; workInProgress2 === treeContextProvider; )
      treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextOverflow = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextId = idStack[--idStackIndex], idStack[idStackIndex] = null;
  }
  function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
    idStack[idStackIndex++] = treeContextId;
    idStack[idStackIndex++] = treeContextOverflow;
    idStack[idStackIndex++] = treeContextProvider;
    treeContextId = suspendedContext.id;
    treeContextOverflow = suspendedContext.overflow;
    treeContextProvider = workInProgress2;
  }
  var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519));
  function throwOnHydrationMismatch(fiber) {
    var error2 = Error(
      formatProdErrorMessage(
        418,
        1 < arguments.length && void 0 !== arguments[1] && arguments[1] ? "text" : "HTML",
        ""
      )
    );
    queueHydrationError(createCapturedValueAtFiber(error2, fiber));
    throw HydrationMismatchException;
  }
  function prepareToHydrateHostInstance(fiber) {
    var instance = fiber.stateNode, type = fiber.type, props = fiber.memoizedProps;
    instance[internalInstanceKey] = fiber;
    instance[internalPropsKey] = props;
    switch (type) {
      case "dialog":
        listenToNonDelegatedEvent("cancel", instance);
        listenToNonDelegatedEvent("close", instance);
        break;
      case "iframe":
      case "object":
      case "embed":
        listenToNonDelegatedEvent("load", instance);
        break;
      case "video":
      case "audio":
        for (type = 0; type < mediaEventTypes.length; type++)
          listenToNonDelegatedEvent(mediaEventTypes[type], instance);
        break;
      case "source":
        listenToNonDelegatedEvent("error", instance);
        break;
      case "img":
      case "image":
      case "link":
        listenToNonDelegatedEvent("error", instance);
        listenToNonDelegatedEvent("load", instance);
        break;
      case "details":
        listenToNonDelegatedEvent("toggle", instance);
        break;
      case "input":
        listenToNonDelegatedEvent("invalid", instance);
        initInput(
          instance,
          props.value,
          props.defaultValue,
          props.checked,
          props.defaultChecked,
          props.type,
          props.name,
          true
        );
        break;
      case "select":
        listenToNonDelegatedEvent("invalid", instance);
        break;
      case "textarea":
        listenToNonDelegatedEvent("invalid", instance), initTextarea(instance, props.value, props.defaultValue, props.children);
    }
    type = props.children;
    "string" !== typeof type && "number" !== typeof type && "bigint" !== typeof type || instance.textContent === "" + type || true === props.suppressHydrationWarning || checkForUnmatchedText(instance.textContent, type) ? (null != props.popover && (listenToNonDelegatedEvent("beforetoggle", instance), listenToNonDelegatedEvent("toggle", instance)), null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$1), instance = true) : instance = false;
    instance || throwOnHydrationMismatch(fiber, true);
  }
  function popToNextHostParent(fiber) {
    for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
      switch (hydrationParentFiber.tag) {
        case 5:
        case 31:
        case 13:
          rootOrSingletonContext = false;
          return;
        case 27:
        case 3:
          rootOrSingletonContext = true;
          return;
        default:
          hydrationParentFiber = hydrationParentFiber.return;
      }
  }
  function popHydrationState(fiber) {
    if (fiber !== hydrationParentFiber) return false;
    if (!isHydrating) return popToNextHostParent(fiber), isHydrating = true, false;
    var tag = fiber.tag, JSCompiler_temp;
    if (JSCompiler_temp = 3 !== tag && 27 !== tag) {
      if (JSCompiler_temp = 5 === tag)
        JSCompiler_temp = fiber.type, JSCompiler_temp = !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || shouldSetTextContent(fiber.type, fiber.memoizedProps);
      JSCompiler_temp = !JSCompiler_temp;
    }
    JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);
    popToNextHostParent(fiber);
    if (13 === tag) {
      fiber = fiber.memoizedState;
      fiber = null !== fiber ? fiber.dehydrated : null;
      if (!fiber) throw Error(formatProdErrorMessage(317));
      nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
    } else if (31 === tag) {
      fiber = fiber.memoizedState;
      fiber = null !== fiber ? fiber.dehydrated : null;
      if (!fiber) throw Error(formatProdErrorMessage(317));
      nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
    } else
      27 === tag ? (tag = nextHydratableInstance, isSingletonScope(fiber.type) ? (fiber = previousHydratableOnEnteringScopedSingleton, previousHydratableOnEnteringScopedSingleton = null, nextHydratableInstance = fiber) : nextHydratableInstance = tag) : nextHydratableInstance = hydrationParentFiber ? getNextHydratable(fiber.stateNode.nextSibling) : null;
    return true;
  }
  function resetHydrationState() {
    nextHydratableInstance = hydrationParentFiber = null;
    isHydrating = false;
  }
  function upgradeHydrationErrorsToRecoverable() {
    var queuedErrors = hydrationErrors;
    null !== queuedErrors && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(
      workInProgressRootRecoverableErrors,
      queuedErrors
    ), hydrationErrors = null);
    return queuedErrors;
  }
  function queueHydrationError(error2) {
    null === hydrationErrors ? hydrationErrors = [error2] : hydrationErrors.push(error2);
  }
  var valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null;
  function pushProvider(providerFiber, context, nextValue) {
    push(valueCursor, context._currentValue);
    context._currentValue = nextValue;
  }
  function popProvider(context) {
    context._currentValue = valueCursor.current;
    pop(valueCursor);
  }
  function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
    for (; null !== parent; ) {
      var alternate = parent.alternate;
      (parent.childLanes & renderLanes2) !== renderLanes2 ? (parent.childLanes |= renderLanes2, null !== alternate && (alternate.childLanes |= renderLanes2)) : null !== alternate && (alternate.childLanes & renderLanes2) !== renderLanes2 && (alternate.childLanes |= renderLanes2);
      if (parent === propagationRoot) break;
      parent = parent.return;
    }
  }
  function propagateContextChanges(workInProgress2, contexts, renderLanes2, forcePropagateEntireTree) {
    var fiber = workInProgress2.child;
    null !== fiber && (fiber.return = workInProgress2);
    for (; null !== fiber; ) {
      var list = fiber.dependencies;
      if (null !== list) {
        var nextFiber = fiber.child;
        list = list.firstContext;
        a: for (; null !== list; ) {
          var dependency = list;
          list = fiber;
          for (var i = 0; i < contexts.length; i++)
            if (dependency.context === contexts[i]) {
              list.lanes |= renderLanes2;
              dependency = list.alternate;
              null !== dependency && (dependency.lanes |= renderLanes2);
              scheduleContextWorkOnParentPath(
                list.return,
                renderLanes2,
                workInProgress2
              );
              forcePropagateEntireTree || (nextFiber = null);
              break a;
            }
          list = dependency.next;
        }
      } else if (18 === fiber.tag) {
        nextFiber = fiber.return;
        if (null === nextFiber) throw Error(formatProdErrorMessage(341));
        nextFiber.lanes |= renderLanes2;
        list = nextFiber.alternate;
        null !== list && (list.lanes |= renderLanes2);
        scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
        nextFiber = null;
      } else nextFiber = fiber.child;
      if (null !== nextFiber) nextFiber.return = fiber;
      else
        for (nextFiber = fiber; null !== nextFiber; ) {
          if (nextFiber === workInProgress2) {
            nextFiber = null;
            break;
          }
          fiber = nextFiber.sibling;
          if (null !== fiber) {
            fiber.return = nextFiber.return;
            nextFiber = fiber;
            break;
          }
          nextFiber = nextFiber.return;
        }
      fiber = nextFiber;
    }
  }
  function propagateParentContextChanges(current, workInProgress2, renderLanes2, forcePropagateEntireTree) {
    current = null;
    for (var parent = workInProgress2, isInsidePropagationBailout = false; null !== parent; ) {
      if (!isInsidePropagationBailout) {
        if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
        else if (0 !== (parent.flags & 262144)) break;
      }
      if (10 === parent.tag) {
        var currentParent = parent.alternate;
        if (null === currentParent) throw Error(formatProdErrorMessage(387));
        currentParent = currentParent.memoizedProps;
        if (null !== currentParent) {
          var context = parent.type;
          objectIs(parent.pendingProps.value, currentParent.value) || (null !== current ? current.push(context) : current = [context]);
        }
      } else if (parent === hostTransitionProviderCursor.current) {
        currentParent = parent.alternate;
        if (null === currentParent) throw Error(formatProdErrorMessage(387));
        currentParent.memoizedState.memoizedState !== parent.memoizedState.memoizedState && (null !== current ? current.push(HostTransitionContext) : current = [HostTransitionContext]);
      }
      parent = parent.return;
    }
    null !== current && propagateContextChanges(
      workInProgress2,
      current,
      renderLanes2,
      forcePropagateEntireTree
    );
    workInProgress2.flags |= 262144;
  }
  function checkIfContextChanged(currentDependencies) {
    for (currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) {
      if (!objectIs(
        currentDependencies.context._currentValue,
        currentDependencies.memoizedValue
      ))
        return true;
      currentDependencies = currentDependencies.next;
    }
    return false;
  }
  function prepareToReadContext(workInProgress2) {
    currentlyRenderingFiber$1 = workInProgress2;
    lastContextDependency = null;
    workInProgress2 = workInProgress2.dependencies;
    null !== workInProgress2 && (workInProgress2.firstContext = null);
  }
  function readContext(context) {
    return readContextForConsumer(currentlyRenderingFiber$1, context);
  }
  function readContextDuringReconciliation(consumer, context) {
    null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
    return readContextForConsumer(consumer, context);
  }
  function readContextForConsumer(consumer, context) {
    var value = context._currentValue;
    context = { context, memoizedValue: value, next: null };
    if (null === lastContextDependency) {
      if (null === consumer) throw Error(formatProdErrorMessage(308));
      lastContextDependency = context;
      consumer.dependencies = { lanes: 0, firstContext: context };
      consumer.flags |= 524288;
    } else lastContextDependency = lastContextDependency.next = context;
    return value;
  }
  var AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
    var listeners = [], signal = this.signal = {
      aborted: false,
      addEventListener: function(type, listener) {
        listeners.push(listener);
      }
    };
    this.abort = function() {
      signal.aborted = true;
      listeners.forEach(function(listener) {
        return listener();
      });
    };
  }, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, NormalPriority = Scheduler.unstable_NormalPriority, CacheContext = {
    $$typeof: REACT_CONTEXT_TYPE,
    Consumer: null,
    Provider: null,
    _currentValue: null,
    _currentValue2: null,
    _threadCount: 0
  };
  function createCache() {
    return {
      controller: new AbortControllerLocal(),
      data: /* @__PURE__ */ new Map(),
      refCount: 0
    };
  }
  function releaseCache(cache) {
    cache.refCount--;
    0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
      cache.controller.abort();
    });
  }
  var currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null;
  function entangleAsyncAction(transition, thenable) {
    if (null === currentEntangledListeners) {
      var entangledListeners = currentEntangledListeners = [];
      currentEntangledPendingCount = 0;
      currentEntangledLane = requestTransitionLane();
      currentEntangledActionThenable = {
        status: "pending",
        value: void 0,
        then: function(resolve) {
          entangledListeners.push(resolve);
        }
      };
    }
    currentEntangledPendingCount++;
    thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
    return thenable;
  }
  function pingEngtangledActionScope() {
    if (0 === --currentEntangledPendingCount && null !== currentEntangledListeners) {
      null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled");
      var listeners = currentEntangledListeners;
      currentEntangledListeners = null;
      currentEntangledLane = 0;
      currentEntangledActionThenable = null;
      for (var i = 0; i < listeners.length; i++) (0, listeners[i])();
    }
  }
  function chainThenableValue(thenable, result) {
    var listeners = [], thenableWithOverride = {
      status: "pending",
      value: null,
      reason: null,
      then: function(resolve) {
        listeners.push(resolve);
      }
    };
    thenable.then(
      function() {
        thenableWithOverride.status = "fulfilled";
        thenableWithOverride.value = result;
        for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result);
      },
      function(error2) {
        thenableWithOverride.status = "rejected";
        thenableWithOverride.reason = error2;
        for (error2 = 0; error2 < listeners.length; error2++)
          (0, listeners[error2])(void 0);
      }
    );
    return thenableWithOverride;
  }
  var prevOnStartTransitionFinish = ReactSharedInternals.S;
  ReactSharedInternals.S = function(transition, returnValue) {
    globalMostRecentTransitionTime = now2();
    "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && entangleAsyncAction(transition, returnValue);
    null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
  };
  var resumedCache = createCursor(null);
  function peekCacheFromPool() {
    var cacheResumedFromPreviousRender = resumedCache.current;
    return null !== cacheResumedFromPreviousRender ? cacheResumedFromPreviousRender : workInProgressRoot.pooledCache;
  }
  function pushTransition(offscreenWorkInProgress, prevCachePool) {
    null === prevCachePool ? push(resumedCache, resumedCache.current) : push(resumedCache, prevCachePool.pool);
  }
  function getSuspendedCache() {
    var cacheFromPool = peekCacheFromPool();
    return null === cacheFromPool ? null : { parent: CacheContext._currentValue, pool: cacheFromPool };
  }
  var SuspenseException = Error(formatProdErrorMessage(460)), SuspenseyCommitException = Error(formatProdErrorMessage(474)), SuspenseActionException = Error(formatProdErrorMessage(542)), noopSuspenseyCommitThenable = { then: function() {
  } };
  function isThenableResolved(thenable) {
    thenable = thenable.status;
    return "fulfilled" === thenable || "rejected" === thenable;
  }
  function trackUsedThenable(thenableState2, thenable, index2) {
    index2 = thenableState2[index2];
    void 0 === index2 ? thenableState2.push(thenable) : index2 !== thenable && (thenable.then(noop$1, noop$1), thenable = index2);
    switch (thenable.status) {
      case "fulfilled":
        return thenable.value;
      case "rejected":
        throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
      default:
        if ("string" === typeof thenable.status) thenable.then(noop$1, noop$1);
        else {
          thenableState2 = workInProgressRoot;
          if (null !== thenableState2 && 100 < thenableState2.shellSuspendCounter)
            throw Error(formatProdErrorMessage(482));
          thenableState2 = thenable;
          thenableState2.status = "pending";
          thenableState2.then(
            function(fulfilledValue) {
              if ("pending" === thenable.status) {
                var fulfilledThenable = thenable;
                fulfilledThenable.status = "fulfilled";
                fulfilledThenable.value = fulfilledValue;
              }
            },
            function(error2) {
              if ("pending" === thenable.status) {
                var rejectedThenable = thenable;
                rejectedThenable.status = "rejected";
                rejectedThenable.reason = error2;
              }
            }
          );
        }
        switch (thenable.status) {
          case "fulfilled":
            return thenable.value;
          case "rejected":
            throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
        }
        suspendedThenable = thenable;
        throw SuspenseException;
    }
  }
  function resolveLazy(lazyType) {
    try {
      var init = lazyType._init;
      return init(lazyType._payload);
    } catch (x) {
      if (null !== x && "object" === typeof x && "function" === typeof x.then)
        throw suspendedThenable = x, SuspenseException;
      throw x;
    }
  }
  var suspendedThenable = null;
  function getSuspendedThenable() {
    if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
    var thenable = suspendedThenable;
    suspendedThenable = null;
    return thenable;
  }
  function checkIfUseWrappedInAsyncCatch(rejectedReason) {
    if (rejectedReason === SuspenseException || rejectedReason === SuspenseActionException)
      throw Error(formatProdErrorMessage(483));
  }
  var thenableState$1 = null, thenableIndexCounter$1 = 0;
  function unwrapThenable(thenable) {
    var index2 = thenableIndexCounter$1;
    thenableIndexCounter$1 += 1;
    null === thenableState$1 && (thenableState$1 = []);
    return trackUsedThenable(thenableState$1, thenable, index2);
  }
  function coerceRef(workInProgress2, element) {
    element = element.props.ref;
    workInProgress2.ref = void 0 !== element ? element : null;
  }
  function throwOnInvalidObjectTypeImpl(returnFiber, newChild) {
    if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
      throw Error(formatProdErrorMessage(525));
    returnFiber = Object.prototype.toString.call(newChild);
    throw Error(
      formatProdErrorMessage(
        31,
        "[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber
      )
    );
  }
  function createChildReconciler(shouldTrackSideEffects) {
    function deleteChild(returnFiber, childToDelete) {
      if (shouldTrackSideEffects) {
        var deletions = returnFiber.deletions;
        null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete);
      }
    }
    function deleteRemainingChildren(returnFiber, currentFirstChild) {
      if (!shouldTrackSideEffects) return null;
      for (; null !== currentFirstChild; )
        deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
      return null;
    }
    function mapRemainingChildren(currentFirstChild) {
      for (var existingChildren = /* @__PURE__ */ new Map(); null !== currentFirstChild; )
        null !== currentFirstChild.key ? existingChildren.set(currentFirstChild.key, currentFirstChild) : existingChildren.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
      return existingChildren;
    }
    function useFiber(fiber, pendingProps) {
      fiber = createWorkInProgress(fiber, pendingProps);
      fiber.index = 0;
      fiber.sibling = null;
      return fiber;
    }
    function placeChild(newFiber, lastPlacedIndex, newIndex) {
      newFiber.index = newIndex;
      if (!shouldTrackSideEffects)
        return newFiber.flags |= 1048576, lastPlacedIndex;
      newIndex = newFiber.alternate;
      if (null !== newIndex)
        return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 67108866, lastPlacedIndex) : newIndex;
      newFiber.flags |= 67108866;
      return lastPlacedIndex;
    }
    function placeSingleChild(newFiber) {
      shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 67108866);
      return newFiber;
    }
    function updateTextNode(returnFiber, current, textContent, lanes) {
      if (null === current || 6 !== current.tag)
        return current = createFiberFromText(textContent, returnFiber.mode, lanes), current.return = returnFiber, current;
      current = useFiber(current, textContent);
      current.return = returnFiber;
      return current;
    }
    function updateElement(returnFiber, current, element, lanes) {
      var elementType = element.type;
      if (elementType === REACT_FRAGMENT_TYPE)
        return updateFragment(
          returnFiber,
          current,
          element.props.children,
          lanes,
          element.key
        );
      if (null !== current && (current.elementType === elementType || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type))
        return current = useFiber(current, element.props), coerceRef(current, element), current.return = returnFiber, current;
      current = createFiberFromTypeAndProps(
        element.type,
        element.key,
        element.props,
        null,
        returnFiber.mode,
        lanes
      );
      coerceRef(current, element);
      current.return = returnFiber;
      return current;
    }
    function updatePortal(returnFiber, current, portal, lanes) {
      if (null === current || 4 !== current.tag || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation)
        return current = createFiberFromPortal(portal, returnFiber.mode, lanes), current.return = returnFiber, current;
      current = useFiber(current, portal.children || []);
      current.return = returnFiber;
      return current;
    }
    function updateFragment(returnFiber, current, fragment, lanes, key) {
      if (null === current || 7 !== current.tag)
        return current = createFiberFromFragment(
          fragment,
          returnFiber.mode,
          lanes,
          key
        ), current.return = returnFiber, current;
      current = useFiber(current, fragment);
      current.return = returnFiber;
      return current;
    }
    function createChild(returnFiber, newChild, lanes) {
      if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
        return newChild = createFiberFromText(
          "" + newChild,
          returnFiber.mode,
          lanes
        ), newChild.return = returnFiber, newChild;
      if ("object" === typeof newChild && null !== newChild) {
        switch (newChild.$$typeof) {
          case REACT_ELEMENT_TYPE:
            return lanes = createFiberFromTypeAndProps(
              newChild.type,
              newChild.key,
              newChild.props,
              null,
              returnFiber.mode,
              lanes
            ), coerceRef(lanes, newChild), lanes.return = returnFiber, lanes;
          case REACT_PORTAL_TYPE:
            return newChild = createFiberFromPortal(
              newChild,
              returnFiber.mode,
              lanes
            ), newChild.return = returnFiber, newChild;
          case REACT_LAZY_TYPE:
            return newChild = resolveLazy(newChild), createChild(returnFiber, newChild, lanes);
        }
        if (isArrayImpl(newChild) || getIteratorFn(newChild))
          return newChild = createFiberFromFragment(
            newChild,
            returnFiber.mode,
            lanes,
            null
          ), newChild.return = returnFiber, newChild;
        if ("function" === typeof newChild.then)
          return createChild(returnFiber, unwrapThenable(newChild), lanes);
        if (newChild.$$typeof === REACT_CONTEXT_TYPE)
          return createChild(
            returnFiber,
            readContextDuringReconciliation(returnFiber, newChild),
            lanes
          );
        throwOnInvalidObjectTypeImpl(returnFiber, newChild);
      }
      return null;
    }
    function updateSlot(returnFiber, oldFiber, newChild, lanes) {
      var key = null !== oldFiber ? oldFiber.key : null;
      if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
        return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
      if ("object" === typeof newChild && null !== newChild) {
        switch (newChild.$$typeof) {
          case REACT_ELEMENT_TYPE:
            return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, lanes) : null;
          case REACT_PORTAL_TYPE:
            return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null;
          case REACT_LAZY_TYPE:
            return newChild = resolveLazy(newChild), updateSlot(returnFiber, oldFiber, newChild, lanes);
        }
        if (isArrayImpl(newChild) || getIteratorFn(newChild))
          return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
        if ("function" === typeof newChild.then)
          return updateSlot(
            returnFiber,
            oldFiber,
            unwrapThenable(newChild),
            lanes
          );
        if (newChild.$$typeof === REACT_CONTEXT_TYPE)
          return updateSlot(
            returnFiber,
            oldFiber,
            readContextDuringReconciliation(returnFiber, newChild),
            lanes
          );
        throwOnInvalidObjectTypeImpl(returnFiber, newChild);
      }
      return null;
    }
    function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
      if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
        return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes);
      if ("object" === typeof newChild && null !== newChild) {
        switch (newChild.$$typeof) {
          case REACT_ELEMENT_TYPE:
            return existingChildren = existingChildren.get(
              null === newChild.key ? newIdx : newChild.key
            ) || null, updateElement(returnFiber, existingChildren, newChild, lanes);
          case REACT_PORTAL_TYPE:
            return existingChildren = existingChildren.get(
              null === newChild.key ? newIdx : newChild.key
            ) || null, updatePortal(returnFiber, existingChildren, newChild, lanes);
          case REACT_LAZY_TYPE:
            return newChild = resolveLazy(newChild), updateFromMap(
              existingChildren,
              returnFiber,
              newIdx,
              newChild,
              lanes
            );
        }
        if (isArrayImpl(newChild) || getIteratorFn(newChild))
          return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null);
        if ("function" === typeof newChild.then)
          return updateFromMap(
            existingChildren,
            returnFiber,
            newIdx,
            unwrapThenable(newChild),
            lanes
          );
        if (newChild.$$typeof === REACT_CONTEXT_TYPE)
          return updateFromMap(
            existingChildren,
            returnFiber,
            newIdx,
            readContextDuringReconciliation(returnFiber, newChild),
            lanes
          );
        throwOnInvalidObjectTypeImpl(returnFiber, newChild);
      }
      return null;
    }
    function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
      for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {
        oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
        var newFiber = updateSlot(
          returnFiber,
          oldFiber,
          newChildren[newIdx],
          lanes
        );
        if (null === newFiber) {
          null === oldFiber && (oldFiber = nextOldFiber);
          break;
        }
        shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
        currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
        null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
        previousNewFiber = newFiber;
        oldFiber = nextOldFiber;
      }
      if (newIdx === newChildren.length)
        return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
      if (null === oldFiber) {
        for (; newIdx < newChildren.length; newIdx++)
          oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(
            oldFiber,
            currentFirstChild,
            newIdx
          ), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
        isHydrating && pushTreeFork(returnFiber, newIdx);
        return resultingFirstChild;
      }
      for (oldFiber = mapRemainingChildren(oldFiber); newIdx < newChildren.length; newIdx++)
        nextOldFiber = updateFromMap(
          oldFiber,
          returnFiber,
          newIdx,
          newChildren[newIdx],
          lanes
        ), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
          null === nextOldFiber.key ? newIdx : nextOldFiber.key
        ), currentFirstChild = placeChild(
          nextOldFiber,
          currentFirstChild,
          newIdx
        ), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
      shouldTrackSideEffects && oldFiber.forEach(function(child) {
        return deleteChild(returnFiber, child);
      });
      isHydrating && pushTreeFork(returnFiber, newIdx);
      return resultingFirstChild;
    }
    function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes) {
      if (null == newChildren) throw Error(formatProdErrorMessage(151));
      for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) {
        oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
        var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
        if (null === newFiber) {
          null === oldFiber && (oldFiber = nextOldFiber);
          break;
        }
        shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
        currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
        null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
        previousNewFiber = newFiber;
        oldFiber = nextOldFiber;
      }
      if (step.done)
        return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
      if (null === oldFiber) {
        for (; !step.done; newIdx++, step = newChildren.next())
          step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
        isHydrating && pushTreeFork(returnFiber, newIdx);
        return resultingFirstChild;
      }
      for (oldFiber = mapRemainingChildren(oldFiber); !step.done; newIdx++, step = newChildren.next())
        step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
      shouldTrackSideEffects && oldFiber.forEach(function(child) {
        return deleteChild(returnFiber, child);
      });
      isHydrating && pushTreeFork(returnFiber, newIdx);
      return resultingFirstChild;
    }
    function reconcileChildFibersImpl(returnFiber, currentFirstChild, newChild, lanes) {
      "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children);
      if ("object" === typeof newChild && null !== newChild) {
        switch (newChild.$$typeof) {
          case REACT_ELEMENT_TYPE:
            a: {
              for (var key = newChild.key; null !== currentFirstChild; ) {
                if (currentFirstChild.key === key) {
                  key = newChild.type;
                  if (key === REACT_FRAGMENT_TYPE) {
                    if (7 === currentFirstChild.tag) {
                      deleteRemainingChildren(
                        returnFiber,
                        currentFirstChild.sibling
                      );
                      lanes = useFiber(
                        currentFirstChild,
                        newChild.props.children
                      );
                      lanes.return = returnFiber;
                      returnFiber = lanes;
                      break a;
                    }
                  } else if (currentFirstChild.elementType === key || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE && resolveLazy(key) === currentFirstChild.type) {
                    deleteRemainingChildren(
                      returnFiber,
                      currentFirstChild.sibling
                    );
                    lanes = useFiber(currentFirstChild, newChild.props);
                    coerceRef(lanes, newChild);
                    lanes.return = returnFiber;
                    returnFiber = lanes;
                    break a;
                  }
                  deleteRemainingChildren(returnFiber, currentFirstChild);
                  break;
                } else deleteChild(returnFiber, currentFirstChild);
                currentFirstChild = currentFirstChild.sibling;
              }
              newChild.type === REACT_FRAGMENT_TYPE ? (lanes = createFiberFromFragment(
                newChild.props.children,
                returnFiber.mode,
                lanes,
                newChild.key
              ), lanes.return = returnFiber, returnFiber = lanes) : (lanes = createFiberFromTypeAndProps(
                newChild.type,
                newChild.key,
                newChild.props,
                null,
                returnFiber.mode,
                lanes
              ), coerceRef(lanes, newChild), lanes.return = returnFiber, returnFiber = lanes);
            }
            return placeSingleChild(returnFiber);
          case REACT_PORTAL_TYPE:
            a: {
              for (key = newChild.key; null !== currentFirstChild; ) {
                if (currentFirstChild.key === key)
                  if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) {
                    deleteRemainingChildren(
                      returnFiber,
                      currentFirstChild.sibling
                    );
                    lanes = useFiber(currentFirstChild, newChild.children || []);
                    lanes.return = returnFiber;
                    returnFiber = lanes;
                    break a;
                  } else {
                    deleteRemainingChildren(returnFiber, currentFirstChild);
                    break;
                  }
                else deleteChild(returnFiber, currentFirstChild);
                currentFirstChild = currentFirstChild.sibling;
              }
              lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
              lanes.return = returnFiber;
              returnFiber = lanes;
            }
            return placeSingleChild(returnFiber);
          case REACT_LAZY_TYPE:
            return newChild = resolveLazy(newChild), reconcileChildFibersImpl(
              returnFiber,
              currentFirstChild,
              newChild,
              lanes
            );
        }
        if (isArrayImpl(newChild))
          return reconcileChildrenArray(
            returnFiber,
            currentFirstChild,
            newChild,
            lanes
          );
        if (getIteratorFn(newChild)) {
          key = getIteratorFn(newChild);
          if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
          newChild = key.call(newChild);
          return reconcileChildrenIterator(
            returnFiber,
            currentFirstChild,
            newChild,
            lanes
          );
        }
        if ("function" === typeof newChild.then)
          return reconcileChildFibersImpl(
            returnFiber,
            currentFirstChild,
            unwrapThenable(newChild),
            lanes
          );
        if (newChild.$$typeof === REACT_CONTEXT_TYPE)
          return reconcileChildFibersImpl(
            returnFiber,
            currentFirstChild,
            readContextDuringReconciliation(returnFiber, newChild),
            lanes
          );
        throwOnInvalidObjectTypeImpl(returnFiber, newChild);
      }
      return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild ? (newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), lanes = useFiber(currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes) : (deleteRemainingChildren(returnFiber, currentFirstChild), lanes = createFiberFromText(newChild, returnFiber.mode, lanes), lanes.return = returnFiber, returnFiber = lanes), placeSingleChild(returnFiber)) : deleteRemainingChildren(returnFiber, currentFirstChild);
    }
    return function(returnFiber, currentFirstChild, newChild, lanes) {
      try {
        thenableIndexCounter$1 = 0;
        var firstChildFiber = reconcileChildFibersImpl(
          returnFiber,
          currentFirstChild,
          newChild,
          lanes
        );
        thenableState$1 = null;
        return firstChildFiber;
      } catch (x) {
        if (x === SuspenseException || x === SuspenseActionException) throw x;
        var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
        fiber.lanes = lanes;
        fiber.return = returnFiber;
        return fiber;
      } finally {
      }
    };
  }
  var reconcileChildFibers = createChildReconciler(true), mountChildFibers = createChildReconciler(false), hasForceUpdate = false;
  function initializeUpdateQueue(fiber) {
    fiber.updateQueue = {
      baseState: fiber.memoizedState,
      firstBaseUpdate: null,
      lastBaseUpdate: null,
      shared: { pending: null, lanes: 0, hiddenCallbacks: null },
      callbacks: null
    };
  }
  function cloneUpdateQueue(current, workInProgress2) {
    current = current.updateQueue;
    workInProgress2.updateQueue === current && (workInProgress2.updateQueue = {
      baseState: current.baseState,
      firstBaseUpdate: current.firstBaseUpdate,
      lastBaseUpdate: current.lastBaseUpdate,
      shared: current.shared,
      callbacks: null
    });
  }
  function createUpdate2(lane) {
    return { lane, tag: 0, payload: null, callback: null, next: null };
  }
  function enqueueUpdate(fiber, update2, lane) {
    var updateQueue2 = fiber.updateQueue;
    if (null === updateQueue2) return null;
    updateQueue2 = updateQueue2.shared;
    if (0 !== (executionContext & 2)) {
      var pending = updateQueue2.pending;
      null === pending ? update2.next = update2 : (update2.next = pending.next, pending.next = update2);
      updateQueue2.pending = update2;
      update2 = getRootForUpdatedFiber(fiber);
      markUpdateLaneFromFiberToRoot(fiber, null, lane);
      return update2;
    }
    enqueueUpdate$1(fiber, updateQueue2, update2, lane);
    return getRootForUpdatedFiber(fiber);
  }
  function entangleTransitions(root2, fiber, lane) {
    fiber = fiber.updateQueue;
    if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
      var queueLanes = fiber.lanes;
      queueLanes &= root2.pendingLanes;
      lane |= queueLanes;
      fiber.lanes = lane;
      markRootEntangled(root2, lane);
    }
  }
  function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
    var queue = workInProgress2.updateQueue, current = workInProgress2.alternate;
    if (null !== current && (current = current.updateQueue, queue === current)) {
      var newFirst = null, newLast = null;
      queue = queue.firstBaseUpdate;
      if (null !== queue) {
        do {
          var clone = {
            lane: queue.lane,
            tag: queue.tag,
            payload: queue.payload,
            callback: null,
            next: null
          };
          null === newLast ? newFirst = newLast = clone : newLast = newLast.next = clone;
          queue = queue.next;
        } while (null !== queue);
        null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate;
      } else newFirst = newLast = capturedUpdate;
      queue = {
        baseState: current.baseState,
        firstBaseUpdate: newFirst,
        lastBaseUpdate: newLast,
        shared: current.shared,
        callbacks: current.callbacks
      };
      workInProgress2.updateQueue = queue;
      return;
    }
    workInProgress2 = queue.lastBaseUpdate;
    null === workInProgress2 ? queue.firstBaseUpdate = capturedUpdate : workInProgress2.next = capturedUpdate;
    queue.lastBaseUpdate = capturedUpdate;
  }
  var didReadFromEntangledAsyncAction = false;
  function suspendIfUpdateReadFromEntangledAsyncAction() {
    if (didReadFromEntangledAsyncAction) {
      var entangledActionThenable = currentEntangledActionThenable;
      if (null !== entangledActionThenable) throw entangledActionThenable;
    }
  }
  function processUpdateQueue(workInProgress$jscomp$0, props, instance$jscomp$0, renderLanes2) {
    didReadFromEntangledAsyncAction = false;
    var queue = workInProgress$jscomp$0.updateQueue;
    hasForceUpdate = false;
    var firstBaseUpdate = queue.firstBaseUpdate, lastBaseUpdate = queue.lastBaseUpdate, pendingQueue = queue.shared.pending;
    if (null !== pendingQueue) {
      queue.shared.pending = null;
      var lastPendingUpdate = pendingQueue, firstPendingUpdate = lastPendingUpdate.next;
      lastPendingUpdate.next = null;
      null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate;
      lastBaseUpdate = lastPendingUpdate;
      var current = workInProgress$jscomp$0.alternate;
      null !== current && (current = current.updateQueue, pendingQueue = current.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current.lastBaseUpdate = lastPendingUpdate));
    }
    if (null !== firstBaseUpdate) {
      var newState = queue.baseState;
      lastBaseUpdate = 0;
      current = firstPendingUpdate = lastPendingUpdate = null;
      pendingQueue = firstBaseUpdate;
      do {
        var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane;
        if (isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes2 & updateLane) === updateLane) {
          0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = true);
          null !== current && (current = current.next = {
            lane: 0,
            tag: pendingQueue.tag,
            payload: pendingQueue.payload,
            callback: null,
            next: null
          });
          a: {
            var workInProgress2 = workInProgress$jscomp$0, update2 = pendingQueue;
            updateLane = props;
            var instance = instance$jscomp$0;
            switch (update2.tag) {
              case 1:
                workInProgress2 = update2.payload;
                if ("function" === typeof workInProgress2) {
                  newState = workInProgress2.call(instance, newState, updateLane);
                  break a;
                }
                newState = workInProgress2;
                break a;
              case 3:
                workInProgress2.flags = workInProgress2.flags & -65537 | 128;
              case 0:
                workInProgress2 = update2.payload;
                updateLane = "function" === typeof workInProgress2 ? workInProgress2.call(instance, newState, updateLane) : workInProgress2;
                if (null === updateLane || void 0 === updateLane) break a;
                newState = assign2({}, newState, updateLane);
                break a;
              case 2:
                hasForceUpdate = true;
            }
          }
          updateLane = pendingQueue.callback;
          null !== updateLane && (workInProgress$jscomp$0.flags |= 64, isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), isHiddenUpdate = queue.callbacks, null === isHiddenUpdate ? queue.callbacks = [updateLane] : isHiddenUpdate.push(updateLane));
        } else
          isHiddenUpdate = {
            lane: updateLane,
            tag: pendingQueue.tag,
            payload: pendingQueue.payload,
            callback: pendingQueue.callback,
            next: null
          }, null === current ? (firstPendingUpdate = current = isHiddenUpdate, lastPendingUpdate = newState) : current = current.next = isHiddenUpdate, lastBaseUpdate |= updateLane;
        pendingQueue = pendingQueue.next;
        if (null === pendingQueue)
          if (pendingQueue = queue.shared.pending, null === pendingQueue)
            break;
          else
            isHiddenUpdate = pendingQueue, pendingQueue = isHiddenUpdate.next, isHiddenUpdate.next = null, queue.lastBaseUpdate = isHiddenUpdate, queue.shared.pending = null;
      } while (1);
      null === current && (lastPendingUpdate = newState);
      queue.baseState = lastPendingUpdate;
      queue.firstBaseUpdate = firstPendingUpdate;
      queue.lastBaseUpdate = current;
      null === firstBaseUpdate && (queue.shared.lanes = 0);
      workInProgressRootSkippedLanes |= lastBaseUpdate;
      workInProgress$jscomp$0.lanes = lastBaseUpdate;
      workInProgress$jscomp$0.memoizedState = newState;
    }
  }
  function callCallback(callback, context) {
    if ("function" !== typeof callback)
      throw Error(formatProdErrorMessage(191, callback));
    callback.call(context);
  }
  function commitCallbacks(updateQueue2, context) {
    var callbacks = updateQueue2.callbacks;
    if (null !== callbacks)
      for (updateQueue2.callbacks = null, updateQueue2 = 0; updateQueue2 < callbacks.length; updateQueue2++)
        callCallback(callbacks[updateQueue2], context);
  }
  var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0);
  function pushHiddenContext(fiber, context) {
    fiber = entangledRenderLanes;
    push(prevEntangledRenderLanesCursor, fiber);
    push(currentTreeHiddenStackCursor, context);
    entangledRenderLanes = fiber | context.baseLanes;
  }
  function reuseHiddenContextOnStack() {
    push(prevEntangledRenderLanesCursor, entangledRenderLanes);
    push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
  }
  function popHiddenContext() {
    entangledRenderLanes = prevEntangledRenderLanesCursor.current;
    pop(currentTreeHiddenStackCursor);
    pop(prevEntangledRenderLanesCursor);
  }
  var suspenseHandlerStackCursor = createCursor(null), shellBoundary = null;
  function pushPrimaryTreeSuspenseHandler(handler) {
    var current = handler.alternate;
    push(suspenseStackCursor, suspenseStackCursor.current & 1);
    push(suspenseHandlerStackCursor, handler);
    null === shellBoundary && (null === current || null !== currentTreeHiddenStackCursor.current ? shellBoundary = handler : null !== current.memoizedState && (shellBoundary = handler));
  }
  function pushDehydratedActivitySuspenseHandler(fiber) {
    push(suspenseStackCursor, suspenseStackCursor.current);
    push(suspenseHandlerStackCursor, fiber);
    null === shellBoundary && (shellBoundary = fiber);
  }
  function pushOffscreenSuspenseHandler(fiber) {
    22 === fiber.tag ? (push(suspenseStackCursor, suspenseStackCursor.current), push(suspenseHandlerStackCursor, fiber), null === shellBoundary && (shellBoundary = fiber)) : reuseSuspenseHandlerOnStack();
  }
  function reuseSuspenseHandlerOnStack() {
    push(suspenseStackCursor, suspenseStackCursor.current);
    push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
  }
  function popSuspenseHandler(fiber) {
    pop(suspenseHandlerStackCursor);
    shellBoundary === fiber && (shellBoundary = null);
    pop(suspenseStackCursor);
  }
  var suspenseStackCursor = createCursor(0);
  function findFirstSuspended(row2) {
    for (var node = row2; null !== node; ) {
      if (13 === node.tag) {
        var state = node.memoizedState;
        if (null !== state && (state = state.dehydrated, null === state || isSuspenseInstancePending(state) || isSuspenseInstanceFallback(state)))
          return node;
      } else if (19 === node.tag && ("forwards" === node.memoizedProps.revealOrder || "backwards" === node.memoizedProps.revealOrder || "unstable_legacy-backwards" === node.memoizedProps.revealOrder || "together" === node.memoizedProps.revealOrder)) {
        if (0 !== (node.flags & 128)) return node;
      } else if (null !== node.child) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === row2) break;
      for (; null === node.sibling; ) {
        if (null === node.return || node.return === row2) return null;
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
    return null;
  }
  var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = false, didScheduleRenderPhaseUpdateDuringThisPass = false, shouldDoubleInvokeUserFnsInHooksDEV = false, localIdCounter = 0, thenableIndexCounter = 0, thenableState = null, globalClientIdCounter = 0;
  function throwInvalidHookError() {
    throw Error(formatProdErrorMessage(321));
  }
  function areHookInputsEqual(nextDeps, prevDeps) {
    if (null === prevDeps) return false;
    for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
      if (!objectIs(nextDeps[i], prevDeps[i])) return false;
    return true;
  }
  function renderWithHooks(current, workInProgress2, Component, props, secondArg, nextRenderLanes) {
    renderLanes = nextRenderLanes;
    currentlyRenderingFiber = workInProgress2;
    workInProgress2.memoizedState = null;
    workInProgress2.updateQueue = null;
    workInProgress2.lanes = 0;
    ReactSharedInternals.H = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
    shouldDoubleInvokeUserFnsInHooksDEV = false;
    nextRenderLanes = Component(props, secondArg);
    shouldDoubleInvokeUserFnsInHooksDEV = false;
    didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
      workInProgress2,
      Component,
      props,
      secondArg
    ));
    finishRenderingHooks(current);
    return nextRenderLanes;
  }
  function finishRenderingHooks(current) {
    ReactSharedInternals.H = ContextOnlyDispatcher;
    var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
    renderLanes = 0;
    workInProgressHook = currentHook = currentlyRenderingFiber = null;
    didScheduleRenderPhaseUpdate = false;
    thenableIndexCounter = 0;
    thenableState = null;
    if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
    null === current || didReceiveUpdate || (current = current.dependencies, null !== current && checkIfContextChanged(current) && (didReceiveUpdate = true));
  }
  function renderWithHooksAgain(workInProgress2, Component, props, secondArg) {
    currentlyRenderingFiber = workInProgress2;
    var numberOfReRenders = 0;
    do {
      didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
      thenableIndexCounter = 0;
      didScheduleRenderPhaseUpdateDuringThisPass = false;
      if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
      numberOfReRenders += 1;
      workInProgressHook = currentHook = null;
      if (null != workInProgress2.updateQueue) {
        var children = workInProgress2.updateQueue;
        children.lastEffect = null;
        children.events = null;
        children.stores = null;
        null != children.memoCache && (children.memoCache.index = 0);
      }
      ReactSharedInternals.H = HooksDispatcherOnRerender;
      children = Component(props, secondArg);
    } while (didScheduleRenderPhaseUpdateDuringThisPass);
    return children;
  }
  function TransitionAwareHostComponent() {
    var dispatcher = ReactSharedInternals.H, maybeThenable = dispatcher.useState()[0];
    maybeThenable = "function" === typeof maybeThenable.then ? useThenable(maybeThenable) : maybeThenable;
    dispatcher = dispatcher.useState()[0];
    (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && (currentlyRenderingFiber.flags |= 1024);
    return maybeThenable;
  }
  function checkDidRenderIdHook() {
    var didRenderIdHook = 0 !== localIdCounter;
    localIdCounter = 0;
    return didRenderIdHook;
  }
  function bailoutHooks(current, workInProgress2, lanes) {
    workInProgress2.updateQueue = current.updateQueue;
    workInProgress2.flags &= -2053;
    current.lanes &= ~lanes;
  }
  function resetHooksOnUnwind(workInProgress2) {
    if (didScheduleRenderPhaseUpdate) {
      for (workInProgress2 = workInProgress2.memoizedState; null !== workInProgress2; ) {
        var queue = workInProgress2.queue;
        null !== queue && (queue.pending = null);
        workInProgress2 = workInProgress2.next;
      }
      didScheduleRenderPhaseUpdate = false;
    }
    renderLanes = 0;
    workInProgressHook = currentHook = currentlyRenderingFiber = null;
    didScheduleRenderPhaseUpdateDuringThisPass = false;
    thenableIndexCounter = localIdCounter = 0;
    thenableState = null;
  }
  function mountWorkInProgressHook() {
    var hook = {
      memoizedState: null,
      baseState: null,
      baseQueue: null,
      queue: null,
      next: null
    };
    null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook;
    return workInProgressHook;
  }
  function updateWorkInProgressHook() {
    if (null === currentHook) {
      var nextCurrentHook = currentlyRenderingFiber.alternate;
      nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
    } else nextCurrentHook = currentHook.next;
    var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber.memoizedState : workInProgressHook.next;
    if (null !== nextWorkInProgressHook)
      workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;
    else {
      if (null === nextCurrentHook) {
        if (null === currentlyRenderingFiber.alternate)
          throw Error(formatProdErrorMessage(467));
        throw Error(formatProdErrorMessage(310));
      }
      currentHook = nextCurrentHook;
      nextCurrentHook = {
        memoizedState: currentHook.memoizedState,
        baseState: currentHook.baseState,
        baseQueue: currentHook.baseQueue,
        queue: currentHook.queue,
        next: null
      };
      null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook;
    }
    return workInProgressHook;
  }
  function createFunctionComponentUpdateQueue() {
    return { lastEffect: null, events: null, stores: null, memoCache: null };
  }
  function useThenable(thenable) {
    var index2 = thenableIndexCounter;
    thenableIndexCounter += 1;
    null === thenableState && (thenableState = []);
    thenable = trackUsedThenable(thenableState, thenable, index2);
    index2 = currentlyRenderingFiber;
    null === (null === workInProgressHook ? index2.memoizedState : workInProgressHook.next) && (index2 = index2.alternate, ReactSharedInternals.H = null === index2 || null === index2.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate);
    return thenable;
  }
  function use(usable) {
    if (null !== usable && "object" === typeof usable) {
      if ("function" === typeof usable.then) return useThenable(usable);
      if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
    }
    throw Error(formatProdErrorMessage(438, String(usable)));
  }
  function useMemoCache(size2) {
    var memoCache = null, updateQueue2 = currentlyRenderingFiber.updateQueue;
    null !== updateQueue2 && (memoCache = updateQueue2.memoCache);
    if (null == memoCache) {
      var current = currentlyRenderingFiber.alternate;
      null !== current && (current = current.updateQueue, null !== current && (current = current.memoCache, null != current && (memoCache = {
        data: current.data.map(function(array) {
          return array.slice();
        }),
        index: 0
      })));
    }
    null == memoCache && (memoCache = { data: [], index: 0 });
    null === updateQueue2 && (updateQueue2 = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = updateQueue2);
    updateQueue2.memoCache = memoCache;
    updateQueue2 = memoCache.data[memoCache.index];
    if (void 0 === updateQueue2)
      for (updateQueue2 = memoCache.data[memoCache.index] = Array(size2), current = 0; current < size2; current++)
        updateQueue2[current] = REACT_MEMO_CACHE_SENTINEL;
    memoCache.index++;
    return updateQueue2;
  }
  function basicStateReducer(state, action) {
    return "function" === typeof action ? action(state) : action;
  }
  function updateReducer(reducer) {
    var hook = updateWorkInProgressHook();
    return updateReducerImpl(hook, currentHook, reducer);
  }
  function updateReducerImpl(hook, current, reducer) {
    var queue = hook.queue;
    if (null === queue) throw Error(formatProdErrorMessage(311));
    queue.lastRenderedReducer = reducer;
    var baseQueue = hook.baseQueue, pendingQueue = queue.pending;
    if (null !== pendingQueue) {
      if (null !== baseQueue) {
        var baseFirst = baseQueue.next;
        baseQueue.next = pendingQueue.next;
        pendingQueue.next = baseFirst;
      }
      current.baseQueue = baseQueue = pendingQueue;
      queue.pending = null;
    }
    pendingQueue = hook.baseState;
    if (null === baseQueue) hook.memoizedState = pendingQueue;
    else {
      current = baseQueue.next;
      var newBaseQueueFirst = baseFirst = null, newBaseQueueLast = null, update2 = current, didReadFromEntangledAsyncAction$60 = false;
      do {
        var updateLane = update2.lane & -536870913;
        if (updateLane !== update2.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane) {
          var revertLane = update2.revertLane;
          if (0 === revertLane)
            null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = {
              lane: 0,
              revertLane: 0,
              gesture: null,
              action: update2.action,
              hasEagerState: update2.hasEagerState,
              eagerState: update2.eagerState,
              next: null
            }), updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction$60 = true);
          else if ((renderLanes & revertLane) === revertLane) {
            update2 = update2.next;
            revertLane === currentEntangledLane && (didReadFromEntangledAsyncAction$60 = true);
            continue;
          } else
            updateLane = {
              lane: 0,
              revertLane: update2.revertLane,
              gesture: null,
              action: update2.action,
              hasEagerState: update2.hasEagerState,
              eagerState: update2.eagerState,
              next: null
            }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = updateLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = updateLane, currentlyRenderingFiber.lanes |= revertLane, workInProgressRootSkippedLanes |= revertLane;
          updateLane = update2.action;
          shouldDoubleInvokeUserFnsInHooksDEV && reducer(pendingQueue, updateLane);
          pendingQueue = update2.hasEagerState ? update2.eagerState : reducer(pendingQueue, updateLane);
        } else
          revertLane = {
            lane: updateLane,
            revertLane: update2.revertLane,
            gesture: update2.gesture,
            action: update2.action,
            hasEagerState: update2.hasEagerState,
            eagerState: update2.eagerState,
            next: null
          }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = revertLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = revertLane, currentlyRenderingFiber.lanes |= updateLane, workInProgressRootSkippedLanes |= updateLane;
        update2 = update2.next;
      } while (null !== update2 && update2 !== current);
      null === newBaseQueueLast ? baseFirst = pendingQueue : newBaseQueueLast.next = newBaseQueueFirst;
      if (!objectIs(pendingQueue, hook.memoizedState) && (didReceiveUpdate = true, didReadFromEntangledAsyncAction$60 && (reducer = currentEntangledActionThenable, null !== reducer)))
        throw reducer;
      hook.memoizedState = pendingQueue;
      hook.baseState = baseFirst;
      hook.baseQueue = newBaseQueueLast;
      queue.lastRenderedState = pendingQueue;
    }
    null === baseQueue && (queue.lanes = 0);
    return [hook.memoizedState, queue.dispatch];
  }
  function rerenderReducer(reducer) {
    var hook = updateWorkInProgressHook(), queue = hook.queue;
    if (null === queue) throw Error(formatProdErrorMessage(311));
    queue.lastRenderedReducer = reducer;
    var dispatch = queue.dispatch, lastRenderPhaseUpdate = queue.pending, newState = hook.memoizedState;
    if (null !== lastRenderPhaseUpdate) {
      queue.pending = null;
      var update2 = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
      do
        newState = reducer(newState, update2.action), update2 = update2.next;
      while (update2 !== lastRenderPhaseUpdate);
      objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true);
      hook.memoizedState = newState;
      null === hook.baseQueue && (hook.baseState = newState);
      queue.lastRenderedState = newState;
    }
    return [newState, dispatch];
  }
  function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
    var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
    if (isHydrating$jscomp$0) {
      if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
      getServerSnapshot = getServerSnapshot();
    } else getServerSnapshot = getSnapshot();
    var snapshotChanged = !objectIs(
      (currentHook || hook).memoizedState,
      getServerSnapshot
    );
    snapshotChanged && (hook.memoizedState = getServerSnapshot, didReceiveUpdate = true);
    hook = hook.queue;
    updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
      subscribe
    ]);
    if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) {
      fiber.flags |= 2048;
      pushSimpleEffect(
        9,
        { destroy: void 0 },
        updateStoreInstance.bind(
          null,
          fiber,
          hook,
          getServerSnapshot,
          getSnapshot
        ),
        null
      );
      if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
      isHydrating$jscomp$0 || 0 !== (renderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
    }
    return getServerSnapshot;
  }
  function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
    fiber.flags |= 16384;
    fiber = { getSnapshot, value: renderedSnapshot };
    getSnapshot = currentlyRenderingFiber.updateQueue;
    null === getSnapshot ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
  }
  function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
    inst.value = nextSnapshot;
    inst.getSnapshot = getSnapshot;
    checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
  }
  function subscribeToStore(fiber, inst, subscribe) {
    return subscribe(function() {
      checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
    });
  }
  function checkIfSnapshotChanged(inst) {
    var latestGetSnapshot = inst.getSnapshot;
    inst = inst.value;
    try {
      var nextValue = latestGetSnapshot();
      return !objectIs(inst, nextValue);
    } catch (error2) {
      return true;
    }
  }
  function forceStoreRerender(fiber) {
    var root2 = enqueueConcurrentRenderForLane(fiber, 2);
    null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2);
  }
  function mountStateImpl(initialState2) {
    var hook = mountWorkInProgressHook();
    if ("function" === typeof initialState2) {
      var initialStateInitializer = initialState2;
      initialState2 = initialStateInitializer();
      if (shouldDoubleInvokeUserFnsInHooksDEV) {
        setIsStrictModeForDevtools(true);
        try {
          initialStateInitializer();
        } finally {
          setIsStrictModeForDevtools(false);
        }
      }
    }
    hook.memoizedState = hook.baseState = initialState2;
    hook.queue = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: basicStateReducer,
      lastRenderedState: initialState2
    };
    return hook;
  }
  function updateOptimisticImpl(hook, current, passthrough, reducer) {
    hook.baseState = passthrough;
    return updateReducerImpl(
      hook,
      currentHook,
      "function" === typeof reducer ? reducer : basicStateReducer
    );
  }
  function dispatchActionState(fiber, actionQueue, setPendingState, setState, payload) {
    if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
    fiber = actionQueue.action;
    if (null !== fiber) {
      var actionNode = {
        payload,
        action: fiber,
        next: null,
        isTransition: true,
        status: "pending",
        value: null,
        reason: null,
        listeners: [],
        then: function(listener) {
          actionNode.listeners.push(listener);
        }
      };
      null !== ReactSharedInternals.T ? setPendingState(true) : actionNode.isTransition = false;
      setState(actionNode);
      setPendingState = actionQueue.pending;
      null === setPendingState ? (actionNode.next = actionQueue.pending = actionNode, runActionStateAction(actionQueue, actionNode)) : (actionNode.next = setPendingState.next, actionQueue.pending = setPendingState.next = actionNode);
    }
  }
  function runActionStateAction(actionQueue, node) {
    var action = node.action, payload = node.payload, prevState = actionQueue.state;
    if (node.isTransition) {
      var prevTransition = ReactSharedInternals.T, currentTransition = {};
      ReactSharedInternals.T = currentTransition;
      try {
        var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S;
        null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
        handleActionReturnValue(actionQueue, node, returnValue);
      } catch (error2) {
        onActionError(actionQueue, node, error2);
      } finally {
        null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
      }
    } else
      try {
        prevTransition = action(prevState, payload), handleActionReturnValue(actionQueue, node, prevTransition);
      } catch (error$66) {
        onActionError(actionQueue, node, error$66);
      }
  }
  function handleActionReturnValue(actionQueue, node, returnValue) {
    null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then ? returnValue.then(
      function(nextState) {
        onActionSuccess(actionQueue, node, nextState);
      },
      function(error2) {
        return onActionError(actionQueue, node, error2);
      }
    ) : onActionSuccess(actionQueue, node, returnValue);
  }
  function onActionSuccess(actionQueue, actionNode, nextState) {
    actionNode.status = "fulfilled";
    actionNode.value = nextState;
    notifyActionListeners(actionNode);
    actionQueue.state = nextState;
    actionNode = actionQueue.pending;
    null !== actionNode && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState)));
  }
  function onActionError(actionQueue, actionNode, error2) {
    var last = actionQueue.pending;
    actionQueue.pending = null;
    if (null !== last) {
      last = last.next;
      do
        actionNode.status = "rejected", actionNode.reason = error2, notifyActionListeners(actionNode), actionNode = actionNode.next;
      while (actionNode !== last);
    }
    actionQueue.action = null;
  }
  function notifyActionListeners(actionNode) {
    actionNode = actionNode.listeners;
    for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
  }
  function actionStateReducer(oldState, newState) {
    return newState;
  }
  function mountActionState(action, initialStateProp) {
    if (isHydrating) {
      var ssrFormState = workInProgressRoot.formState;
      if (null !== ssrFormState) {
        a: {
          var JSCompiler_inline_result = currentlyRenderingFiber;
          if (isHydrating) {
            if (nextHydratableInstance) {
              b: {
                var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
                for (var inRootOrSingleton = rootOrSingletonContext; 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) {
                  if (!inRootOrSingleton) {
                    JSCompiler_inline_result$jscomp$0 = null;
                    break b;
                  }
                  JSCompiler_inline_result$jscomp$0 = getNextHydratable(
                    JSCompiler_inline_result$jscomp$0.nextSibling
                  );
                  if (null === JSCompiler_inline_result$jscomp$0) {
                    JSCompiler_inline_result$jscomp$0 = null;
                    break b;
                  }
                }
                inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
                JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton ? JSCompiler_inline_result$jscomp$0 : null;
              }
              if (JSCompiler_inline_result$jscomp$0) {
                nextHydratableInstance = getNextHydratable(
                  JSCompiler_inline_result$jscomp$0.nextSibling
                );
                JSCompiler_inline_result = "F!" === JSCompiler_inline_result$jscomp$0.data;
                break a;
              }
            }
            throwOnHydrationMismatch(JSCompiler_inline_result);
          }
          JSCompiler_inline_result = false;
        }
        JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
      }
    }
    ssrFormState = mountWorkInProgressHook();
    ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
    JSCompiler_inline_result = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: actionStateReducer,
      lastRenderedState: initialStateProp
    };
    ssrFormState.queue = JSCompiler_inline_result;
    ssrFormState = dispatchSetState.bind(
      null,
      currentlyRenderingFiber,
      JSCompiler_inline_result
    );
    JSCompiler_inline_result.dispatch = ssrFormState;
    JSCompiler_inline_result = mountStateImpl(false);
    inRootOrSingleton = dispatchOptimisticSetState.bind(
      null,
      currentlyRenderingFiber,
      false,
      JSCompiler_inline_result.queue
    );
    JSCompiler_inline_result = mountWorkInProgressHook();
    JSCompiler_inline_result$jscomp$0 = {
      state: initialStateProp,
      dispatch: null,
      action,
      pending: null
    };
    JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
    ssrFormState = dispatchActionState.bind(
      null,
      currentlyRenderingFiber,
      JSCompiler_inline_result$jscomp$0,
      inRootOrSingleton,
      ssrFormState
    );
    JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
    JSCompiler_inline_result.memoizedState = action;
    return [initialStateProp, ssrFormState, false];
  }
  function updateActionState(action) {
    var stateHook = updateWorkInProgressHook();
    return updateActionStateImpl(stateHook, currentHook, action);
  }
  function updateActionStateImpl(stateHook, currentStateHook, action) {
    currentStateHook = updateReducerImpl(
      stateHook,
      currentStateHook,
      actionStateReducer
    )[0];
    stateHook = updateReducer(basicStateReducer)[0];
    if ("object" === typeof currentStateHook && null !== currentStateHook && "function" === typeof currentStateHook.then)
      try {
        var state = useThenable(currentStateHook);
      } catch (x) {
        if (x === SuspenseException) throw SuspenseActionException;
        throw x;
      }
    else state = currentStateHook;
    currentStateHook = updateWorkInProgressHook();
    var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch;
    action !== currentStateHook.memoizedState && (currentlyRenderingFiber.flags |= 2048, pushSimpleEffect(
      9,
      { destroy: void 0 },
      actionStateActionEffect.bind(null, actionQueue, action),
      null
    ));
    return [state, dispatch, stateHook];
  }
  function actionStateActionEffect(actionQueue, action) {
    actionQueue.action = action;
  }
  function rerenderActionState(action) {
    var stateHook = updateWorkInProgressHook(), currentStateHook = currentHook;
    if (null !== currentStateHook)
      return updateActionStateImpl(stateHook, currentStateHook, action);
    updateWorkInProgressHook();
    stateHook = stateHook.memoizedState;
    currentStateHook = updateWorkInProgressHook();
    var dispatch = currentStateHook.queue.dispatch;
    currentStateHook.memoizedState = action;
    return [stateHook, dispatch, false];
  }
  function pushSimpleEffect(tag, inst, create, deps) {
    tag = { tag, create, deps, inst, next: null };
    inst = currentlyRenderingFiber.updateQueue;
    null === inst && (inst = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = inst);
    create = inst.lastEffect;
    null === create ? inst.lastEffect = tag.next = tag : (deps = create.next, create.next = tag, tag.next = deps, inst.lastEffect = tag);
    return tag;
  }
  function updateRef2() {
    return updateWorkInProgressHook().memoizedState;
  }
  function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
    var hook = mountWorkInProgressHook();
    currentlyRenderingFiber.flags |= fiberFlags;
    hook.memoizedState = pushSimpleEffect(
      1 | hookFlags,
      { destroy: void 0 },
      create,
      void 0 === deps ? null : deps
    );
  }
  function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
    var hook = updateWorkInProgressHook();
    deps = void 0 === deps ? null : deps;
    var inst = hook.memoizedState.inst;
    null !== currentHook && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps) : (currentlyRenderingFiber.flags |= fiberFlags, hook.memoizedState = pushSimpleEffect(
      1 | hookFlags,
      inst,
      create,
      deps
    ));
  }
  function mountEffect(create, deps) {
    mountEffectImpl(8390656, 8, create, deps);
  }
  function updateEffect(create, deps) {
    updateEffectImpl(2048, 8, create, deps);
  }
  function useEffectEventImpl(payload) {
    currentlyRenderingFiber.flags |= 4;
    var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
    if (null === componentUpdateQueue)
      componentUpdateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = componentUpdateQueue, componentUpdateQueue.events = [payload];
    else {
      var events = componentUpdateQueue.events;
      null === events ? componentUpdateQueue.events = [payload] : events.push(payload);
    }
  }
  function updateEvent(callback) {
    var ref = updateWorkInProgressHook().memoizedState;
    useEffectEventImpl({ ref, nextImpl: callback });
    return function() {
      if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
      return ref.impl.apply(void 0, arguments);
    };
  }
  function updateInsertionEffect(create, deps) {
    return updateEffectImpl(4, 2, create, deps);
  }
  function updateLayoutEffect(create, deps) {
    return updateEffectImpl(4, 4, create, deps);
  }
  function imperativeHandleEffect(create, ref) {
    if ("function" === typeof ref) {
      create = create();
      var refCleanup = ref(create);
      return function() {
        "function" === typeof refCleanup ? refCleanup() : ref(null);
      };
    }
    if (null !== ref && void 0 !== ref)
      return create = create(), ref.current = create, function() {
        ref.current = null;
      };
  }
  function updateImperativeHandle(ref, create, deps) {
    deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
    updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
  }
  function mountDebugValue() {
  }
  function updateCallback(callback, deps) {
    var hook = updateWorkInProgressHook();
    deps = void 0 === deps ? null : deps;
    var prevState = hook.memoizedState;
    if (null !== deps && areHookInputsEqual(deps, prevState[1]))
      return prevState[0];
    hook.memoizedState = [callback, deps];
    return callback;
  }
  function updateMemo(nextCreate, deps) {
    var hook = updateWorkInProgressHook();
    deps = void 0 === deps ? null : deps;
    var prevState = hook.memoizedState;
    if (null !== deps && areHookInputsEqual(deps, prevState[1]))
      return prevState[0];
    prevState = nextCreate();
    if (shouldDoubleInvokeUserFnsInHooksDEV) {
      setIsStrictModeForDevtools(true);
      try {
        nextCreate();
      } finally {
        setIsStrictModeForDevtools(false);
      }
    }
    hook.memoizedState = [prevState, deps];
    return prevState;
  }
  function mountDeferredValueImpl(hook, value, initialValue) {
    if (void 0 === initialValue || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
      return hook.memoizedState = value;
    hook.memoizedState = initialValue;
    hook = requestDeferredLane();
    currentlyRenderingFiber.lanes |= hook;
    workInProgressRootSkippedLanes |= hook;
    return initialValue;
  }
  function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
    if (objectIs(value, prevValue)) return value;
    if (null !== currentTreeHiddenStackCursor.current)
      return hook = mountDeferredValueImpl(hook, value, initialValue), objectIs(hook, prevValue) || (didReceiveUpdate = true), hook;
    if (0 === (renderLanes & 42) || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
      return didReceiveUpdate = true, hook.memoizedState = value;
    hook = requestDeferredLane();
    currentlyRenderingFiber.lanes |= hook;
    workInProgressRootSkippedLanes |= hook;
    return prevValue;
  }
  function startTransition(fiber, queue, pendingState, finishedState, callback) {
    var previousPriority = ReactDOMSharedInternals.p;
    ReactDOMSharedInternals.p = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
    var prevTransition = ReactSharedInternals.T, currentTransition = {};
    ReactSharedInternals.T = currentTransition;
    dispatchOptimisticSetState(fiber, false, queue, pendingState);
    try {
      var returnValue = callback(), onStartTransitionFinish = ReactSharedInternals.S;
      null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
      if (null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then) {
        var thenableForFinishedState = chainThenableValue(
          returnValue,
          finishedState
        );
        dispatchSetStateInternal(
          fiber,
          queue,
          thenableForFinishedState,
          requestUpdateLane(fiber)
        );
      } else
        dispatchSetStateInternal(
          fiber,
          queue,
          finishedState,
          requestUpdateLane(fiber)
        );
    } catch (error2) {
      dispatchSetStateInternal(
        fiber,
        queue,
        { then: function() {
        }, status: "rejected", reason: error2 },
        requestUpdateLane()
      );
    } finally {
      ReactDOMSharedInternals.p = previousPriority, null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
    }
  }
  function noop2() {
  }
  function startHostTransition(formFiber, pendingState, action, formData) {
    if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
    var queue = ensureFormComponentIsStateful(formFiber).queue;
    startTransition(
      formFiber,
      queue,
      pendingState,
      sharedNotPendingObject,
      null === action ? noop2 : function() {
        requestFormReset$1(formFiber);
        return action(formData);
      }
    );
  }
  function ensureFormComponentIsStateful(formFiber) {
    var existingStateHook = formFiber.memoizedState;
    if (null !== existingStateHook) return existingStateHook;
    existingStateHook = {
      memoizedState: sharedNotPendingObject,
      baseState: sharedNotPendingObject,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: basicStateReducer,
        lastRenderedState: sharedNotPendingObject
      },
      next: null
    };
    var initialResetState = {};
    existingStateHook.next = {
      memoizedState: initialResetState,
      baseState: initialResetState,
      baseQueue: null,
      queue: {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: basicStateReducer,
        lastRenderedState: initialResetState
      },
      next: null
    };
    formFiber.memoizedState = existingStateHook;
    formFiber = formFiber.alternate;
    null !== formFiber && (formFiber.memoizedState = existingStateHook);
    return existingStateHook;
  }
  function requestFormReset$1(formFiber) {
    var stateHook = ensureFormComponentIsStateful(formFiber);
    null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);
    dispatchSetStateInternal(
      formFiber,
      stateHook.next.queue,
      {},
      requestUpdateLane()
    );
  }
  function useHostTransitionStatus() {
    return readContext(HostTransitionContext);
  }
  function updateId() {
    return updateWorkInProgressHook().memoizedState;
  }
  function updateRefresh() {
    return updateWorkInProgressHook().memoizedState;
  }
  function refreshCache(fiber) {
    for (var provider = fiber.return; null !== provider; ) {
      switch (provider.tag) {
        case 24:
        case 3:
          var lane = requestUpdateLane();
          fiber = createUpdate2(lane);
          var root$69 = enqueueUpdate(provider, fiber, lane);
          null !== root$69 && (scheduleUpdateOnFiber(root$69, provider, lane), entangleTransitions(root$69, provider, lane));
          provider = { cache: createCache() };
          fiber.payload = provider;
          return;
      }
      provider = provider.return;
    }
  }
  function dispatchReducerAction(fiber, queue, action) {
    var lane = requestUpdateLane();
    action = {
      lane,
      revertLane: 0,
      gesture: null,
      action,
      hasEagerState: false,
      eagerState: null,
      next: null
    };
    isRenderPhaseUpdate(fiber) ? enqueueRenderPhaseUpdate(queue, action) : (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action && (scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane)));
  }
  function dispatchSetState(fiber, queue, action) {
    var lane = requestUpdateLane();
    dispatchSetStateInternal(fiber, queue, action, lane);
  }
  function dispatchSetStateInternal(fiber, queue, action, lane) {
    var update2 = {
      lane,
      revertLane: 0,
      gesture: null,
      action,
      hasEagerState: false,
      eagerState: null,
      next: null
    };
    if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update2);
    else {
      var alternate = fiber.alternate;
      if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate))
        try {
          var currentState = queue.lastRenderedState, eagerState = alternate(currentState, action);
          update2.hasEagerState = true;
          update2.eagerState = eagerState;
          if (objectIs(eagerState, currentState))
            return enqueueUpdate$1(fiber, queue, update2, 0), null === workInProgressRoot && finishQueueingConcurrentUpdates(), false;
        } catch (error2) {
        } finally {
        }
      action = enqueueConcurrentHookUpdate(fiber, queue, update2, lane);
      if (null !== action)
        return scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane), true;
    }
    return false;
  }
  function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
    action = {
      lane: 2,
      revertLane: requestTransitionLane(),
      gesture: null,
      action,
      hasEagerState: false,
      eagerState: null,
      next: null
    };
    if (isRenderPhaseUpdate(fiber)) {
      if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
    } else
      throwIfDuringRender = enqueueConcurrentHookUpdate(
        fiber,
        queue,
        action,
        2
      ), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
  }
  function isRenderPhaseUpdate(fiber) {
    var alternate = fiber.alternate;
    return fiber === currentlyRenderingFiber || null !== alternate && alternate === currentlyRenderingFiber;
  }
  function enqueueRenderPhaseUpdate(queue, update2) {
    didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
    var pending = queue.pending;
    null === pending ? update2.next = update2 : (update2.next = pending.next, pending.next = update2);
    queue.pending = update2;
  }
  function entangleTransitionUpdate(root2, queue, lane) {
    if (0 !== (lane & 4194048)) {
      var queueLanes = queue.lanes;
      queueLanes &= root2.pendingLanes;
      lane |= queueLanes;
      queue.lanes = lane;
      markRootEntangled(root2, lane);
    }
  }
  var ContextOnlyDispatcher = {
    readContext,
    use,
    useCallback: throwInvalidHookError,
    useContext: throwInvalidHookError,
    useEffect: throwInvalidHookError,
    useImperativeHandle: throwInvalidHookError,
    useLayoutEffect: throwInvalidHookError,
    useInsertionEffect: throwInvalidHookError,
    useMemo: throwInvalidHookError,
    useReducer: throwInvalidHookError,
    useRef: throwInvalidHookError,
    useState: throwInvalidHookError,
    useDebugValue: throwInvalidHookError,
    useDeferredValue: throwInvalidHookError,
    useTransition: throwInvalidHookError,
    useSyncExternalStore: throwInvalidHookError,
    useId: throwInvalidHookError,
    useHostTransitionStatus: throwInvalidHookError,
    useFormState: throwInvalidHookError,
    useActionState: throwInvalidHookError,
    useOptimistic: throwInvalidHookError,
    useMemoCache: throwInvalidHookError,
    useCacheRefresh: throwInvalidHookError
  };
  ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
  var HooksDispatcherOnMount = {
    readContext,
    use,
    useCallback: function(callback, deps) {
      mountWorkInProgressHook().memoizedState = [
        callback,
        void 0 === deps ? null : deps
      ];
      return callback;
    },
    useContext: readContext,
    useEffect: mountEffect,
    useImperativeHandle: function(ref, create, deps) {
      deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
      mountEffectImpl(
        4194308,
        4,
        imperativeHandleEffect.bind(null, create, ref),
        deps
      );
    },
    useLayoutEffect: function(create, deps) {
      return mountEffectImpl(4194308, 4, create, deps);
    },
    useInsertionEffect: function(create, deps) {
      mountEffectImpl(4, 2, create, deps);
    },
    useMemo: function(nextCreate, deps) {
      var hook = mountWorkInProgressHook();
      deps = void 0 === deps ? null : deps;
      var nextValue = nextCreate();
      if (shouldDoubleInvokeUserFnsInHooksDEV) {
        setIsStrictModeForDevtools(true);
        try {
          nextCreate();
        } finally {
          setIsStrictModeForDevtools(false);
        }
      }
      hook.memoizedState = [nextValue, deps];
      return nextValue;
    },
    useReducer: function(reducer, initialArg, init) {
      var hook = mountWorkInProgressHook();
      if (void 0 !== init) {
        var initialState2 = init(initialArg);
        if (shouldDoubleInvokeUserFnsInHooksDEV) {
          setIsStrictModeForDevtools(true);
          try {
            init(initialArg);
          } finally {
            setIsStrictModeForDevtools(false);
          }
        }
      } else initialState2 = initialArg;
      hook.memoizedState = hook.baseState = initialState2;
      reducer = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: reducer,
        lastRenderedState: initialState2
      };
      hook.queue = reducer;
      reducer = reducer.dispatch = dispatchReducerAction.bind(
        null,
        currentlyRenderingFiber,
        reducer
      );
      return [hook.memoizedState, reducer];
    },
    useRef: function(initialValue) {
      var hook = mountWorkInProgressHook();
      initialValue = { current: initialValue };
      return hook.memoizedState = initialValue;
    },
    useState: function(initialState2) {
      initialState2 = mountStateImpl(initialState2);
      var queue = initialState2.queue, dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
      queue.dispatch = dispatch;
      return [initialState2.memoizedState, dispatch];
    },
    useDebugValue: mountDebugValue,
    useDeferredValue: function(value, initialValue) {
      var hook = mountWorkInProgressHook();
      return mountDeferredValueImpl(hook, value, initialValue);
    },
    useTransition: function() {
      var stateHook = mountStateImpl(false);
      stateHook = startTransition.bind(
        null,
        currentlyRenderingFiber,
        stateHook.queue,
        true,
        false
      );
      mountWorkInProgressHook().memoizedState = stateHook;
      return [false, stateHook];
    },
    useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
      var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
      if (isHydrating) {
        if (void 0 === getServerSnapshot)
          throw Error(formatProdErrorMessage(407));
        getServerSnapshot = getServerSnapshot();
      } else {
        getServerSnapshot = getSnapshot();
        if (null === workInProgressRoot)
          throw Error(formatProdErrorMessage(349));
        0 !== (workInProgressRootRenderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
      }
      hook.memoizedState = getServerSnapshot;
      var inst = { value: getServerSnapshot, getSnapshot };
      hook.queue = inst;
      mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
        subscribe
      ]);
      fiber.flags |= 2048;
      pushSimpleEffect(
        9,
        { destroy: void 0 },
        updateStoreInstance.bind(
          null,
          fiber,
          inst,
          getServerSnapshot,
          getSnapshot
        ),
        null
      );
      return getServerSnapshot;
    },
    useId: function() {
      var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix;
      if (isHydrating) {
        var JSCompiler_inline_result = treeContextOverflow;
        var idWithLeadingBit = treeContextId;
        JSCompiler_inline_result = (idWithLeadingBit & ~(1 << 32 - clz32(idWithLeadingBit) - 1)).toString(32) + JSCompiler_inline_result;
        identifierPrefix = "_" + identifierPrefix + "R_" + JSCompiler_inline_result;
        JSCompiler_inline_result = localIdCounter++;
        0 < JSCompiler_inline_result && (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
        identifierPrefix += "_";
      } else
        JSCompiler_inline_result = globalClientIdCounter++, identifierPrefix = "_" + identifierPrefix + "r_" + JSCompiler_inline_result.toString(32) + "_";
      return hook.memoizedState = identifierPrefix;
    },
    useHostTransitionStatus,
    useFormState: mountActionState,
    useActionState: mountActionState,
    useOptimistic: function(passthrough) {
      var hook = mountWorkInProgressHook();
      hook.memoizedState = hook.baseState = passthrough;
      var queue = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: null,
        lastRenderedState: null
      };
      hook.queue = queue;
      hook = dispatchOptimisticSetState.bind(
        null,
        currentlyRenderingFiber,
        true,
        queue
      );
      queue.dispatch = hook;
      return [passthrough, hook];
    },
    useMemoCache,
    useCacheRefresh: function() {
      return mountWorkInProgressHook().memoizedState = refreshCache.bind(
        null,
        currentlyRenderingFiber
      );
    },
    useEffectEvent: function(callback) {
      var hook = mountWorkInProgressHook(), ref = { impl: callback };
      hook.memoizedState = ref;
      return function() {
        if (0 !== (executionContext & 2))
          throw Error(formatProdErrorMessage(440));
        return ref.impl.apply(void 0, arguments);
      };
    }
  }, HooksDispatcherOnUpdate = {
    readContext,
    use,
    useCallback: updateCallback,
    useContext: readContext,
    useEffect: updateEffect,
    useImperativeHandle: updateImperativeHandle,
    useInsertionEffect: updateInsertionEffect,
    useLayoutEffect: updateLayoutEffect,
    useMemo: updateMemo,
    useReducer: updateReducer,
    useRef: updateRef2,
    useState: function() {
      return updateReducer(basicStateReducer);
    },
    useDebugValue: mountDebugValue,
    useDeferredValue: function(value, initialValue) {
      var hook = updateWorkInProgressHook();
      return updateDeferredValueImpl(
        hook,
        currentHook.memoizedState,
        value,
        initialValue
      );
    },
    useTransition: function() {
      var booleanOrThenable = updateReducer(basicStateReducer)[0], start2 = updateWorkInProgressHook().memoizedState;
      return [
        "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
        start2
      ];
    },
    useSyncExternalStore: updateSyncExternalStore,
    useId: updateId,
    useHostTransitionStatus,
    useFormState: updateActionState,
    useActionState: updateActionState,
    useOptimistic: function(passthrough, reducer) {
      var hook = updateWorkInProgressHook();
      return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
    },
    useMemoCache,
    useCacheRefresh: updateRefresh
  };
  HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
  var HooksDispatcherOnRerender = {
    readContext,
    use,
    useCallback: updateCallback,
    useContext: readContext,
    useEffect: updateEffect,
    useImperativeHandle: updateImperativeHandle,
    useInsertionEffect: updateInsertionEffect,
    useLayoutEffect: updateLayoutEffect,
    useMemo: updateMemo,
    useReducer: rerenderReducer,
    useRef: updateRef2,
    useState: function() {
      return rerenderReducer(basicStateReducer);
    },
    useDebugValue: mountDebugValue,
    useDeferredValue: function(value, initialValue) {
      var hook = updateWorkInProgressHook();
      return null === currentHook ? mountDeferredValueImpl(hook, value, initialValue) : updateDeferredValueImpl(
        hook,
        currentHook.memoizedState,
        value,
        initialValue
      );
    },
    useTransition: function() {
      var booleanOrThenable = rerenderReducer(basicStateReducer)[0], start2 = updateWorkInProgressHook().memoizedState;
      return [
        "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
        start2
      ];
    },
    useSyncExternalStore: updateSyncExternalStore,
    useId: updateId,
    useHostTransitionStatus,
    useFormState: rerenderActionState,
    useActionState: rerenderActionState,
    useOptimistic: function(passthrough, reducer) {
      var hook = updateWorkInProgressHook();
      if (null !== currentHook)
        return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
      hook.baseState = passthrough;
      return [passthrough, hook.queue.dispatch];
    },
    useMemoCache,
    useCacheRefresh: updateRefresh
  };
  HooksDispatcherOnRerender.useEffectEvent = updateEvent;
  function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
    ctor = workInProgress2.memoizedState;
    getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
    getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor : assign2({}, ctor, getDerivedStateFromProps);
    workInProgress2.memoizedState = getDerivedStateFromProps;
    0 === workInProgress2.lanes && (workInProgress2.updateQueue.baseState = getDerivedStateFromProps);
  }
  var classComponentUpdater = {
    enqueueSetState: function(inst, payload, callback) {
      inst = inst._reactInternals;
      var lane = requestUpdateLane(), update2 = createUpdate2(lane);
      update2.payload = payload;
      void 0 !== callback && null !== callback && (update2.callback = callback);
      payload = enqueueUpdate(inst, update2, lane);
      null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
    },
    enqueueReplaceState: function(inst, payload, callback) {
      inst = inst._reactInternals;
      var lane = requestUpdateLane(), update2 = createUpdate2(lane);
      update2.tag = 1;
      update2.payload = payload;
      void 0 !== callback && null !== callback && (update2.callback = callback);
      payload = enqueueUpdate(inst, update2, lane);
      null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
    },
    enqueueForceUpdate: function(inst, callback) {
      inst = inst._reactInternals;
      var lane = requestUpdateLane(), update2 = createUpdate2(lane);
      update2.tag = 2;
      void 0 !== callback && null !== callback && (update2.callback = callback);
      callback = enqueueUpdate(inst, update2, lane);
      null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane));
    }
  };
  function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
    workInProgress2 = workInProgress2.stateNode;
    return "function" === typeof workInProgress2.shouldComponentUpdate ? workInProgress2.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true;
  }
  function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
    workInProgress2 = instance.state;
    "function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext);
    "function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
    instance.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
  function resolveClassComponentProps(Component, baseProps) {
    var newProps = baseProps;
    if ("ref" in baseProps) {
      newProps = {};
      for (var propName in baseProps)
        "ref" !== propName && (newProps[propName] = baseProps[propName]);
    }
    if (Component = Component.defaultProps) {
      newProps === baseProps && (newProps = assign2({}, newProps));
      for (var propName$73 in Component)
        void 0 === newProps[propName$73] && (newProps[propName$73] = Component[propName$73]);
    }
    return newProps;
  }
  function defaultOnUncaughtError(error2) {
    reportGlobalError(error2);
  }
  function defaultOnCaughtError(error2) {
    console.error(error2);
  }
  function defaultOnRecoverableError(error2) {
    reportGlobalError(error2);
  }
  function logUncaughtError(root2, errorInfo) {
    try {
      var onUncaughtError = root2.onUncaughtError;
      onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
    } catch (e$74) {
      setTimeout(function() {
        throw e$74;
      });
    }
  }
  function logCaughtError(root2, boundary, errorInfo) {
    try {
      var onCaughtError = root2.onCaughtError;
      onCaughtError(errorInfo.value, {
        componentStack: errorInfo.stack,
        errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
      });
    } catch (e$75) {
      setTimeout(function() {
        throw e$75;
      });
    }
  }
  function createRootErrorUpdate(root2, errorInfo, lane) {
    lane = createUpdate2(lane);
    lane.tag = 3;
    lane.payload = { element: null };
    lane.callback = function() {
      logUncaughtError(root2, errorInfo);
    };
    return lane;
  }
  function createClassErrorUpdate(lane) {
    lane = createUpdate2(lane);
    lane.tag = 3;
    return lane;
  }
  function initializeClassErrorUpdate(update2, root2, fiber, errorInfo) {
    var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
    if ("function" === typeof getDerivedStateFromError) {
      var error2 = errorInfo.value;
      update2.payload = function() {
        return getDerivedStateFromError(error2);
      };
      update2.callback = function() {
        logCaughtError(root2, fiber, errorInfo);
      };
    }
    var inst = fiber.stateNode;
    null !== inst && "function" === typeof inst.componentDidCatch && (update2.callback = function() {
      logCaughtError(root2, fiber, errorInfo);
      "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
      var stack = errorInfo.stack;
      this.componentDidCatch(errorInfo.value, {
        componentStack: null !== stack ? stack : ""
      });
    });
  }
  function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
    sourceFiber.flags |= 32768;
    if (null !== value && "object" === typeof value && "function" === typeof value.then) {
      returnFiber = sourceFiber.alternate;
      null !== returnFiber && propagateParentContextChanges(
        returnFiber,
        sourceFiber,
        rootRenderLanes,
        true
      );
      sourceFiber = suspenseHandlerStackCursor.current;
      if (null !== sourceFiber) {
        switch (sourceFiber.tag) {
          case 31:
          case 13:
            return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root2, value, rootRenderLanes)), false;
          case 22:
            return sourceFiber.flags |= 65536, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
              transitions: null,
              markerInstances: null,
              retryQueue: /* @__PURE__ */ new Set([value])
            }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root2, value, rootRenderLanes)), false;
        }
        throw Error(formatProdErrorMessage(435, sourceFiber.tag));
      }
      attachPingListener(root2, value, rootRenderLanes);
      renderDidSuspendDelayIfPossible();
      return false;
    }
    if (isHydrating)
      return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && (root2 = Error(formatProdErrorMessage(422), { cause: value }), queueHydrationError(createCapturedValueAtFiber(root2, sourceFiber)))) : (value !== HydrationMismatchException && (returnFiber = Error(formatProdErrorMessage(423), {
        cause: value
      }), queueHydrationError(
        createCapturedValueAtFiber(returnFiber, sourceFiber)
      )), root2 = root2.current.alternate, root2.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root2.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
        root2.stateNode,
        value,
        rootRenderLanes
      ), enqueueCapturedUpdate(root2, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
    var wrapperError = Error(formatProdErrorMessage(520), { cause: value });
    wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
    null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [wrapperError] : workInProgressRootConcurrentErrors.push(wrapperError);
    4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
    if (null === returnFiber) return true;
    value = createCapturedValueAtFiber(value, sourceFiber);
    sourceFiber = returnFiber;
    do {
      switch (sourceFiber.tag) {
        case 3:
          return sourceFiber.flags |= 65536, root2 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root2, root2 = createRootErrorUpdate(sourceFiber.stateNode, value, root2), enqueueCapturedUpdate(sourceFiber, root2), false;
        case 1:
          if (returnFiber = sourceFiber.type, wrapperError = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== wrapperError && "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))
            return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
              rootRenderLanes,
              root2,
              sourceFiber,
              value
            ), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
      }
      sourceFiber = sourceFiber.return;
    } while (null !== sourceFiber);
    return false;
  }
  var SelectiveHydrationException = Error(formatProdErrorMessage(461)), didReceiveUpdate = false;
  function reconcileChildren(current, workInProgress2, nextChildren, renderLanes2) {
    workInProgress2.child = null === current ? mountChildFibers(workInProgress2, null, nextChildren, renderLanes2) : reconcileChildFibers(
      workInProgress2,
      current.child,
      nextChildren,
      renderLanes2
    );
  }
  function updateForwardRef(current, workInProgress2, Component, nextProps, renderLanes2) {
    Component = Component.render;
    var ref = workInProgress2.ref;
    if ("ref" in nextProps) {
      var propsWithoutRef = {};
      for (var key in nextProps)
        "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
    } else propsWithoutRef = nextProps;
    prepareToReadContext(workInProgress2);
    nextProps = renderWithHooks(
      current,
      workInProgress2,
      Component,
      propsWithoutRef,
      ref,
      renderLanes2
    );
    key = checkDidRenderIdHook();
    if (null !== current && !didReceiveUpdate)
      return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    isHydrating && key && pushMaterializedTreeId(workInProgress2);
    workInProgress2.flags |= 1;
    reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
    return workInProgress2.child;
  }
  function updateMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
    if (null === current) {
      var type = Component.type;
      if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare)
        return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
          current,
          workInProgress2,
          type,
          nextProps,
          renderLanes2
        );
      current = createFiberFromTypeAndProps(
        Component.type,
        null,
        nextProps,
        workInProgress2,
        workInProgress2.mode,
        renderLanes2
      );
      current.ref = workInProgress2.ref;
      current.return = workInProgress2;
      return workInProgress2.child = current;
    }
    type = current.child;
    if (!checkScheduledUpdateOrContext(current, renderLanes2)) {
      var prevProps = type.memoizedProps;
      Component = Component.compare;
      Component = null !== Component ? Component : shallowEqual;
      if (Component(prevProps, nextProps) && current.ref === workInProgress2.ref)
        return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    }
    workInProgress2.flags |= 1;
    current = createWorkInProgress(type, nextProps);
    current.ref = workInProgress2.ref;
    current.return = workInProgress2;
    return workInProgress2.child = current;
  }
  function updateSimpleMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
    if (null !== current) {
      var prevProps = current.memoizedProps;
      if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress2.ref)
        if (didReceiveUpdate = false, workInProgress2.pendingProps = nextProps = prevProps, checkScheduledUpdateOrContext(current, renderLanes2))
          0 !== (current.flags & 131072) && (didReceiveUpdate = true);
        else
          return workInProgress2.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    }
    return updateFunctionComponent(
      current,
      workInProgress2,
      Component,
      nextProps,
      renderLanes2
    );
  }
  function updateOffscreenComponent(current, workInProgress2, renderLanes2, nextProps) {
    var nextChildren = nextProps.children, prevState = null !== current ? current.memoizedState : null;
    null === current && null === workInProgress2.stateNode && (workInProgress2.stateNode = {
      _visibility: 1,
      _pendingMarkers: null,
      _retryCache: null,
      _transitions: null
    });
    if ("hidden" === nextProps.mode) {
      if (0 !== (workInProgress2.flags & 128)) {
        prevState = null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2;
        if (null !== current) {
          nextProps = workInProgress2.child = current.child;
          for (nextChildren = 0; null !== nextProps; )
            nextChildren = nextChildren | nextProps.lanes | nextProps.childLanes, nextProps = nextProps.sibling;
          nextProps = nextChildren & ~prevState;
        } else nextProps = 0, workInProgress2.child = null;
        return deferHiddenOffscreenComponent(
          current,
          workInProgress2,
          prevState,
          renderLanes2,
          nextProps
        );
      }
      if (0 !== (renderLanes2 & 536870912))
        workInProgress2.memoizedState = { baseLanes: 0, cachePool: null }, null !== current && pushTransition(
          workInProgress2,
          null !== prevState ? prevState.cachePool : null
        ), null !== prevState ? pushHiddenContext(workInProgress2, prevState) : reuseHiddenContextOnStack(), pushOffscreenSuspenseHandler(workInProgress2);
      else
        return nextProps = workInProgress2.lanes = 536870912, deferHiddenOffscreenComponent(
          current,
          workInProgress2,
          null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2,
          renderLanes2,
          nextProps
        );
    } else
      null !== prevState ? (pushTransition(workInProgress2, prevState.cachePool), pushHiddenContext(workInProgress2, prevState), reuseSuspenseHandlerOnStack(), workInProgress2.memoizedState = null) : (null !== current && pushTransition(workInProgress2, null), reuseHiddenContextOnStack(), reuseSuspenseHandlerOnStack());
    reconcileChildren(current, workInProgress2, nextChildren, renderLanes2);
    return workInProgress2.child;
  }
  function bailoutOffscreenComponent(current, workInProgress2) {
    null !== current && 22 === current.tag || null !== workInProgress2.stateNode || (workInProgress2.stateNode = {
      _visibility: 1,
      _pendingMarkers: null,
      _retryCache: null,
      _transitions: null
    });
    return workInProgress2.sibling;
  }
  function deferHiddenOffscreenComponent(current, workInProgress2, nextBaseLanes, renderLanes2, remainingChildLanes) {
    var JSCompiler_inline_result = peekCacheFromPool();
    JSCompiler_inline_result = null === JSCompiler_inline_result ? null : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
    workInProgress2.memoizedState = {
      baseLanes: nextBaseLanes,
      cachePool: JSCompiler_inline_result
    };
    null !== current && pushTransition(workInProgress2, null);
    reuseHiddenContextOnStack();
    pushOffscreenSuspenseHandler(workInProgress2);
    null !== current && propagateParentContextChanges(current, workInProgress2, renderLanes2, true);
    workInProgress2.childLanes = remainingChildLanes;
    return null;
  }
  function mountActivityChildren(workInProgress2, nextProps) {
    nextProps = mountWorkInProgressOffscreenFiber(
      { mode: nextProps.mode, children: nextProps.children },
      workInProgress2.mode
    );
    nextProps.ref = workInProgress2.ref;
    workInProgress2.child = nextProps;
    nextProps.return = workInProgress2;
    return nextProps;
  }
  function retryActivityComponentWithoutHydrating(current, workInProgress2, renderLanes2) {
    reconcileChildFibers(workInProgress2, current.child, null, renderLanes2);
    current = mountActivityChildren(workInProgress2, workInProgress2.pendingProps);
    current.flags |= 2;
    popSuspenseHandler(workInProgress2);
    workInProgress2.memoizedState = null;
    return current;
  }
  function updateActivityComponent(current, workInProgress2, renderLanes2) {
    var nextProps = workInProgress2.pendingProps, didSuspend = 0 !== (workInProgress2.flags & 128);
    workInProgress2.flags &= -129;
    if (null === current) {
      if (isHydrating) {
        if ("hidden" === nextProps.mode)
          return current = mountActivityChildren(workInProgress2, nextProps), workInProgress2.lanes = 536870912, bailoutOffscreenComponent(null, current);
        pushDehydratedActivitySuspenseHandler(workInProgress2);
        (current = nextHydratableInstance) ? (current = canHydrateHydrationBoundary(
          current,
          rootOrSingletonContext
        ), current = null !== current && "&" === current.data ? current : null, null !== current && (workInProgress2.memoizedState = {
          dehydrated: current,
          treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
          retryLane: 536870912,
          hydrationErrors: null
        }, renderLanes2 = createFiberFromDehydratedFragment(current), renderLanes2.return = workInProgress2, workInProgress2.child = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : current = null;
        if (null === current) throw throwOnHydrationMismatch(workInProgress2);
        workInProgress2.lanes = 536870912;
        return null;
      }
      return mountActivityChildren(workInProgress2, nextProps);
    }
    var prevState = current.memoizedState;
    if (null !== prevState) {
      var dehydrated = prevState.dehydrated;
      pushDehydratedActivitySuspenseHandler(workInProgress2);
      if (didSuspend)
        if (workInProgress2.flags & 256)
          workInProgress2.flags &= -257, workInProgress2 = retryActivityComponentWithoutHydrating(
            current,
            workInProgress2,
            renderLanes2
          );
        else if (null !== workInProgress2.memoizedState)
          workInProgress2.child = current.child, workInProgress2.flags |= 128, workInProgress2 = null;
        else throw Error(formatProdErrorMessage(558));
      else if (didReceiveUpdate || propagateParentContextChanges(current, workInProgress2, renderLanes2, false), didSuspend = 0 !== (renderLanes2 & current.childLanes), didReceiveUpdate || didSuspend) {
        nextProps = workInProgressRoot;
        if (null !== nextProps && (dehydrated = getBumpedLaneForHydration(nextProps, renderLanes2), 0 !== dehydrated && dehydrated !== prevState.retryLane))
          throw prevState.retryLane = dehydrated, enqueueConcurrentRenderForLane(current, dehydrated), scheduleUpdateOnFiber(nextProps, current, dehydrated), SelectiveHydrationException;
        renderDidSuspendDelayIfPossible();
        workInProgress2 = retryActivityComponentWithoutHydrating(
          current,
          workInProgress2,
          renderLanes2
        );
      } else
        current = prevState.treeContext, nextHydratableInstance = getNextHydratable(dehydrated.nextSibling), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current && restoreSuspendedTreeContext(workInProgress2, current), workInProgress2 = mountActivityChildren(workInProgress2, nextProps), workInProgress2.flags |= 4096;
      return workInProgress2;
    }
    current = createWorkInProgress(current.child, {
      mode: nextProps.mode,
      children: nextProps.children
    });
    current.ref = workInProgress2.ref;
    workInProgress2.child = current;
    current.return = workInProgress2;
    return current;
  }
  function markRef(current, workInProgress2) {
    var ref = workInProgress2.ref;
    if (null === ref)
      null !== current && null !== current.ref && (workInProgress2.flags |= 4194816);
    else {
      if ("function" !== typeof ref && "object" !== typeof ref)
        throw Error(formatProdErrorMessage(284));
      if (null === current || current.ref !== ref)
        workInProgress2.flags |= 4194816;
    }
  }
  function updateFunctionComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
    prepareToReadContext(workInProgress2);
    Component = renderWithHooks(
      current,
      workInProgress2,
      Component,
      nextProps,
      void 0,
      renderLanes2
    );
    nextProps = checkDidRenderIdHook();
    if (null !== current && !didReceiveUpdate)
      return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
    workInProgress2.flags |= 1;
    reconcileChildren(current, workInProgress2, Component, renderLanes2);
    return workInProgress2.child;
  }
  function replayFunctionComponent(current, workInProgress2, nextProps, Component, secondArg, renderLanes2) {
    prepareToReadContext(workInProgress2);
    workInProgress2.updateQueue = null;
    nextProps = renderWithHooksAgain(
      workInProgress2,
      Component,
      nextProps,
      secondArg
    );
    finishRenderingHooks(current);
    Component = checkDidRenderIdHook();
    if (null !== current && !didReceiveUpdate)
      return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    isHydrating && Component && pushMaterializedTreeId(workInProgress2);
    workInProgress2.flags |= 1;
    reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
    return workInProgress2.child;
  }
  function updateClassComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
    prepareToReadContext(workInProgress2);
    if (null === workInProgress2.stateNode) {
      var context = emptyContextObject, contextType = Component.contextType;
      "object" === typeof contextType && null !== contextType && (context = readContext(contextType));
      context = new Component(nextProps, context);
      workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
      context.updater = classComponentUpdater;
      workInProgress2.stateNode = context;
      context._reactInternals = workInProgress2;
      context = workInProgress2.stateNode;
      context.props = nextProps;
      context.state = workInProgress2.memoizedState;
      context.refs = {};
      initializeUpdateQueue(workInProgress2);
      contextType = Component.contextType;
      context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
      context.state = workInProgress2.memoizedState;
      contextType = Component.getDerivedStateFromProps;
      "function" === typeof contextType && (applyDerivedStateFromProps(
        workInProgress2,
        Component,
        contextType,
        nextProps
      ), context.state = workInProgress2.memoizedState);
      "function" === typeof Component.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
      "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
      nextProps = true;
    } else if (null === current) {
      context = workInProgress2.stateNode;
      var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
      context.props = oldProps;
      var oldContext = context.context, contextType$jscomp$0 = Component.contextType;
      contextType = emptyContextObject;
      "object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
      var getDerivedStateFromProps = Component.getDerivedStateFromProps;
      contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
      unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
      contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
        workInProgress2,
        context,
        nextProps,
        contextType
      );
      hasForceUpdate = false;
      var oldState = workInProgress2.memoizedState;
      context.state = oldState;
      processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
      suspendIfUpdateReadFromEntangledAsyncAction();
      oldContext = workInProgress2.memoizedState;
      unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
        workInProgress2,
        Component,
        getDerivedStateFromProps,
        nextProps
      ), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
        workInProgress2,
        Component,
        oldProps,
        nextProps,
        oldState,
        oldContext,
        contextType
      )) ? (contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || ("function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount()), "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308)) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = oldContext), context.props = nextProps, context.state = oldContext, context.context = contextType, nextProps = oldProps) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), nextProps = false);
    } else {
      context = workInProgress2.stateNode;
      cloneUpdateQueue(current, workInProgress2);
      contextType = workInProgress2.memoizedProps;
      contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
      context.props = contextType$jscomp$0;
      getDerivedStateFromProps = workInProgress2.pendingProps;
      oldState = context.context;
      oldContext = Component.contextType;
      oldProps = emptyContextObject;
      "object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
      unresolvedOldProps = Component.getDerivedStateFromProps;
      (oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
        workInProgress2,
        context,
        nextProps,
        oldProps
      );
      hasForceUpdate = false;
      oldState = workInProgress2.memoizedState;
      context.state = oldState;
      processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
      suspendIfUpdateReadFromEntangledAsyncAction();
      var newState = workInProgress2.memoizedState;
      contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
        workInProgress2,
        Component,
        unresolvedOldProps,
        nextProps
      ), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
        workInProgress2,
        Component,
        contextType$jscomp$0,
        nextProps,
        oldState,
        newState,
        oldProps
      ) || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? (oldContext || "function" !== typeof context.UNSAFE_componentWillUpdate && "function" !== typeof context.componentWillUpdate || ("function" === typeof context.componentWillUpdate && context.componentWillUpdate(nextProps, newState, oldProps), "function" === typeof context.UNSAFE_componentWillUpdate && context.UNSAFE_componentWillUpdate(
        nextProps,
        newState,
        oldProps
      )), "function" === typeof context.componentDidUpdate && (workInProgress2.flags |= 4), "function" === typeof context.getSnapshotBeforeUpdate && (workInProgress2.flags |= 1024)) : ("function" !== typeof context.componentDidUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 1024), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = newState), context.props = nextProps, context.state = newState, context.context = oldProps, nextProps = contextType$jscomp$0) : ("function" !== typeof context.componentDidUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 1024), nextProps = false);
    }
    context = nextProps;
    markRef(current, workInProgress2);
    nextProps = 0 !== (workInProgress2.flags & 128);
    context || nextProps ? (context = workInProgress2.stateNode, Component = nextProps && "function" !== typeof Component.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current && nextProps ? (workInProgress2.child = reconcileChildFibers(
      workInProgress2,
      current.child,
      null,
      renderLanes2
    ), workInProgress2.child = reconcileChildFibers(
      workInProgress2,
      null,
      Component,
      renderLanes2
    )) : reconcileChildren(current, workInProgress2, Component, renderLanes2), workInProgress2.memoizedState = context.state, current = workInProgress2.child) : current = bailoutOnAlreadyFinishedWork(
      current,
      workInProgress2,
      renderLanes2
    );
    return current;
  }
  function mountHostRootWithoutHydrating(current, workInProgress2, nextChildren, renderLanes2) {
    resetHydrationState();
    workInProgress2.flags |= 256;
    reconcileChildren(current, workInProgress2, nextChildren, renderLanes2);
    return workInProgress2.child;
  }
  var SUSPENDED_MARKER = {
    dehydrated: null,
    treeContext: null,
    retryLane: 0,
    hydrationErrors: null
  };
  function mountSuspenseOffscreenState(renderLanes2) {
    return { baseLanes: renderLanes2, cachePool: getSuspendedCache() };
  }
  function getRemainingWorkInPrimaryTree(current, primaryTreeDidDefer, renderLanes2) {
    current = null !== current ? current.childLanes & ~renderLanes2 : 0;
    primaryTreeDidDefer && (current |= workInProgressDeferredLane);
    return current;
  }
  function updateSuspenseComponent(current, workInProgress2, renderLanes2) {
    var nextProps = workInProgress2.pendingProps, showFallback = false, didSuspend = 0 !== (workInProgress2.flags & 128), JSCompiler_temp;
    (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current && null === current.memoizedState ? false : 0 !== (suspenseStackCursor.current & 2));
    JSCompiler_temp && (showFallback = true, workInProgress2.flags &= -129);
    JSCompiler_temp = 0 !== (workInProgress2.flags & 32);
    workInProgress2.flags &= -33;
    if (null === current) {
      if (isHydrating) {
        showFallback ? pushPrimaryTreeSuspenseHandler(workInProgress2) : reuseSuspenseHandlerOnStack();
        (current = nextHydratableInstance) ? (current = canHydrateHydrationBoundary(
          current,
          rootOrSingletonContext
        ), current = null !== current && "&" !== current.data ? current : null, null !== current && (workInProgress2.memoizedState = {
          dehydrated: current,
          treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
          retryLane: 536870912,
          hydrationErrors: null
        }, renderLanes2 = createFiberFromDehydratedFragment(current), renderLanes2.return = workInProgress2, workInProgress2.child = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : current = null;
        if (null === current) throw throwOnHydrationMismatch(workInProgress2);
        isSuspenseInstanceFallback(current) ? workInProgress2.lanes = 32 : workInProgress2.lanes = 536870912;
        return null;
      }
      var nextPrimaryChildren = nextProps.children;
      nextProps = nextProps.fallback;
      if (showFallback)
        return reuseSuspenseHandlerOnStack(), showFallback = workInProgress2.mode, nextPrimaryChildren = mountWorkInProgressOffscreenFiber(
          { mode: "hidden", children: nextPrimaryChildren },
          showFallback
        ), nextProps = createFiberFromFragment(
          nextProps,
          showFallback,
          renderLanes2,
          null
        ), nextPrimaryChildren.return = workInProgress2, nextProps.return = workInProgress2, nextPrimaryChildren.sibling = nextProps, workInProgress2.child = nextPrimaryChildren, nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
          current,
          JSCompiler_temp,
          renderLanes2
        ), workInProgress2.memoizedState = SUSPENDED_MARKER, bailoutOffscreenComponent(null, nextProps);
      pushPrimaryTreeSuspenseHandler(workInProgress2);
      return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
    }
    var prevState = current.memoizedState;
    if (null !== prevState && (nextPrimaryChildren = prevState.dehydrated, null !== nextPrimaryChildren)) {
      if (didSuspend)
        workInProgress2.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags &= -257, workInProgress2 = retrySuspenseComponentWithoutHydrating(
          current,
          workInProgress2,
          renderLanes2
        )) : null !== workInProgress2.memoizedState ? (reuseSuspenseHandlerOnStack(), workInProgress2.child = current.child, workInProgress2.flags |= 128, workInProgress2 = null) : (reuseSuspenseHandlerOnStack(), nextPrimaryChildren = nextProps.fallback, showFallback = workInProgress2.mode, nextProps = mountWorkInProgressOffscreenFiber(
          { mode: "visible", children: nextProps.children },
          showFallback
        ), nextPrimaryChildren = createFiberFromFragment(
          nextPrimaryChildren,
          showFallback,
          renderLanes2,
          null
        ), nextPrimaryChildren.flags |= 2, nextProps.return = workInProgress2, nextPrimaryChildren.return = workInProgress2, nextProps.sibling = nextPrimaryChildren, workInProgress2.child = nextProps, reconcileChildFibers(
          workInProgress2,
          current.child,
          null,
          renderLanes2
        ), nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
          current,
          JSCompiler_temp,
          renderLanes2
        ), workInProgress2.memoizedState = SUSPENDED_MARKER, workInProgress2 = bailoutOffscreenComponent(null, nextProps));
      else if (pushPrimaryTreeSuspenseHandler(workInProgress2), isSuspenseInstanceFallback(nextPrimaryChildren)) {
        JSCompiler_temp = nextPrimaryChildren.nextSibling && nextPrimaryChildren.nextSibling.dataset;
        if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
        JSCompiler_temp = digest;
        nextProps = Error(formatProdErrorMessage(419));
        nextProps.stack = "";
        nextProps.digest = JSCompiler_temp;
        queueHydrationError({ value: nextProps, source: null, stack: null });
        workInProgress2 = retrySuspenseComponentWithoutHydrating(
          current,
          workInProgress2,
          renderLanes2
        );
      } else if (didReceiveUpdate || propagateParentContextChanges(current, workInProgress2, renderLanes2, false), JSCompiler_temp = 0 !== (renderLanes2 & current.childLanes), didReceiveUpdate || JSCompiler_temp) {
        JSCompiler_temp = workInProgressRoot;
        if (null !== JSCompiler_temp && (nextProps = getBumpedLaneForHydration(JSCompiler_temp, renderLanes2), 0 !== nextProps && nextProps !== prevState.retryLane))
          throw prevState.retryLane = nextProps, enqueueConcurrentRenderForLane(current, nextProps), scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), SelectiveHydrationException;
        isSuspenseInstancePending(nextPrimaryChildren) || renderDidSuspendDelayIfPossible();
        workInProgress2 = retrySuspenseComponentWithoutHydrating(
          current,
          workInProgress2,
          renderLanes2
        );
      } else
        isSuspenseInstancePending(nextPrimaryChildren) ? (workInProgress2.flags |= 192, workInProgress2.child = current.child, workInProgress2 = null) : (current = prevState.treeContext, nextHydratableInstance = getNextHydratable(
          nextPrimaryChildren.nextSibling
        ), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current && restoreSuspendedTreeContext(workInProgress2, current), workInProgress2 = mountSuspensePrimaryChildren(
          workInProgress2,
          nextProps.children
        ), workInProgress2.flags |= 4096);
      return workInProgress2;
    }
    if (showFallback)
      return reuseSuspenseHandlerOnStack(), nextPrimaryChildren = nextProps.fallback, showFallback = workInProgress2.mode, prevState = current.child, digest = prevState.sibling, nextProps = createWorkInProgress(prevState, {
        mode: "hidden",
        children: nextProps.children
      }), nextProps.subtreeFlags = prevState.subtreeFlags & 65011712, null !== digest ? nextPrimaryChildren = createWorkInProgress(
        digest,
        nextPrimaryChildren
      ) : (nextPrimaryChildren = createFiberFromFragment(
        nextPrimaryChildren,
        showFallback,
        renderLanes2,
        null
      ), nextPrimaryChildren.flags |= 2), nextPrimaryChildren.return = workInProgress2, nextProps.return = workInProgress2, nextProps.sibling = nextPrimaryChildren, workInProgress2.child = nextProps, bailoutOffscreenComponent(null, nextProps), nextProps = workInProgress2.child, nextPrimaryChildren = current.child.memoizedState, null === nextPrimaryChildren ? nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes2) : (showFallback = nextPrimaryChildren.cachePool, null !== showFallback ? (prevState = CacheContext._currentValue, showFallback = showFallback.parent !== prevState ? { parent: prevState, pool: prevState } : showFallback) : showFallback = getSuspendedCache(), nextPrimaryChildren = {
        baseLanes: nextPrimaryChildren.baseLanes | renderLanes2,
        cachePool: showFallback
      }), nextProps.memoizedState = nextPrimaryChildren, nextProps.childLanes = getRemainingWorkInPrimaryTree(
        current,
        JSCompiler_temp,
        renderLanes2
      ), workInProgress2.memoizedState = SUSPENDED_MARKER, bailoutOffscreenComponent(current.child, nextProps);
    pushPrimaryTreeSuspenseHandler(workInProgress2);
    renderLanes2 = current.child;
    current = renderLanes2.sibling;
    renderLanes2 = createWorkInProgress(renderLanes2, {
      mode: "visible",
      children: nextProps.children
    });
    renderLanes2.return = workInProgress2;
    renderLanes2.sibling = null;
    null !== current && (JSCompiler_temp = workInProgress2.deletions, null === JSCompiler_temp ? (workInProgress2.deletions = [current], workInProgress2.flags |= 16) : JSCompiler_temp.push(current));
    workInProgress2.child = renderLanes2;
    workInProgress2.memoizedState = null;
    return renderLanes2;
  }
  function mountSuspensePrimaryChildren(workInProgress2, primaryChildren) {
    primaryChildren = mountWorkInProgressOffscreenFiber(
      { mode: "visible", children: primaryChildren },
      workInProgress2.mode
    );
    primaryChildren.return = workInProgress2;
    return workInProgress2.child = primaryChildren;
  }
  function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
    offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);
    offscreenProps.lanes = 0;
    return offscreenProps;
  }
  function retrySuspenseComponentWithoutHydrating(current, workInProgress2, renderLanes2) {
    reconcileChildFibers(workInProgress2, current.child, null, renderLanes2);
    current = mountSuspensePrimaryChildren(
      workInProgress2,
      workInProgress2.pendingProps.children
    );
    current.flags |= 2;
    workInProgress2.memoizedState = null;
    return current;
  }
  function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
    fiber.lanes |= renderLanes2;
    var alternate = fiber.alternate;
    null !== alternate && (alternate.lanes |= renderLanes2);
    scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
  }
  function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, treeForkCount2) {
    var renderState = workInProgress2.memoizedState;
    null === renderState ? workInProgress2.memoizedState = {
      isBackwards,
      rendering: null,
      renderingStartTime: 0,
      last: lastContentRow,
      tail,
      tailMode,
      treeForkCount: treeForkCount2
    } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode, renderState.treeForkCount = treeForkCount2);
  }
  function updateSuspenseListComponent(current, workInProgress2, renderLanes2) {
    var nextProps = workInProgress2.pendingProps, revealOrder = nextProps.revealOrder, tailMode = nextProps.tail;
    nextProps = nextProps.children;
    var suspenseContext = suspenseStackCursor.current, shouldForceFallback = 0 !== (suspenseContext & 2);
    shouldForceFallback ? (suspenseContext = suspenseContext & 1 | 2, workInProgress2.flags |= 128) : suspenseContext &= 1;
    push(suspenseStackCursor, suspenseContext);
    reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
    nextProps = isHydrating ? treeForkCount : 0;
    if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128))
      a: for (current = workInProgress2.child; null !== current; ) {
        if (13 === current.tag)
          null !== current.memoizedState && scheduleSuspenseWorkOnFiber(current, renderLanes2, workInProgress2);
        else if (19 === current.tag)
          scheduleSuspenseWorkOnFiber(current, renderLanes2, workInProgress2);
        else if (null !== current.child) {
          current.child.return = current;
          current = current.child;
          continue;
        }
        if (current === workInProgress2) break a;
        for (; null === current.sibling; ) {
          if (null === current.return || current.return === workInProgress2)
            break a;
          current = current.return;
        }
        current.sibling.return = current.return;
        current = current.sibling;
      }
    switch (revealOrder) {
      case "forwards":
        renderLanes2 = workInProgress2.child;
        for (revealOrder = null; null !== renderLanes2; )
          current = renderLanes2.alternate, null !== current && null === findFirstSuspended(current) && (revealOrder = renderLanes2), renderLanes2 = renderLanes2.sibling;
        renderLanes2 = revealOrder;
        null === renderLanes2 ? (revealOrder = workInProgress2.child, workInProgress2.child = null) : (revealOrder = renderLanes2.sibling, renderLanes2.sibling = null);
        initSuspenseListRenderState(
          workInProgress2,
          false,
          revealOrder,
          renderLanes2,
          tailMode,
          nextProps
        );
        break;
      case "backwards":
      case "unstable_legacy-backwards":
        renderLanes2 = null;
        revealOrder = workInProgress2.child;
        for (workInProgress2.child = null; null !== revealOrder; ) {
          current = revealOrder.alternate;
          if (null !== current && null === findFirstSuspended(current)) {
            workInProgress2.child = revealOrder;
            break;
          }
          current = revealOrder.sibling;
          revealOrder.sibling = renderLanes2;
          renderLanes2 = revealOrder;
          revealOrder = current;
        }
        initSuspenseListRenderState(
          workInProgress2,
          true,
          renderLanes2,
          null,
          tailMode,
          nextProps
        );
        break;
      case "together":
        initSuspenseListRenderState(
          workInProgress2,
          false,
          null,
          null,
          void 0,
          nextProps
        );
        break;
      default:
        workInProgress2.memoizedState = null;
    }
    return workInProgress2.child;
  }
  function bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2) {
    null !== current && (workInProgress2.dependencies = current.dependencies);
    workInProgressRootSkippedLanes |= workInProgress2.lanes;
    if (0 === (renderLanes2 & workInProgress2.childLanes))
      if (null !== current) {
        if (propagateParentContextChanges(
          current,
          workInProgress2,
          renderLanes2,
          false
        ), 0 === (renderLanes2 & workInProgress2.childLanes))
          return null;
      } else return null;
    if (null !== current && workInProgress2.child !== current.child)
      throw Error(formatProdErrorMessage(153));
    if (null !== workInProgress2.child) {
      current = workInProgress2.child;
      renderLanes2 = createWorkInProgress(current, current.pendingProps);
      workInProgress2.child = renderLanes2;
      for (renderLanes2.return = workInProgress2; null !== current.sibling; )
        current = current.sibling, renderLanes2 = renderLanes2.sibling = createWorkInProgress(current, current.pendingProps), renderLanes2.return = workInProgress2;
      renderLanes2.sibling = null;
    }
    return workInProgress2.child;
  }
  function checkScheduledUpdateOrContext(current, renderLanes2) {
    if (0 !== (current.lanes & renderLanes2)) return true;
    current = current.dependencies;
    return null !== current && checkIfContextChanged(current) ? true : false;
  }
  function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress2, renderLanes2) {
    switch (workInProgress2.tag) {
      case 3:
        pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
        pushProvider(workInProgress2, CacheContext, current.memoizedState.cache);
        resetHydrationState();
        break;
      case 27:
      case 5:
        pushHostContext(workInProgress2);
        break;
      case 4:
        pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
        break;
      case 10:
        pushProvider(
          workInProgress2,
          workInProgress2.type,
          workInProgress2.memoizedProps.value
        );
        break;
      case 31:
        if (null !== workInProgress2.memoizedState)
          return workInProgress2.flags |= 128, pushDehydratedActivitySuspenseHandler(workInProgress2), null;
        break;
      case 13:
        var state$102 = workInProgress2.memoizedState;
        if (null !== state$102) {
          if (null !== state$102.dehydrated)
            return pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags |= 128, null;
          if (0 !== (renderLanes2 & workInProgress2.child.childLanes))
            return updateSuspenseComponent(current, workInProgress2, renderLanes2);
          pushPrimaryTreeSuspenseHandler(workInProgress2);
          current = bailoutOnAlreadyFinishedWork(
            current,
            workInProgress2,
            renderLanes2
          );
          return null !== current ? current.sibling : null;
        }
        pushPrimaryTreeSuspenseHandler(workInProgress2);
        break;
      case 19:
        var didSuspendBefore = 0 !== (current.flags & 128);
        state$102 = 0 !== (renderLanes2 & workInProgress2.childLanes);
        state$102 || (propagateParentContextChanges(
          current,
          workInProgress2,
          renderLanes2,
          false
        ), state$102 = 0 !== (renderLanes2 & workInProgress2.childLanes));
        if (didSuspendBefore) {
          if (state$102)
            return updateSuspenseListComponent(
              current,
              workInProgress2,
              renderLanes2
            );
          workInProgress2.flags |= 128;
        }
        didSuspendBefore = workInProgress2.memoizedState;
        null !== didSuspendBefore && (didSuspendBefore.rendering = null, didSuspendBefore.tail = null, didSuspendBefore.lastEffect = null);
        push(suspenseStackCursor, suspenseStackCursor.current);
        if (state$102) break;
        else return null;
      case 22:
        return workInProgress2.lanes = 0, updateOffscreenComponent(
          current,
          workInProgress2,
          renderLanes2,
          workInProgress2.pendingProps
        );
      case 24:
        pushProvider(workInProgress2, CacheContext, current.memoizedState.cache);
    }
    return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
  }
  function beginWork(current, workInProgress2, renderLanes2) {
    if (null !== current)
      if (current.memoizedProps !== workInProgress2.pendingProps)
        didReceiveUpdate = true;
      else {
        if (!checkScheduledUpdateOrContext(current, renderLanes2) && 0 === (workInProgress2.flags & 128))
          return didReceiveUpdate = false, attemptEarlyBailoutIfNoScheduledUpdate(
            current,
            workInProgress2,
            renderLanes2
          );
        didReceiveUpdate = 0 !== (current.flags & 131072) ? true : false;
      }
    else
      didReceiveUpdate = false, isHydrating && 0 !== (workInProgress2.flags & 1048576) && pushTreeId(workInProgress2, treeForkCount, workInProgress2.index);
    workInProgress2.lanes = 0;
    switch (workInProgress2.tag) {
      case 16:
        a: {
          var props = workInProgress2.pendingProps;
          current = resolveLazy(workInProgress2.elementType);
          workInProgress2.type = current;
          if ("function" === typeof current)
            shouldConstruct(current) ? (props = resolveClassComponentProps(current, props), workInProgress2.tag = 1, workInProgress2 = updateClassComponent(
              null,
              workInProgress2,
              current,
              props,
              renderLanes2
            )) : (workInProgress2.tag = 0, workInProgress2 = updateFunctionComponent(
              null,
              workInProgress2,
              current,
              props,
              renderLanes2
            ));
          else {
            if (void 0 !== current && null !== current) {
              var $$typeof = current.$$typeof;
              if ($$typeof === REACT_FORWARD_REF_TYPE) {
                workInProgress2.tag = 11;
                workInProgress2 = updateForwardRef(
                  null,
                  workInProgress2,
                  current,
                  props,
                  renderLanes2
                );
                break a;
              } else if ($$typeof === REACT_MEMO_TYPE) {
                workInProgress2.tag = 14;
                workInProgress2 = updateMemoComponent(
                  null,
                  workInProgress2,
                  current,
                  props,
                  renderLanes2
                );
                break a;
              }
            }
            workInProgress2 = getComponentNameFromType(current) || current;
            throw Error(formatProdErrorMessage(306, workInProgress2, ""));
          }
        }
        return workInProgress2;
      case 0:
        return updateFunctionComponent(
          current,
          workInProgress2,
          workInProgress2.type,
          workInProgress2.pendingProps,
          renderLanes2
        );
      case 1:
        return props = workInProgress2.type, $$typeof = resolveClassComponentProps(
          props,
          workInProgress2.pendingProps
        ), updateClassComponent(
          current,
          workInProgress2,
          props,
          $$typeof,
          renderLanes2
        );
      case 3:
        a: {
          pushHostContainer(
            workInProgress2,
            workInProgress2.stateNode.containerInfo
          );
          if (null === current) throw Error(formatProdErrorMessage(387));
          props = workInProgress2.pendingProps;
          var prevState = workInProgress2.memoizedState;
          $$typeof = prevState.element;
          cloneUpdateQueue(current, workInProgress2);
          processUpdateQueue(workInProgress2, props, null, renderLanes2);
          var nextState = workInProgress2.memoizedState;
          props = nextState.cache;
          pushProvider(workInProgress2, CacheContext, props);
          props !== prevState.cache && propagateContextChanges(
            workInProgress2,
            [CacheContext],
            renderLanes2,
            true
          );
          suspendIfUpdateReadFromEntangledAsyncAction();
          props = nextState.element;
          if (prevState.isDehydrated)
            if (prevState = {
              element: props,
              isDehydrated: false,
              cache: nextState.cache
            }, workInProgress2.updateQueue.baseState = prevState, workInProgress2.memoizedState = prevState, workInProgress2.flags & 256) {
              workInProgress2 = mountHostRootWithoutHydrating(
                current,
                workInProgress2,
                props,
                renderLanes2
              );
              break a;
            } else if (props !== $$typeof) {
              $$typeof = createCapturedValueAtFiber(
                Error(formatProdErrorMessage(424)),
                workInProgress2
              );
              queueHydrationError($$typeof);
              workInProgress2 = mountHostRootWithoutHydrating(
                current,
                workInProgress2,
                props,
                renderLanes2
              );
              break a;
            } else {
              current = workInProgress2.stateNode.containerInfo;
              switch (current.nodeType) {
                case 9:
                  current = current.body;
                  break;
                default:
                  current = "HTML" === current.nodeName ? current.ownerDocument.body : current;
              }
              nextHydratableInstance = getNextHydratable(current.firstChild);
              hydrationParentFiber = workInProgress2;
              isHydrating = true;
              hydrationErrors = null;
              rootOrSingletonContext = true;
              renderLanes2 = mountChildFibers(
                workInProgress2,
                null,
                props,
                renderLanes2
              );
              for (workInProgress2.child = renderLanes2; renderLanes2; )
                renderLanes2.flags = renderLanes2.flags & -3 | 4096, renderLanes2 = renderLanes2.sibling;
            }
          else {
            resetHydrationState();
            if (props === $$typeof) {
              workInProgress2 = bailoutOnAlreadyFinishedWork(
                current,
                workInProgress2,
                renderLanes2
              );
              break a;
            }
            reconcileChildren(current, workInProgress2, props, renderLanes2);
          }
          workInProgress2 = workInProgress2.child;
        }
        return workInProgress2;
      case 26:
        return markRef(current, workInProgress2), null === current ? (renderLanes2 = getResource(
          workInProgress2.type,
          null,
          workInProgress2.pendingProps,
          null
        )) ? workInProgress2.memoizedState = renderLanes2 : isHydrating || (renderLanes2 = workInProgress2.type, current = workInProgress2.pendingProps, props = getOwnerDocumentFromRootContainer(
          rootInstanceStackCursor.current
        ).createElement(renderLanes2), props[internalInstanceKey] = workInProgress2, props[internalPropsKey] = current, setInitialProperties(props, renderLanes2, current), markNodeAsHoistable(props), workInProgress2.stateNode = props) : workInProgress2.memoizedState = getResource(
          workInProgress2.type,
          current.memoizedProps,
          workInProgress2.pendingProps,
          current.memoizedState
        ), null;
      case 27:
        return pushHostContext(workInProgress2), null === current && isHydrating && (props = workInProgress2.stateNode = resolveSingletonInstance(
          workInProgress2.type,
          workInProgress2.pendingProps,
          rootInstanceStackCursor.current
        ), hydrationParentFiber = workInProgress2, rootOrSingletonContext = true, $$typeof = nextHydratableInstance, isSingletonScope(workInProgress2.type) ? (previousHydratableOnEnteringScopedSingleton = $$typeof, nextHydratableInstance = getNextHydratable(props.firstChild)) : nextHydratableInstance = $$typeof), reconcileChildren(
          current,
          workInProgress2,
          workInProgress2.pendingProps.children,
          renderLanes2
        ), markRef(current, workInProgress2), null === current && (workInProgress2.flags |= 4194304), workInProgress2.child;
      case 5:
        if (null === current && isHydrating) {
          if ($$typeof = props = nextHydratableInstance)
            props = canHydrateInstance(
              props,
              workInProgress2.type,
              workInProgress2.pendingProps,
              rootOrSingletonContext
            ), null !== props ? (workInProgress2.stateNode = props, hydrationParentFiber = workInProgress2, nextHydratableInstance = getNextHydratable(props.firstChild), rootOrSingletonContext = false, $$typeof = true) : $$typeof = false;
          $$typeof || throwOnHydrationMismatch(workInProgress2);
        }
        pushHostContext(workInProgress2);
        $$typeof = workInProgress2.type;
        prevState = workInProgress2.pendingProps;
        nextState = null !== current ? current.memoizedProps : null;
        props = prevState.children;
        shouldSetTextContent($$typeof, prevState) ? props = null : null !== nextState && shouldSetTextContent($$typeof, nextState) && (workInProgress2.flags |= 32);
        null !== workInProgress2.memoizedState && ($$typeof = renderWithHooks(
          current,
          workInProgress2,
          TransitionAwareHostComponent,
          null,
          null,
          renderLanes2
        ), HostTransitionContext._currentValue = $$typeof);
        markRef(current, workInProgress2);
        reconcileChildren(current, workInProgress2, props, renderLanes2);
        return workInProgress2.child;
      case 6:
        if (null === current && isHydrating) {
          if (current = renderLanes2 = nextHydratableInstance)
            renderLanes2 = canHydrateTextInstance(
              renderLanes2,
              workInProgress2.pendingProps,
              rootOrSingletonContext
            ), null !== renderLanes2 ? (workInProgress2.stateNode = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, current = true) : current = false;
          current || throwOnHydrationMismatch(workInProgress2);
        }
        return null;
      case 13:
        return updateSuspenseComponent(current, workInProgress2, renderLanes2);
      case 4:
        return pushHostContainer(
          workInProgress2,
          workInProgress2.stateNode.containerInfo
        ), props = workInProgress2.pendingProps, null === current ? workInProgress2.child = reconcileChildFibers(
          workInProgress2,
          null,
          props,
          renderLanes2
        ) : reconcileChildren(current, workInProgress2, props, renderLanes2), workInProgress2.child;
      case 11:
        return updateForwardRef(
          current,
          workInProgress2,
          workInProgress2.type,
          workInProgress2.pendingProps,
          renderLanes2
        );
      case 7:
        return reconcileChildren(
          current,
          workInProgress2,
          workInProgress2.pendingProps,
          renderLanes2
        ), workInProgress2.child;
      case 8:
        return reconcileChildren(
          current,
          workInProgress2,
          workInProgress2.pendingProps.children,
          renderLanes2
        ), workInProgress2.child;
      case 12:
        return reconcileChildren(
          current,
          workInProgress2,
          workInProgress2.pendingProps.children,
          renderLanes2
        ), workInProgress2.child;
      case 10:
        return props = workInProgress2.pendingProps, pushProvider(workInProgress2, workInProgress2.type, props.value), reconcileChildren(current, workInProgress2, props.children, renderLanes2), workInProgress2.child;
      case 9:
        return $$typeof = workInProgress2.type._context, props = workInProgress2.pendingProps.children, prepareToReadContext(workInProgress2), $$typeof = readContext($$typeof), props = props($$typeof), workInProgress2.flags |= 1, reconcileChildren(current, workInProgress2, props, renderLanes2), workInProgress2.child;
      case 14:
        return updateMemoComponent(
          current,
          workInProgress2,
          workInProgress2.type,
          workInProgress2.pendingProps,
          renderLanes2
        );
      case 15:
        return updateSimpleMemoComponent(
          current,
          workInProgress2,
          workInProgress2.type,
          workInProgress2.pendingProps,
          renderLanes2
        );
      case 19:
        return updateSuspenseListComponent(current, workInProgress2, renderLanes2);
      case 31:
        return updateActivityComponent(current, workInProgress2, renderLanes2);
      case 22:
        return updateOffscreenComponent(
          current,
          workInProgress2,
          renderLanes2,
          workInProgress2.pendingProps
        );
      case 24:
        return prepareToReadContext(workInProgress2), props = readContext(CacheContext), null === current ? ($$typeof = peekCacheFromPool(), null === $$typeof && ($$typeof = workInProgressRoot, prevState = createCache(), $$typeof.pooledCache = prevState, prevState.refCount++, null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes2), $$typeof = prevState), workInProgress2.memoizedState = { parent: props, cache: $$typeof }, initializeUpdateQueue(workInProgress2), pushProvider(workInProgress2, CacheContext, $$typeof)) : (0 !== (current.lanes & renderLanes2) && (cloneUpdateQueue(current, workInProgress2), processUpdateQueue(workInProgress2, null, null, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction()), $$typeof = current.memoizedState, prevState = workInProgress2.memoizedState, $$typeof.parent !== props ? ($$typeof = { parent: props, cache: props }, workInProgress2.memoizedState = $$typeof, 0 === workInProgress2.lanes && (workInProgress2.memoizedState = workInProgress2.updateQueue.baseState = $$typeof), pushProvider(workInProgress2, CacheContext, props)) : (props = prevState.cache, pushProvider(workInProgress2, CacheContext, props), props !== $$typeof.cache && propagateContextChanges(
          workInProgress2,
          [CacheContext],
          renderLanes2,
          true
        ))), reconcileChildren(
          current,
          workInProgress2,
          workInProgress2.pendingProps.children,
          renderLanes2
        ), workInProgress2.child;
      case 29:
        throw workInProgress2.pendingProps;
    }
    throw Error(formatProdErrorMessage(156, workInProgress2.tag));
  }
  function markUpdate(workInProgress2) {
    workInProgress2.flags |= 4;
  }
  function preloadInstanceAndSuspendIfNeeded(workInProgress2, type, oldProps, newProps, renderLanes2) {
    if (type = 0 !== (workInProgress2.mode & 32)) type = false;
    if (type) {
      if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2)
        if (workInProgress2.stateNode.complete) workInProgress2.flags |= 8192;
        else if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
        else
          throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
    } else workInProgress2.flags &= -16777217;
  }
  function preloadResourceAndSuspendIfNeeded(workInProgress2, resource) {
    if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4))
      workInProgress2.flags &= -16777217;
    else if (workInProgress2.flags |= 16777216, !preloadResource(resource))
      if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
      else
        throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
  }
  function scheduleRetryEffect(workInProgress2, retryQueue) {
    null !== retryQueue && (workInProgress2.flags |= 4);
    workInProgress2.flags & 16384 && (retryQueue = 22 !== workInProgress2.tag ? claimNextRetryLane() : 536870912, workInProgress2.lanes |= retryQueue, workInProgressSuspendedRetryLanes |= retryQueue);
  }
  function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
    if (!isHydrating)
      switch (renderState.tailMode) {
        case "hidden":
          hasRenderedATailFallback = renderState.tail;
          for (var lastTailNode = null; null !== hasRenderedATailFallback; )
            null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling;
          null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null;
          break;
        case "collapsed":
          lastTailNode = renderState.tail;
          for (var lastTailNode$106 = null; null !== lastTailNode; )
            null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode), lastTailNode = lastTailNode.sibling;
          null === lastTailNode$106 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$106.sibling = null;
      }
  }
  function bubbleProperties(completedWork) {
    var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, newChildLanes = 0, subtreeFlags = 0;
    if (didBailout)
      for (var child$107 = completedWork.child; null !== child$107; )
        newChildLanes |= child$107.lanes | child$107.childLanes, subtreeFlags |= child$107.subtreeFlags & 65011712, subtreeFlags |= child$107.flags & 65011712, child$107.return = completedWork, child$107 = child$107.sibling;
    else
      for (child$107 = completedWork.child; null !== child$107; )
        newChildLanes |= child$107.lanes | child$107.childLanes, subtreeFlags |= child$107.subtreeFlags, subtreeFlags |= child$107.flags, child$107.return = completedWork, child$107 = child$107.sibling;
    completedWork.subtreeFlags |= subtreeFlags;
    completedWork.childLanes = newChildLanes;
    return didBailout;
  }
  function completeWork(current, workInProgress2, renderLanes2) {
    var newProps = workInProgress2.pendingProps;
    popTreeContext(workInProgress2);
    switch (workInProgress2.tag) {
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return bubbleProperties(workInProgress2), null;
      case 1:
        return bubbleProperties(workInProgress2), null;
      case 3:
        renderLanes2 = workInProgress2.stateNode;
        newProps = null;
        null !== current && (newProps = current.memoizedState.cache);
        workInProgress2.memoizedState.cache !== newProps && (workInProgress2.flags |= 2048);
        popProvider(CacheContext);
        popHostContainer();
        renderLanes2.pendingContext && (renderLanes2.context = renderLanes2.pendingContext, renderLanes2.pendingContext = null);
        if (null === current || null === current.child)
          popHydrationState(workInProgress2) ? markUpdate(workInProgress2) : null === current || current.memoizedState.isDehydrated && 0 === (workInProgress2.flags & 256) || (workInProgress2.flags |= 1024, upgradeHydrationErrorsToRecoverable());
        bubbleProperties(workInProgress2);
        return null;
      case 26:
        var type = workInProgress2.type, nextResource = workInProgress2.memoizedState;
        null === current ? (markUpdate(workInProgress2), null !== nextResource ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, nextResource)) : (bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
          workInProgress2,
          type,
          null,
          newProps,
          renderLanes2
        ))) : nextResource ? nextResource !== current.memoizedState ? (markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, nextResource)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (current = current.memoizedProps, current !== newProps && markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
          workInProgress2,
          type,
          current,
          newProps,
          renderLanes2
        ));
        return null;
      case 27:
        popHostContext(workInProgress2);
        renderLanes2 = rootInstanceStackCursor.current;
        type = workInProgress2.type;
        if (null !== current && null != workInProgress2.stateNode)
          current.memoizedProps !== newProps && markUpdate(workInProgress2);
        else {
          if (!newProps) {
            if (null === workInProgress2.stateNode)
              throw Error(formatProdErrorMessage(166));
            bubbleProperties(workInProgress2);
            return null;
          }
          current = contextStackCursor.current;
          popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2) : (current = resolveSingletonInstance(type, newProps, renderLanes2), workInProgress2.stateNode = current, markUpdate(workInProgress2));
        }
        bubbleProperties(workInProgress2);
        return null;
      case 5:
        popHostContext(workInProgress2);
        type = workInProgress2.type;
        if (null !== current && null != workInProgress2.stateNode)
          current.memoizedProps !== newProps && markUpdate(workInProgress2);
        else {
          if (!newProps) {
            if (null === workInProgress2.stateNode)
              throw Error(formatProdErrorMessage(166));
            bubbleProperties(workInProgress2);
            return null;
          }
          nextResource = contextStackCursor.current;
          if (popHydrationState(workInProgress2))
            prepareToHydrateHostInstance(workInProgress2);
          else {
            var ownerDocument = getOwnerDocumentFromRootContainer(
              rootInstanceStackCursor.current
            );
            switch (nextResource) {
              case 1:
                nextResource = ownerDocument.createElementNS(
                  "http://www.w3.org/2000/svg",
                  type
                );
                break;
              case 2:
                nextResource = ownerDocument.createElementNS(
                  "http://www.w3.org/1998/Math/MathML",
                  type
                );
                break;
              default:
                switch (type) {
                  case "svg":
                    nextResource = ownerDocument.createElementNS(
                      "http://www.w3.org/2000/svg",
                      type
                    );
                    break;
                  case "math":
                    nextResource = ownerDocument.createElementNS(
                      "http://www.w3.org/1998/Math/MathML",
                      type
                    );
                    break;
                  case "script":
                    nextResource = ownerDocument.createElement("div");
                    nextResource.innerHTML = "<script><\/script>";
                    nextResource = nextResource.removeChild(
                      nextResource.firstChild
                    );
                    break;
                  case "select":
                    nextResource = "string" === typeof newProps.is ? ownerDocument.createElement("select", {
                      is: newProps.is
                    }) : ownerDocument.createElement("select");
                    newProps.multiple ? nextResource.multiple = true : newProps.size && (nextResource.size = newProps.size);
                    break;
                  default:
                    nextResource = "string" === typeof newProps.is ? ownerDocument.createElement(type, { is: newProps.is }) : ownerDocument.createElement(type);
                }
            }
            nextResource[internalInstanceKey] = workInProgress2;
            nextResource[internalPropsKey] = newProps;
            a: for (ownerDocument = workInProgress2.child; null !== ownerDocument; ) {
              if (5 === ownerDocument.tag || 6 === ownerDocument.tag)
                nextResource.appendChild(ownerDocument.stateNode);
              else if (4 !== ownerDocument.tag && 27 !== ownerDocument.tag && null !== ownerDocument.child) {
                ownerDocument.child.return = ownerDocument;
                ownerDocument = ownerDocument.child;
                continue;
              }
              if (ownerDocument === workInProgress2) break a;
              for (; null === ownerDocument.sibling; ) {
                if (null === ownerDocument.return || ownerDocument.return === workInProgress2)
                  break a;
                ownerDocument = ownerDocument.return;
              }
              ownerDocument.sibling.return = ownerDocument.return;
              ownerDocument = ownerDocument.sibling;
            }
            workInProgress2.stateNode = nextResource;
            a: switch (setInitialProperties(nextResource, type, newProps), type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                newProps = !!newProps.autoFocus;
                break a;
              case "img":
                newProps = true;
                break a;
              default:
                newProps = false;
            }
            newProps && markUpdate(workInProgress2);
          }
        }
        bubbleProperties(workInProgress2);
        preloadInstanceAndSuspendIfNeeded(
          workInProgress2,
          workInProgress2.type,
          null === current ? null : current.memoizedProps,
          workInProgress2.pendingProps,
          renderLanes2
        );
        return null;
      case 6:
        if (current && null != workInProgress2.stateNode)
          current.memoizedProps !== newProps && markUpdate(workInProgress2);
        else {
          if ("string" !== typeof newProps && null === workInProgress2.stateNode)
            throw Error(formatProdErrorMessage(166));
          current = rootInstanceStackCursor.current;
          if (popHydrationState(workInProgress2)) {
            current = workInProgress2.stateNode;
            renderLanes2 = workInProgress2.memoizedProps;
            newProps = null;
            type = hydrationParentFiber;
            if (null !== type)
              switch (type.tag) {
                case 27:
                case 5:
                  newProps = type.memoizedProps;
              }
            current[internalInstanceKey] = workInProgress2;
            current = current.nodeValue === renderLanes2 || null !== newProps && true === newProps.suppressHydrationWarning || checkForUnmatchedText(current.nodeValue, renderLanes2) ? true : false;
            current || throwOnHydrationMismatch(workInProgress2, true);
          } else
            current = getOwnerDocumentFromRootContainer(current).createTextNode(
              newProps
            ), current[internalInstanceKey] = workInProgress2, workInProgress2.stateNode = current;
        }
        bubbleProperties(workInProgress2);
        return null;
      case 31:
        renderLanes2 = workInProgress2.memoizedState;
        if (null === current || null !== current.memoizedState) {
          newProps = popHydrationState(workInProgress2);
          if (null !== renderLanes2) {
            if (null === current) {
              if (!newProps) throw Error(formatProdErrorMessage(318));
              current = workInProgress2.memoizedState;
              current = null !== current ? current.dehydrated : null;
              if (!current) throw Error(formatProdErrorMessage(557));
              current[internalInstanceKey] = workInProgress2;
            } else
              resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
            bubbleProperties(workInProgress2);
            current = false;
          } else
            renderLanes2 = upgradeHydrationErrorsToRecoverable(), null !== current && null !== current.memoizedState && (current.memoizedState.hydrationErrors = renderLanes2), current = true;
          if (!current) {
            if (workInProgress2.flags & 256)
              return popSuspenseHandler(workInProgress2), workInProgress2;
            popSuspenseHandler(workInProgress2);
            return null;
          }
          if (0 !== (workInProgress2.flags & 128))
            throw Error(formatProdErrorMessage(558));
        }
        bubbleProperties(workInProgress2);
        return null;
      case 13:
        newProps = workInProgress2.memoizedState;
        if (null === current || null !== current.memoizedState && null !== current.memoizedState.dehydrated) {
          type = popHydrationState(workInProgress2);
          if (null !== newProps && null !== newProps.dehydrated) {
            if (null === current) {
              if (!type) throw Error(formatProdErrorMessage(318));
              type = workInProgress2.memoizedState;
              type = null !== type ? type.dehydrated : null;
              if (!type) throw Error(formatProdErrorMessage(317));
              type[internalInstanceKey] = workInProgress2;
            } else
              resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
            bubbleProperties(workInProgress2);
            type = false;
          } else
            type = upgradeHydrationErrorsToRecoverable(), null !== current && null !== current.memoizedState && (current.memoizedState.hydrationErrors = type), type = true;
          if (!type) {
            if (workInProgress2.flags & 256)
              return popSuspenseHandler(workInProgress2), workInProgress2;
            popSuspenseHandler(workInProgress2);
            return null;
          }
        }
        popSuspenseHandler(workInProgress2);
        if (0 !== (workInProgress2.flags & 128))
          return workInProgress2.lanes = renderLanes2, workInProgress2;
        renderLanes2 = null !== newProps;
        current = null !== current && null !== current.memoizedState;
        renderLanes2 && (newProps = workInProgress2.child, type = null, null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool), nextResource = null, null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (nextResource = newProps.memoizedState.cachePool.pool), nextResource !== type && (newProps.flags |= 2048));
        renderLanes2 !== current && renderLanes2 && (workInProgress2.child.flags |= 8192);
        scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
        bubbleProperties(workInProgress2);
        return null;
      case 4:
        return popHostContainer(), null === current && listenToAllSupportedEvents(workInProgress2.stateNode.containerInfo), bubbleProperties(workInProgress2), null;
      case 10:
        return popProvider(workInProgress2.type), bubbleProperties(workInProgress2), null;
      case 19:
        pop(suspenseStackCursor);
        newProps = workInProgress2.memoizedState;
        if (null === newProps) return bubbleProperties(workInProgress2), null;
        type = 0 !== (workInProgress2.flags & 128);
        nextResource = newProps.rendering;
        if (null === nextResource)
          if (type) cutOffTailIfNeeded(newProps, false);
          else {
            if (0 !== workInProgressRootExitStatus || null !== current && 0 !== (current.flags & 128))
              for (current = workInProgress2.child; null !== current; ) {
                nextResource = findFirstSuspended(current);
                if (null !== nextResource) {
                  workInProgress2.flags |= 128;
                  cutOffTailIfNeeded(newProps, false);
                  current = nextResource.updateQueue;
                  workInProgress2.updateQueue = current;
                  scheduleRetryEffect(workInProgress2, current);
                  workInProgress2.subtreeFlags = 0;
                  current = renderLanes2;
                  for (renderLanes2 = workInProgress2.child; null !== renderLanes2; )
                    resetWorkInProgress(renderLanes2, current), renderLanes2 = renderLanes2.sibling;
                  push(
                    suspenseStackCursor,
                    suspenseStackCursor.current & 1 | 2
                  );
                  isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount);
                  return workInProgress2.child;
                }
                current = current.sibling;
              }
            null !== newProps.tail && now2() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
          }
        else {
          if (!type)
            if (current = findFirstSuspended(nextResource), null !== current) {
              if (workInProgress2.flags |= 128, type = true, current = current.updateQueue, workInProgress2.updateQueue = current, scheduleRetryEffect(workInProgress2, current), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
                return bubbleProperties(workInProgress2), null;
            } else
              2 * now2() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
          newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current = newProps.last, null !== current ? current.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
        }
        if (null !== newProps.tail)
          return current = newProps.tail, newProps.rendering = current, newProps.tail = current.sibling, newProps.renderingStartTime = now2(), current.sibling = null, renderLanes2 = suspenseStackCursor.current, push(
            suspenseStackCursor,
            type ? renderLanes2 & 1 | 2 : renderLanes2 & 1
          ), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current;
        bubbleProperties(workInProgress2);
        return null;
      case 22:
      case 23:
        return popSuspenseHandler(workInProgress2), popHiddenContext(), newProps = null !== workInProgress2.memoizedState, null !== current ? null !== current.memoizedState !== newProps && (workInProgress2.flags |= 8192) : newProps && (workInProgress2.flags |= 8192), newProps ? 0 !== (renderLanes2 & 536870912) && 0 === (workInProgress2.flags & 128) && (bubbleProperties(workInProgress2), workInProgress2.subtreeFlags & 6 && (workInProgress2.flags |= 8192)) : bubbleProperties(workInProgress2), renderLanes2 = workInProgress2.updateQueue, null !== renderLanes2 && scheduleRetryEffect(workInProgress2, renderLanes2.retryQueue), renderLanes2 = null, null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && (renderLanes2 = current.memoizedState.cachePool.pool), newProps = null, null !== workInProgress2.memoizedState && null !== workInProgress2.memoizedState.cachePool && (newProps = workInProgress2.memoizedState.cachePool.pool), newProps !== renderLanes2 && (workInProgress2.flags |= 2048), null !== current && pop(resumedCache), null;
      case 24:
        return renderLanes2 = null, null !== current && (renderLanes2 = current.memoizedState.cache), workInProgress2.memoizedState.cache !== renderLanes2 && (workInProgress2.flags |= 2048), popProvider(CacheContext), bubbleProperties(workInProgress2), null;
      case 25:
        return null;
      case 30:
        return null;
    }
    throw Error(formatProdErrorMessage(156, workInProgress2.tag));
  }
  function unwindWork(current, workInProgress2) {
    popTreeContext(workInProgress2);
    switch (workInProgress2.tag) {
      case 1:
        return current = workInProgress2.flags, current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
      case 3:
        return popProvider(CacheContext), popHostContainer(), current = workInProgress2.flags, 0 !== (current & 65536) && 0 === (current & 128) ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
      case 26:
      case 27:
      case 5:
        return popHostContext(workInProgress2), null;
      case 31:
        if (null !== workInProgress2.memoizedState) {
          popSuspenseHandler(workInProgress2);
          if (null === workInProgress2.alternate)
            throw Error(formatProdErrorMessage(340));
          resetHydrationState();
        }
        current = workInProgress2.flags;
        return current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
      case 13:
        popSuspenseHandler(workInProgress2);
        current = workInProgress2.memoizedState;
        if (null !== current && null !== current.dehydrated) {
          if (null === workInProgress2.alternate)
            throw Error(formatProdErrorMessage(340));
          resetHydrationState();
        }
        current = workInProgress2.flags;
        return current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
      case 19:
        return pop(suspenseStackCursor), null;
      case 4:
        return popHostContainer(), null;
      case 10:
        return popProvider(workInProgress2.type), null;
      case 22:
      case 23:
        return popSuspenseHandler(workInProgress2), popHiddenContext(), null !== current && pop(resumedCache), current = workInProgress2.flags, current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
      case 24:
        return popProvider(CacheContext), null;
      case 25:
        return null;
      default:
        return null;
    }
  }
  function unwindInterruptedWork(current, interruptedWork) {
    popTreeContext(interruptedWork);
    switch (interruptedWork.tag) {
      case 3:
        popProvider(CacheContext);
        popHostContainer();
        break;
      case 26:
      case 27:
      case 5:
        popHostContext(interruptedWork);
        break;
      case 4:
        popHostContainer();
        break;
      case 31:
        null !== interruptedWork.memoizedState && popSuspenseHandler(interruptedWork);
        break;
      case 13:
        popSuspenseHandler(interruptedWork);
        break;
      case 19:
        pop(suspenseStackCursor);
        break;
      case 10:
        popProvider(interruptedWork.type);
        break;
      case 22:
      case 23:
        popSuspenseHandler(interruptedWork);
        popHiddenContext();
        null !== current && pop(resumedCache);
        break;
      case 24:
        popProvider(CacheContext);
    }
  }
  function commitHookEffectListMount(flags, finishedWork) {
    try {
      var updateQueue2 = finishedWork.updateQueue, lastEffect = null !== updateQueue2 ? updateQueue2.lastEffect : null;
      if (null !== lastEffect) {
        var firstEffect = lastEffect.next;
        updateQueue2 = firstEffect;
        do {
          if ((updateQueue2.tag & flags) === flags) {
            lastEffect = void 0;
            var create = updateQueue2.create, inst = updateQueue2.inst;
            lastEffect = create();
            inst.destroy = lastEffect;
          }
          updateQueue2 = updateQueue2.next;
        } while (updateQueue2 !== firstEffect);
      }
    } catch (error2) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
    }
  }
  function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) {
    try {
      var updateQueue2 = finishedWork.updateQueue, lastEffect = null !== updateQueue2 ? updateQueue2.lastEffect : null;
      if (null !== lastEffect) {
        var firstEffect = lastEffect.next;
        updateQueue2 = firstEffect;
        do {
          if ((updateQueue2.tag & flags) === flags) {
            var inst = updateQueue2.inst, destroy = inst.destroy;
            if (void 0 !== destroy) {
              inst.destroy = void 0;
              lastEffect = finishedWork;
              var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, destroy_ = destroy;
              try {
                destroy_();
              } catch (error2) {
                captureCommitPhaseError(
                  lastEffect,
                  nearestMountedAncestor,
                  error2
                );
              }
            }
          }
          updateQueue2 = updateQueue2.next;
        } while (updateQueue2 !== firstEffect);
      }
    } catch (error2) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
    }
  }
  function commitClassCallbacks(finishedWork) {
    var updateQueue2 = finishedWork.updateQueue;
    if (null !== updateQueue2) {
      var instance = finishedWork.stateNode;
      try {
        commitCallbacks(updateQueue2, instance);
      } catch (error2) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
      }
    }
  }
  function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) {
    instance.props = resolveClassComponentProps(
      current.type,
      current.memoizedProps
    );
    instance.state = current.memoizedState;
    try {
      instance.componentWillUnmount();
    } catch (error2) {
      captureCommitPhaseError(current, nearestMountedAncestor, error2);
    }
  }
  function safelyAttachRef(current, nearestMountedAncestor) {
    try {
      var ref = current.ref;
      if (null !== ref) {
        switch (current.tag) {
          case 26:
          case 27:
          case 5:
            var instanceToUse = current.stateNode;
            break;
          case 30:
            instanceToUse = current.stateNode;
            break;
          default:
            instanceToUse = current.stateNode;
        }
        "function" === typeof ref ? current.refCleanup = ref(instanceToUse) : ref.current = instanceToUse;
      }
    } catch (error2) {
      captureCommitPhaseError(current, nearestMountedAncestor, error2);
    }
  }
  function safelyDetachRef(current, nearestMountedAncestor) {
    var ref = current.ref, refCleanup = current.refCleanup;
    if (null !== ref)
      if ("function" === typeof refCleanup)
        try {
          refCleanup();
        } catch (error2) {
          captureCommitPhaseError(current, nearestMountedAncestor, error2);
        } finally {
          current.refCleanup = null, current = current.alternate, null != current && (current.refCleanup = null);
        }
      else if ("function" === typeof ref)
        try {
          ref(null);
        } catch (error$140) {
          captureCommitPhaseError(current, nearestMountedAncestor, error$140);
        }
      else ref.current = null;
  }
  function commitHostMount(finishedWork) {
    var type = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
    try {
      a: switch (type) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          props.autoFocus && instance.focus();
          break a;
        case "img":
          props.src ? instance.src = props.src : props.srcSet && (instance.srcset = props.srcSet);
      }
    } catch (error2) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
    }
  }
  function commitHostUpdate(finishedWork, newProps, oldProps) {
    try {
      var domElement = finishedWork.stateNode;
      updateProperties(domElement, finishedWork.type, oldProps, newProps);
      domElement[internalPropsKey] = newProps;
    } catch (error2) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
    }
  }
  function isHostParent(fiber) {
    return 5 === fiber.tag || 3 === fiber.tag || 26 === fiber.tag || 27 === fiber.tag && isSingletonScope(fiber.type) || 4 === fiber.tag;
  }
  function getHostSibling(fiber) {
    a: for (; ; ) {
      for (; null === fiber.sibling; ) {
        if (null === fiber.return || isHostParent(fiber.return)) return null;
        fiber = fiber.return;
      }
      fiber.sibling.return = fiber.return;
      for (fiber = fiber.sibling; 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; ) {
        if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
        if (fiber.flags & 2) continue a;
        if (null === fiber.child || 4 === fiber.tag) continue a;
        else fiber.child.return = fiber, fiber = fiber.child;
      }
      if (!(fiber.flags & 2)) return fiber.stateNode;
    }
  }
  function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
    var tag = node.tag;
    if (5 === tag || 6 === tag)
      node = node.stateNode, before ? (9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent).insertBefore(node, before) : (before = 9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent, before.appendChild(node), parent = parent._reactRootContainer, null !== parent && void 0 !== parent || null !== before.onclick || (before.onclick = noop$1));
    else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode, before = null), node = node.child, null !== node))
      for (insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling; null !== node; )
        insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling;
  }
  function insertOrAppendPlacementNode(node, before, parent) {
    var tag = node.tag;
    if (5 === tag || 6 === tag)
      node = node.stateNode, before ? parent.insertBefore(node, before) : parent.appendChild(node);
    else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode), node = node.child, null !== node))
      for (insertOrAppendPlacementNode(node, before, parent), node = node.sibling; null !== node; )
        insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
  }
  function commitHostSingletonAcquisition(finishedWork) {
    var singleton = finishedWork.stateNode, props = finishedWork.memoizedProps;
    try {
      for (var type = finishedWork.type, attributes = singleton.attributes; attributes.length; )
        singleton.removeAttributeNode(attributes[0]);
      setInitialProperties(singleton, type, props);
      singleton[internalInstanceKey] = finishedWork;
      singleton[internalPropsKey] = props;
    } catch (error2) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
    }
  }
  var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null;
  function commitBeforeMutationEffects(root2, firstChild) {
    root2 = root2.containerInfo;
    eventsEnabled = _enabled;
    root2 = getActiveElementDeep(root2);
    if (hasSelectionCapabilities(root2)) {
      if ("selectionStart" in root2)
        var JSCompiler_temp = {
          start: root2.selectionStart,
          end: root2.selectionEnd
        };
      else
        a: {
          JSCompiler_temp = (JSCompiler_temp = root2.ownerDocument) && JSCompiler_temp.defaultView || window;
          var selection = JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
          if (selection && 0 !== selection.rangeCount) {
            JSCompiler_temp = selection.anchorNode;
            var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode;
            selection = selection.focusOffset;
            try {
              JSCompiler_temp.nodeType, focusNode.nodeType;
            } catch (e$20) {
              JSCompiler_temp = null;
              break a;
            }
            var length = 0, start2 = -1, end = -1, indexWithinAnchor = 0, indexWithinFocus = 0, node = root2, parentNode = null;
            b: for (; ; ) {
              for (var next; ; ) {
                node !== JSCompiler_temp || 0 !== anchorOffset && 3 !== node.nodeType || (start2 = length + anchorOffset);
                node !== focusNode || 0 !== selection && 3 !== node.nodeType || (end = length + selection);
                3 === node.nodeType && (length += node.nodeValue.length);
                if (null === (next = node.firstChild)) break;
                parentNode = node;
                node = next;
              }
              for (; ; ) {
                if (node === root2) break b;
                parentNode === JSCompiler_temp && ++indexWithinAnchor === anchorOffset && (start2 = length);
                parentNode === focusNode && ++indexWithinFocus === selection && (end = length);
                if (null !== (next = node.nextSibling)) break;
                node = parentNode;
                parentNode = node.parentNode;
              }
              node = next;
            }
            JSCompiler_temp = -1 === start2 || -1 === end ? null : { start: start2, end };
          } else JSCompiler_temp = null;
        }
      JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
    } else JSCompiler_temp = null;
    selectionInformation = { focusedElem: root2, selectionRange: JSCompiler_temp };
    _enabled = false;
    for (nextEffect = firstChild; null !== nextEffect; )
      if (firstChild = nextEffect, root2 = firstChild.child, 0 !== (firstChild.subtreeFlags & 1028) && null !== root2)
        root2.return = firstChild, nextEffect = root2;
      else
        for (; null !== nextEffect; ) {
          firstChild = nextEffect;
          focusNode = firstChild.alternate;
          root2 = firstChild.flags;
          switch (firstChild.tag) {
            case 0:
              if (0 !== (root2 & 4) && (root2 = firstChild.updateQueue, root2 = null !== root2 ? root2.events : null, null !== root2))
                for (JSCompiler_temp = 0; JSCompiler_temp < root2.length; JSCompiler_temp++)
                  anchorOffset = root2[JSCompiler_temp], anchorOffset.ref.impl = anchorOffset.nextImpl;
              break;
            case 11:
            case 15:
              break;
            case 1:
              if (0 !== (root2 & 1024) && null !== focusNode) {
                root2 = void 0;
                JSCompiler_temp = firstChild;
                anchorOffset = focusNode.memoizedProps;
                focusNode = focusNode.memoizedState;
                selection = JSCompiler_temp.stateNode;
                try {
                  var resolvedPrevProps = resolveClassComponentProps(
                    JSCompiler_temp.type,
                    anchorOffset
                  );
                  root2 = selection.getSnapshotBeforeUpdate(
                    resolvedPrevProps,
                    focusNode
                  );
                  selection.__reactInternalSnapshotBeforeUpdate = root2;
                } catch (error2) {
                  captureCommitPhaseError(
                    JSCompiler_temp,
                    JSCompiler_temp.return,
                    error2
                  );
                }
              }
              break;
            case 3:
              if (0 !== (root2 & 1024)) {
                if (root2 = firstChild.stateNode.containerInfo, JSCompiler_temp = root2.nodeType, 9 === JSCompiler_temp)
                  clearContainerSparingly(root2);
                else if (1 === JSCompiler_temp)
                  switch (root2.nodeName) {
                    case "HEAD":
                    case "HTML":
                    case "BODY":
                      clearContainerSparingly(root2);
                      break;
                    default:
                      root2.textContent = "";
                  }
              }
              break;
            case 5:
            case 26:
            case 27:
            case 6:
            case 4:
            case 17:
              break;
            default:
              if (0 !== (root2 & 1024)) throw Error(formatProdErrorMessage(163));
          }
          root2 = firstChild.sibling;
          if (null !== root2) {
            root2.return = firstChild.return;
            nextEffect = root2;
            break;
          }
          nextEffect = firstChild.return;
        }
  }
  function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
    var flags = finishedWork.flags;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 15:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        flags & 4 && commitHookEffectListMount(5, finishedWork);
        break;
      case 1:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        if (flags & 4)
          if (finishedRoot = finishedWork.stateNode, null === current)
            try {
              finishedRoot.componentDidMount();
            } catch (error2) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error2);
            }
          else {
            var prevProps = resolveClassComponentProps(
              finishedWork.type,
              current.memoizedProps
            );
            current = current.memoizedState;
            try {
              finishedRoot.componentDidUpdate(
                prevProps,
                current,
                finishedRoot.__reactInternalSnapshotBeforeUpdate
              );
            } catch (error$139) {
              captureCommitPhaseError(
                finishedWork,
                finishedWork.return,
                error$139
              );
            }
          }
        flags & 64 && commitClassCallbacks(finishedWork);
        flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
        break;
      case 3:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        if (flags & 64 && (finishedRoot = finishedWork.updateQueue, null !== finishedRoot)) {
          current = null;
          if (null !== finishedWork.child)
            switch (finishedWork.child.tag) {
              case 27:
              case 5:
                current = finishedWork.child.stateNode;
                break;
              case 1:
                current = finishedWork.child.stateNode;
            }
          try {
            commitCallbacks(finishedRoot, current);
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        }
        break;
      case 27:
        null === current && flags & 4 && commitHostSingletonAcquisition(finishedWork);
      case 26:
      case 5:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        null === current && flags & 4 && commitHostMount(finishedWork);
        flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
        break;
      case 12:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        break;
      case 31:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
        break;
      case 13:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
        flags & 64 && (finishedRoot = finishedWork.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot && (finishedWork = retryDehydratedSuspenseBoundary.bind(
          null,
          finishedWork
        ), registerSuspenseInstanceRetry(finishedRoot, finishedWork))));
        break;
      case 22:
        flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
        if (!flags) {
          current = null !== current && null !== current.memoizedState || offscreenSubtreeWasHidden;
          prevProps = offscreenSubtreeIsHidden;
          var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
          offscreenSubtreeIsHidden = flags;
          (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            0 !== (finishedWork.subtreeFlags & 8772)
          ) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          offscreenSubtreeIsHidden = prevProps;
          offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
        }
        break;
      case 30:
        break;
      default:
        recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
    }
  }
  function detachFiberAfterEffects(fiber) {
    var alternate = fiber.alternate;
    null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate));
    fiber.child = null;
    fiber.deletions = null;
    fiber.sibling = null;
    5 === fiber.tag && (alternate = fiber.stateNode, null !== alternate && detachDeletedInstance(alternate));
    fiber.stateNode = null;
    fiber.return = null;
    fiber.dependencies = null;
    fiber.memoizedProps = null;
    fiber.memoizedState = null;
    fiber.pendingProps = null;
    fiber.stateNode = null;
    fiber.updateQueue = null;
  }
  var hostParent = null, hostParentIsContainer = false;
  function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
    for (parent = parent.child; null !== parent; )
      commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling;
  }
  function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
    if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
      try {
        injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
      } catch (err) {
      }
    switch (deletedFiber.tag) {
      case 26:
        offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        deletedFiber.memoizedState ? deletedFiber.memoizedState.count-- : deletedFiber.stateNode && (deletedFiber = deletedFiber.stateNode, deletedFiber.parentNode.removeChild(deletedFiber));
        break;
      case 27:
        offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
        var prevHostParent = hostParent, prevHostParentIsContainer = hostParentIsContainer;
        isSingletonScope(deletedFiber.type) && (hostParent = deletedFiber.stateNode, hostParentIsContainer = false);
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        releaseSingletonInstance(deletedFiber.stateNode);
        hostParent = prevHostParent;
        hostParentIsContainer = prevHostParentIsContainer;
        break;
      case 5:
        offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
      case 6:
        prevHostParent = hostParent;
        prevHostParentIsContainer = hostParentIsContainer;
        hostParent = null;
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        hostParent = prevHostParent;
        hostParentIsContainer = prevHostParentIsContainer;
        if (null !== hostParent)
          if (hostParentIsContainer)
            try {
              (9 === hostParent.nodeType ? hostParent.body : "HTML" === hostParent.nodeName ? hostParent.ownerDocument.body : hostParent).removeChild(deletedFiber.stateNode);
            } catch (error2) {
              captureCommitPhaseError(
                deletedFiber,
                nearestMountedAncestor,
                error2
              );
            }
          else
            try {
              hostParent.removeChild(deletedFiber.stateNode);
            } catch (error2) {
              captureCommitPhaseError(
                deletedFiber,
                nearestMountedAncestor,
                error2
              );
            }
        break;
      case 18:
        null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, clearHydrationBoundary(
          9 === finishedRoot.nodeType ? finishedRoot.body : "HTML" === finishedRoot.nodeName ? finishedRoot.ownerDocument.body : finishedRoot,
          deletedFiber.stateNode
        ), retryIfBlockedOn(finishedRoot)) : clearHydrationBoundary(hostParent, deletedFiber.stateNode));
        break;
      case 4:
        prevHostParent = hostParent;
        prevHostParentIsContainer = hostParentIsContainer;
        hostParent = deletedFiber.stateNode.containerInfo;
        hostParentIsContainer = true;
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        hostParent = prevHostParent;
        hostParentIsContainer = prevHostParentIsContainer;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor);
        offscreenSubtreeWasHidden || commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor);
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        break;
      case 1:
        offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), prevHostParent = deletedFiber.stateNode, "function" === typeof prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount(
          deletedFiber,
          nearestMountedAncestor,
          prevHostParent
        ));
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        break;
      case 21:
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        break;
      case 22:
        offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState;
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
        offscreenSubtreeWasHidden = prevHostParent;
        break;
      default:
        recursivelyTraverseDeletionEffects(
          finishedRoot,
          nearestMountedAncestor,
          deletedFiber
        );
    }
  }
  function commitActivityHydrationCallbacks(finishedRoot, finishedWork) {
    if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot))) {
      finishedRoot = finishedRoot.dehydrated;
      try {
        retryIfBlockedOn(finishedRoot);
      } catch (error2) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
      }
    }
  }
  function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
    if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot))))
      try {
        retryIfBlockedOn(finishedRoot);
      } catch (error2) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
      }
  }
  function getRetryCache(finishedWork) {
    switch (finishedWork.tag) {
      case 31:
      case 13:
      case 19:
        var retryCache = finishedWork.stateNode;
        null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
        return retryCache;
      case 22:
        return finishedWork = finishedWork.stateNode, retryCache = finishedWork._retryCache, null === retryCache && (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), retryCache;
      default:
        throw Error(formatProdErrorMessage(435, finishedWork.tag));
    }
  }
  function attachSuspenseRetryListeners(finishedWork, wakeables) {
    var retryCache = getRetryCache(finishedWork);
    wakeables.forEach(function(wakeable) {
      if (!retryCache.has(wakeable)) {
        retryCache.add(wakeable);
        var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
        wakeable.then(retry, retry);
      }
    });
  }
  function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
    var deletions = parentFiber.deletions;
    if (null !== deletions)
      for (var i = 0; i < deletions.length; i++) {
        var childToDelete = deletions[i], root2 = root$jscomp$0, returnFiber = parentFiber, parent = returnFiber;
        a: for (; null !== parent; ) {
          switch (parent.tag) {
            case 27:
              if (isSingletonScope(parent.type)) {
                hostParent = parent.stateNode;
                hostParentIsContainer = false;
                break a;
              }
              break;
            case 5:
              hostParent = parent.stateNode;
              hostParentIsContainer = false;
              break a;
            case 3:
            case 4:
              hostParent = parent.stateNode.containerInfo;
              hostParentIsContainer = true;
              break a;
          }
          parent = parent.return;
        }
        if (null === hostParent) throw Error(formatProdErrorMessage(160));
        commitDeletionEffectsOnFiber(root2, returnFiber, childToDelete);
        hostParent = null;
        hostParentIsContainer = false;
        root2 = childToDelete.alternate;
        null !== root2 && (root2.return = null);
        childToDelete.return = null;
      }
    if (parentFiber.subtreeFlags & 13886)
      for (parentFiber = parentFiber.child; null !== parentFiber; )
        commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
  }
  var currentHoistableRoot = null;
  function commitMutationEffectsOnFiber(finishedWork, root2) {
    var current = finishedWork.alternate, flags = finishedWork.flags;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 4 && (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork), commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
        break;
      case 1:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
        flags & 64 && offscreenSubtreeIsHidden && (finishedWork = finishedWork.updateQueue, null !== finishedWork && (flags = finishedWork.callbacks, null !== flags && (current = finishedWork.shared.hiddenCallbacks, finishedWork.shared.hiddenCallbacks = null === current ? flags : current.concat(flags))));
        break;
      case 26:
        var hoistableRoot = currentHoistableRoot;
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
        if (flags & 4) {
          var currentResource = null !== current ? current.memoizedState : null;
          flags = finishedWork.memoizedState;
          if (null === current)
            if (null === flags)
              if (null === finishedWork.stateNode) {
                a: {
                  flags = finishedWork.type;
                  current = finishedWork.memoizedProps;
                  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
                  b: switch (flags) {
                    case "title":
                      currentResource = hoistableRoot.getElementsByTagName("title")[0];
                      if (!currentResource || currentResource[internalHoistableMarker] || currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === currentResource.namespaceURI || currentResource.hasAttribute("itemprop"))
                        currentResource = hoistableRoot.createElement(flags), hoistableRoot.head.insertBefore(
                          currentResource,
                          hoistableRoot.querySelector("head > title")
                        );
                      setInitialProperties(currentResource, flags, current);
                      currentResource[internalInstanceKey] = finishedWork;
                      markNodeAsHoistable(currentResource);
                      flags = currentResource;
                      break a;
                    case "link":
                      var maybeNodes = getHydratableHoistableCache(
                        "link",
                        "href",
                        hoistableRoot
                      ).get(flags + (current.href || ""));
                      if (maybeNodes) {
                        for (var i = 0; i < maybeNodes.length; i++)
                          if (currentResource = maybeNodes[i], currentResource.getAttribute("href") === (null == current.href || "" === current.href ? null : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === (null == current.title ? null : current.title) && currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) {
                            maybeNodes.splice(i, 1);
                            break b;
                          }
                      }
                      currentResource = hoistableRoot.createElement(flags);
                      setInitialProperties(currentResource, flags, current);
                      hoistableRoot.head.appendChild(currentResource);
                      break;
                    case "meta":
                      if (maybeNodes = getHydratableHoistableCache(
                        "meta",
                        "content",
                        hoistableRoot
                      ).get(flags + (current.content || ""))) {
                        for (i = 0; i < maybeNodes.length; i++)
                          if (currentResource = maybeNodes[i], currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && currentResource.getAttribute("name") === (null == current.name ? null : current.name) && currentResource.getAttribute("property") === (null == current.property ? null : current.property) && currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) {
                            maybeNodes.splice(i, 1);
                            break b;
                          }
                      }
                      currentResource = hoistableRoot.createElement(flags);
                      setInitialProperties(currentResource, flags, current);
                      hoistableRoot.head.appendChild(currentResource);
                      break;
                    default:
                      throw Error(formatProdErrorMessage(468, flags));
                  }
                  currentResource[internalInstanceKey] = finishedWork;
                  markNodeAsHoistable(currentResource);
                  flags = currentResource;
                }
                finishedWork.stateNode = flags;
              } else
                mountHoistable(
                  hoistableRoot,
                  finishedWork.type,
                  finishedWork.stateNode
                );
            else
              finishedWork.stateNode = acquireResource(
                hoistableRoot,
                flags,
                finishedWork.memoizedProps
              );
          else
            currentResource !== flags ? (null === currentResource ? null !== current.stateNode && (current = current.stateNode, current.parentNode.removeChild(current)) : currentResource.count--, null === flags ? mountHoistable(
              hoistableRoot,
              finishedWork.type,
              finishedWork.stateNode
            ) : acquireResource(
              hoistableRoot,
              flags,
              finishedWork.memoizedProps
            )) : null === flags && null !== finishedWork.stateNode && commitHostUpdate(
              finishedWork,
              finishedWork.memoizedProps,
              current.memoizedProps
            );
        }
        break;
      case 27:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
        null !== current && flags & 4 && commitHostUpdate(
          finishedWork,
          finishedWork.memoizedProps,
          current.memoizedProps
        );
        break;
      case 5:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
        if (finishedWork.flags & 32) {
          hoistableRoot = finishedWork.stateNode;
          try {
            setTextContent(hoistableRoot, "");
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        }
        flags & 4 && null != finishedWork.stateNode && (hoistableRoot = finishedWork.memoizedProps, commitHostUpdate(
          finishedWork,
          hoistableRoot,
          null !== current ? current.memoizedProps : hoistableRoot
        ));
        flags & 1024 && (needsFormReset = true);
        break;
      case 6:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        if (flags & 4) {
          if (null === finishedWork.stateNode)
            throw Error(formatProdErrorMessage(162));
          flags = finishedWork.memoizedProps;
          current = finishedWork.stateNode;
          try {
            current.nodeValue = flags;
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        }
        break;
      case 3:
        tagCaches = null;
        hoistableRoot = currentHoistableRoot;
        currentHoistableRoot = getHoistableRoot(root2.containerInfo);
        recursivelyTraverseMutationEffects(root2, finishedWork);
        currentHoistableRoot = hoistableRoot;
        commitReconciliationEffects(finishedWork);
        if (flags & 4 && null !== current && current.memoizedState.isDehydrated)
          try {
            retryIfBlockedOn(root2.containerInfo);
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        needsFormReset && (needsFormReset = false, recursivelyResetForms(finishedWork));
        break;
      case 4:
        flags = currentHoistableRoot;
        currentHoistableRoot = getHoistableRoot(
          finishedWork.stateNode.containerInfo
        );
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        currentHoistableRoot = flags;
        break;
      case 12:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        break;
      case 31:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
        break;
      case 13:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current && null !== current.memoizedState) && (globalMostRecentFallbackTime = now2());
        flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
        break;
      case 22:
        hoistableRoot = null !== finishedWork.memoizedState;
        var wasHidden = null !== current && null !== current.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
        offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
        offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
        recursivelyTraverseMutationEffects(root2, finishedWork);
        offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
        offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
        commitReconciliationEffects(finishedWork);
        if (flags & 8192)
          a: for (root2 = finishedWork.stateNode, root2._visibility = hoistableRoot ? root2._visibility & -2 : root2._visibility | 1, hoistableRoot && (null === current || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), current = null, root2 = finishedWork; ; ) {
            if (5 === root2.tag || 26 === root2.tag) {
              if (null === current) {
                wasHidden = current = root2;
                try {
                  if (currentResource = wasHidden.stateNode, hoistableRoot)
                    maybeNodes = currentResource.style, "function" === typeof maybeNodes.setProperty ? maybeNodes.setProperty("display", "none", "important") : maybeNodes.display = "none";
                  else {
                    i = wasHidden.stateNode;
                    var styleProp = wasHidden.memoizedProps.style, display = void 0 !== styleProp && null !== styleProp && styleProp.hasOwnProperty("display") ? styleProp.display : null;
                    i.style.display = null == display || "boolean" === typeof display ? "" : ("" + display).trim();
                  }
                } catch (error2) {
                  captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                }
              }
            } else if (6 === root2.tag) {
              if (null === current) {
                wasHidden = root2;
                try {
                  wasHidden.stateNode.nodeValue = hoistableRoot ? "" : wasHidden.memoizedProps;
                } catch (error2) {
                  captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                }
              }
            } else if (18 === root2.tag) {
              if (null === current) {
                wasHidden = root2;
                try {
                  var instance = wasHidden.stateNode;
                  hoistableRoot ? hideOrUnhideDehydratedBoundary(instance, true) : hideOrUnhideDehydratedBoundary(wasHidden.stateNode, false);
                } catch (error2) {
                  captureCommitPhaseError(wasHidden, wasHidden.return, error2);
                }
              }
            } else if ((22 !== root2.tag && 23 !== root2.tag || null === root2.memoizedState || root2 === finishedWork) && null !== root2.child) {
              root2.child.return = root2;
              root2 = root2.child;
              continue;
            }
            if (root2 === finishedWork) break a;
            for (; null === root2.sibling; ) {
              if (null === root2.return || root2.return === finishedWork) break a;
              current === root2 && (current = null);
              root2 = root2.return;
            }
            current === root2 && (current = null);
            root2.sibling.return = root2.return;
            root2 = root2.sibling;
          }
        flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current = flags.retryQueue, null !== current && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current))));
        break;
      case 19:
        recursivelyTraverseMutationEffects(root2, finishedWork);
        commitReconciliationEffects(finishedWork);
        flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
        break;
      case 30:
        break;
      case 21:
        break;
      default:
        recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork);
    }
  }
  function commitReconciliationEffects(finishedWork) {
    var flags = finishedWork.flags;
    if (flags & 2) {
      try {
        for (var hostParentFiber, parentFiber = finishedWork.return; null !== parentFiber; ) {
          if (isHostParent(parentFiber)) {
            hostParentFiber = parentFiber;
            break;
          }
          parentFiber = parentFiber.return;
        }
        if (null == hostParentFiber) throw Error(formatProdErrorMessage(160));
        switch (hostParentFiber.tag) {
          case 27:
            var parent = hostParentFiber.stateNode, before = getHostSibling(finishedWork);
            insertOrAppendPlacementNode(finishedWork, before, parent);
            break;
          case 5:
            var parent$141 = hostParentFiber.stateNode;
            hostParentFiber.flags & 32 && (setTextContent(parent$141, ""), hostParentFiber.flags &= -33);
            var before$142 = getHostSibling(finishedWork);
            insertOrAppendPlacementNode(finishedWork, before$142, parent$141);
            break;
          case 3:
          case 4:
            var parent$143 = hostParentFiber.stateNode.containerInfo, before$144 = getHostSibling(finishedWork);
            insertOrAppendPlacementNodeIntoContainer(
              finishedWork,
              before$144,
              parent$143
            );
            break;
          default:
            throw Error(formatProdErrorMessage(161));
        }
      } catch (error2) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
      }
      finishedWork.flags &= -3;
    }
    flags & 4096 && (finishedWork.flags &= -4097);
  }
  function recursivelyResetForms(parentFiber) {
    if (parentFiber.subtreeFlags & 1024)
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        var fiber = parentFiber;
        recursivelyResetForms(fiber);
        5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
        parentFiber = parentFiber.sibling;
      }
  }
  function recursivelyTraverseLayoutEffects(root2, parentFiber) {
    if (parentFiber.subtreeFlags & 8772)
      for (parentFiber = parentFiber.child; null !== parentFiber; )
        commitLayoutEffectOnFiber(root2, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
  }
  function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      var finishedWork = parentFiber;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          commitHookEffectListUnmount(4, finishedWork, finishedWork.return);
          recursivelyTraverseDisappearLayoutEffects(finishedWork);
          break;
        case 1:
          safelyDetachRef(finishedWork, finishedWork.return);
          var instance = finishedWork.stateNode;
          "function" === typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(
            finishedWork,
            finishedWork.return,
            instance
          );
          recursivelyTraverseDisappearLayoutEffects(finishedWork);
          break;
        case 27:
          releaseSingletonInstance(finishedWork.stateNode);
        case 26:
        case 5:
          safelyDetachRef(finishedWork, finishedWork.return);
          recursivelyTraverseDisappearLayoutEffects(finishedWork);
          break;
        case 22:
          null === finishedWork.memoizedState && recursivelyTraverseDisappearLayoutEffects(finishedWork);
          break;
        case 30:
          recursivelyTraverseDisappearLayoutEffects(finishedWork);
          break;
        default:
          recursivelyTraverseDisappearLayoutEffects(finishedWork);
      }
      parentFiber = parentFiber.sibling;
    }
  }
  function recursivelyTraverseReappearLayoutEffects(finishedRoot$jscomp$0, parentFiber, includeWorkInProgressEffects) {
    includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      var current = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 15:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          commitHookEffectListMount(4, finishedWork);
          break;
        case 1:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          current = finishedWork;
          finishedRoot = current.stateNode;
          if ("function" === typeof finishedRoot.componentDidMount)
            try {
              finishedRoot.componentDidMount();
            } catch (error2) {
              captureCommitPhaseError(current, current.return, error2);
            }
          current = finishedWork;
          finishedRoot = current.updateQueue;
          if (null !== finishedRoot) {
            var instance = current.stateNode;
            try {
              var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks;
              if (null !== hiddenCallbacks)
                for (finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; finishedRoot < hiddenCallbacks.length; finishedRoot++)
                  callCallback(hiddenCallbacks[finishedRoot], instance);
            } catch (error2) {
              captureCommitPhaseError(current, current.return, error2);
            }
          }
          includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork);
          safelyAttachRef(finishedWork, finishedWork.return);
          break;
        case 27:
          commitHostSingletonAcquisition(finishedWork);
        case 26:
        case 5:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          includeWorkInProgressEffects && null === current && flags & 4 && commitHostMount(finishedWork);
          safelyAttachRef(finishedWork, finishedWork.return);
          break;
        case 12:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          break;
        case 31:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          includeWorkInProgressEffects && flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
          break;
        case 13:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          includeWorkInProgressEffects && flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
          break;
        case 22:
          null === finishedWork.memoizedState && recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
          safelyAttachRef(finishedWork, finishedWork.return);
          break;
        case 30:
          break;
        default:
          recursivelyTraverseReappearLayoutEffects(
            finishedRoot,
            finishedWork,
            includeWorkInProgressEffects
          );
      }
      parentFiber = parentFiber.sibling;
    }
  }
  function commitOffscreenPassiveMountEffects(current, finishedWork) {
    var previousCache = null;
    null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && (previousCache = current.memoizedState.cachePool.pool);
    current = null;
    null !== finishedWork.memoizedState && null !== finishedWork.memoizedState.cachePool && (current = finishedWork.memoizedState.cachePool.pool);
    current !== previousCache && (null != current && current.refCount++, null != previousCache && releaseCache(previousCache));
  }
  function commitCachePassiveMountEffect(current, finishedWork) {
    current = null;
    null !== finishedWork.alternate && (current = finishedWork.alternate.memoizedState.cache);
    finishedWork = finishedWork.memoizedState.cache;
    finishedWork !== current && (finishedWork.refCount++, null != current && releaseCache(current));
  }
  function recursivelyTraversePassiveMountEffects(root2, parentFiber, committedLanes, committedTransitions) {
    if (parentFiber.subtreeFlags & 10256)
      for (parentFiber = parentFiber.child; null !== parentFiber; )
        commitPassiveMountOnFiber(
          root2,
          parentFiber,
          committedLanes,
          committedTransitions
        ), parentFiber = parentFiber.sibling;
  }
  function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
    var flags = finishedWork.flags;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 15:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        flags & 2048 && commitHookEffectListMount(9, finishedWork);
        break;
      case 1:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        break;
      case 3:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        flags & 2048 && (finishedRoot = null, null !== finishedWork.alternate && (finishedRoot = finishedWork.alternate.memoizedState.cache), finishedWork = finishedWork.memoizedState.cache, finishedWork !== finishedRoot && (finishedWork.refCount++, null != finishedRoot && releaseCache(finishedRoot)));
        break;
      case 12:
        if (flags & 2048) {
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          finishedRoot = finishedWork.stateNode;
          try {
            var _finishedWork$memoize2 = finishedWork.memoizedProps, id = _finishedWork$memoize2.id, onPostCommit = _finishedWork$memoize2.onPostCommit;
            "function" === typeof onPostCommit && onPostCommit(
              id,
              null === finishedWork.alternate ? "mount" : "update",
              finishedRoot.passiveEffectDuration,
              -0
            );
          } catch (error2) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error2);
          }
        } else
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
        break;
      case 31:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        break;
      case 13:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        break;
      case 23:
        break;
      case 22:
        _finishedWork$memoize2 = finishedWork.stateNode;
        id = finishedWork.alternate;
        null !== finishedWork.memoizedState ? _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        ) : (_finishedWork$memoize2._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          0 !== (finishedWork.subtreeFlags & 10256) || false
        ));
        flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork);
        break;
      case 24:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
        break;
      default:
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
    }
  }
  function recursivelyTraverseReconnectPassiveEffects(finishedRoot$jscomp$0, parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, includeWorkInProgressEffects) {
    includeWorkInProgressEffects = includeWorkInProgressEffects && (0 !== (parentFiber.subtreeFlags & 10256) || false);
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 15:
          recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            includeWorkInProgressEffects
          );
          commitHookEffectListMount(8, finishedWork);
          break;
        case 23:
          break;
        case 22:
          var instance = finishedWork.stateNode;
          null !== finishedWork.memoizedState ? instance._visibility & 2 ? recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            includeWorkInProgressEffects
          ) : recursivelyTraverseAtomicPassiveEffects(
            finishedRoot,
            finishedWork
          ) : (instance._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            includeWorkInProgressEffects
          ));
          includeWorkInProgressEffects && flags & 2048 && commitOffscreenPassiveMountEffects(
            finishedWork.alternate,
            finishedWork
          );
          break;
        case 24:
          recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            includeWorkInProgressEffects
          );
          includeWorkInProgressEffects && flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
          break;
        default:
          recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            includeWorkInProgressEffects
          );
      }
      parentFiber = parentFiber.sibling;
    }
  }
  function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0, parentFiber) {
    if (parentFiber.subtreeFlags & 10256)
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 22:
            recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
            flags & 2048 && commitOffscreenPassiveMountEffects(
              finishedWork.alternate,
              finishedWork
            );
            break;
          case 24:
            recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
            flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
            break;
          default:
            recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
        }
        parentFiber = parentFiber.sibling;
      }
  }
  var suspenseyCommitFlag = 8192;
  function recursivelyAccumulateSuspenseyCommit(parentFiber, committedLanes, suspendedState) {
    if (parentFiber.subtreeFlags & suspenseyCommitFlag)
      for (parentFiber = parentFiber.child; null !== parentFiber; )
        accumulateSuspenseyCommitOnFiber(
          parentFiber,
          committedLanes,
          suspendedState
        ), parentFiber = parentFiber.sibling;
  }
  function accumulateSuspenseyCommitOnFiber(fiber, committedLanes, suspendedState) {
    switch (fiber.tag) {
      case 26:
        recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        );
        fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState && suspendResource(
          suspendedState,
          currentHoistableRoot,
          fiber.memoizedState,
          fiber.memoizedProps
        );
        break;
      case 5:
        recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        );
        break;
      case 3:
      case 4:
        var previousHoistableRoot = currentHoistableRoot;
        currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo);
        recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        );
        currentHoistableRoot = previousHoistableRoot;
        break;
      case 22:
        null === fiber.memoizedState && (previousHoistableRoot = fiber.alternate, null !== previousHoistableRoot && null !== previousHoistableRoot.memoizedState ? (previousHoistableRoot = suspenseyCommitFlag, suspenseyCommitFlag = 16777216, recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        ), suspenseyCommitFlag = previousHoistableRoot) : recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        ));
        break;
      default:
        recursivelyAccumulateSuspenseyCommit(
          fiber,
          committedLanes,
          suspendedState
        );
    }
  }
  function detachAlternateSiblings(parentFiber) {
    var previousFiber = parentFiber.alternate;
    if (null !== previousFiber && (parentFiber = previousFiber.child, null !== parentFiber)) {
      previousFiber.child = null;
      do
        previousFiber = parentFiber.sibling, parentFiber.sibling = null, parentFiber = previousFiber;
      while (null !== parentFiber);
    }
  }
  function recursivelyTraversePassiveUnmountEffects(parentFiber) {
    var deletions = parentFiber.deletions;
    if (0 !== (parentFiber.flags & 16)) {
      if (null !== deletions)
        for (var i = 0; i < deletions.length; i++) {
          var childToDelete = deletions[i];
          nextEffect = childToDelete;
          commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
            childToDelete,
            parentFiber
          );
        }
      detachAlternateSiblings(parentFiber);
    }
    if (parentFiber.subtreeFlags & 10256)
      for (parentFiber = parentFiber.child; null !== parentFiber; )
        commitPassiveUnmountOnFiber(parentFiber), parentFiber = parentFiber.sibling;
  }
  function commitPassiveUnmountOnFiber(finishedWork) {
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 15:
        recursivelyTraversePassiveUnmountEffects(finishedWork);
        finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return);
        break;
      case 3:
        recursivelyTraversePassiveUnmountEffects(finishedWork);
        break;
      case 12:
        recursivelyTraversePassiveUnmountEffects(finishedWork);
        break;
      case 22:
        var instance = finishedWork.stateNode;
        null !== finishedWork.memoizedState && instance._visibility & 2 && (null === finishedWork.return || 13 !== finishedWork.return.tag) ? (instance._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork);
        break;
      default:
        recursivelyTraversePassiveUnmountEffects(finishedWork);
    }
  }
  function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
    var deletions = parentFiber.deletions;
    if (0 !== (parentFiber.flags & 16)) {
      if (null !== deletions)
        for (var i = 0; i < deletions.length; i++) {
          var childToDelete = deletions[i];
          nextEffect = childToDelete;
          commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
            childToDelete,
            parentFiber
          );
        }
      detachAlternateSiblings(parentFiber);
    }
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      deletions = parentFiber;
      switch (deletions.tag) {
        case 0:
        case 11:
        case 15:
          commitHookEffectListUnmount(8, deletions, deletions.return);
          recursivelyTraverseDisconnectPassiveEffects(deletions);
          break;
        case 22:
          i = deletions.stateNode;
          i._visibility & 2 && (i._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(deletions));
          break;
        default:
          recursivelyTraverseDisconnectPassiveEffects(deletions);
      }
      parentFiber = parentFiber.sibling;
    }
  }
  function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
    for (; null !== nextEffect; ) {
      var fiber = nextEffect;
      switch (fiber.tag) {
        case 0:
        case 11:
        case 15:
          commitHookEffectListUnmount(8, fiber, nearestMountedAncestor);
          break;
        case 23:
        case 22:
          if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
            var cache = fiber.memoizedState.cachePool.pool;
            null != cache && cache.refCount++;
          }
          break;
        case 24:
          releaseCache(fiber.memoizedState.cache);
      }
      cache = fiber.child;
      if (null !== cache) cache.return = fiber, nextEffect = cache;
      else
        a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
          cache = nextEffect;
          var sibling = cache.sibling, returnFiber = cache.return;
          detachFiberAfterEffects(cache);
          if (cache === fiber) {
            nextEffect = null;
            break a;
          }
          if (null !== sibling) {
            sibling.return = returnFiber;
            nextEffect = sibling;
            break a;
          }
          nextEffect = returnFiber;
        }
    }
  }
  var DefaultAsyncDispatcher = {
    getCacheForType: function(resourceType) {
      var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
      void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
      return cacheForType;
    },
    cacheSignal: function() {
      return readContext(CacheContext).controller.signal;
    }
  }, PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, globalMostRecentTransitionTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, nestedUpdateCount = 0, rootWithNestedUpdates = null;
  function requestUpdateLane() {
    return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes : null !== ReactSharedInternals.T ? requestTransitionLane() : resolveUpdatePriority();
  }
  function requestDeferredLane() {
    if (0 === workInProgressDeferredLane)
      if (0 === (workInProgressRootRenderLanes & 536870912) || isHydrating) {
        var lane = nextTransitionDeferredLane;
        nextTransitionDeferredLane <<= 1;
        0 === (nextTransitionDeferredLane & 3932160) && (nextTransitionDeferredLane = 262144);
        workInProgressDeferredLane = lane;
      } else workInProgressDeferredLane = 536870912;
    lane = suspenseHandlerStackCursor.current;
    null !== lane && (lane.flags |= 32);
    return workInProgressDeferredLane;
  }
  function scheduleUpdateOnFiber(root2, fiber, lane) {
    if (root2 === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
      prepareFreshStack(root2, 0), markRootSuspended(
        root2,
        workInProgressRootRenderLanes,
        workInProgressDeferredLane,
        false
      );
    markRootUpdated$1(root2, lane);
    if (0 === (executionContext & 2) || root2 !== workInProgressRoot)
      root2 === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
        root2,
        workInProgressRootRenderLanes,
        workInProgressDeferredLane,
        false
      )), ensureRootIsScheduled(root2);
  }
  function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
    if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
    var shouldTimeSlice = !forceSync && 0 === (lanes & 127) && 0 === (lanes & root$jscomp$0.expiredLanes) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice ? renderRootConcurrent(root$jscomp$0, lanes) : renderRootSync(root$jscomp$0, lanes, true), renderWasConcurrent = shouldTimeSlice;
    do {
      if (0 === exitStatus) {
        workInProgressRootIsPrerendering && !shouldTimeSlice && markRootSuspended(root$jscomp$0, lanes, 0, false);
        break;
      } else {
        forceSync = root$jscomp$0.current.alternate;
        if (renderWasConcurrent && !isRenderConsistentWithExternalStores(forceSync)) {
          exitStatus = renderRootSync(root$jscomp$0, lanes, false);
          renderWasConcurrent = false;
          continue;
        }
        if (2 === exitStatus) {
          renderWasConcurrent = lanes;
          if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
            var JSCompiler_inline_result = 0;
          else
            JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913, JSCompiler_inline_result = 0 !== JSCompiler_inline_result ? JSCompiler_inline_result : JSCompiler_inline_result & 536870912 ? 536870912 : 0;
          if (0 !== JSCompiler_inline_result) {
            lanes = JSCompiler_inline_result;
            a: {
              var root2 = root$jscomp$0;
              exitStatus = workInProgressRootConcurrentErrors;
              var wasRootDehydrated = root2.current.memoizedState.isDehydrated;
              wasRootDehydrated && (prepareFreshStack(root2, JSCompiler_inline_result).flags |= 256);
              JSCompiler_inline_result = renderRootSync(
                root2,
                JSCompiler_inline_result,
                false
              );
              if (2 !== JSCompiler_inline_result) {
                if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
                  root2.errorRecoveryDisabledLanes |= renderWasConcurrent;
                  workInProgressRootInterleavedUpdatedLanes |= renderWasConcurrent;
                  exitStatus = 4;
                  break a;
                }
                renderWasConcurrent = workInProgressRootRecoverableErrors;
                workInProgressRootRecoverableErrors = exitStatus;
                null !== renderWasConcurrent && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = renderWasConcurrent : workInProgressRootRecoverableErrors.push.apply(
                  workInProgressRootRecoverableErrors,
                  renderWasConcurrent
                ));
              }
              exitStatus = JSCompiler_inline_result;
            }
            renderWasConcurrent = false;
            if (2 !== exitStatus) continue;
          }
        }
        if (1 === exitStatus) {
          prepareFreshStack(root$jscomp$0, 0);
          markRootSuspended(root$jscomp$0, lanes, 0, true);
          break;
        }
        a: {
          shouldTimeSlice = root$jscomp$0;
          renderWasConcurrent = exitStatus;
          switch (renderWasConcurrent) {
            case 0:
            case 1:
              throw Error(formatProdErrorMessage(345));
            case 4:
              if ((lanes & 4194048) !== lanes) break;
            case 6:
              markRootSuspended(
                shouldTimeSlice,
                lanes,
                workInProgressDeferredLane,
                !workInProgressRootDidSkipSuspendedSiblings
              );
              break a;
            case 2:
              workInProgressRootRecoverableErrors = null;
              break;
            case 3:
            case 5:
              break;
            default:
              throw Error(formatProdErrorMessage(329));
          }
          if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now2(), 10 < exitStatus)) {
            markRootSuspended(
              shouldTimeSlice,
              lanes,
              workInProgressDeferredLane,
              !workInProgressRootDidSkipSuspendedSiblings
            );
            if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a;
            pendingEffectsLanes = lanes;
            shouldTimeSlice.timeoutHandle = scheduleTimeout(
              commitRootWhenReady.bind(
                null,
                shouldTimeSlice,
                forceSync,
                workInProgressRootRecoverableErrors,
                workInProgressTransitions,
                workInProgressRootDidIncludeRecursiveRenderUpdate,
                lanes,
                workInProgressDeferredLane,
                workInProgressRootInterleavedUpdatedLanes,
                workInProgressSuspendedRetryLanes,
                workInProgressRootDidSkipSuspendedSiblings,
                renderWasConcurrent,
                "Throttled",
                -0,
                0
              ),
              exitStatus
            );
            break a;
          }
          commitRootWhenReady(
            shouldTimeSlice,
            forceSync,
            workInProgressRootRecoverableErrors,
            workInProgressTransitions,
            workInProgressRootDidIncludeRecursiveRenderUpdate,
            lanes,
            workInProgressDeferredLane,
            workInProgressRootInterleavedUpdatedLanes,
            workInProgressSuspendedRetryLanes,
            workInProgressRootDidSkipSuspendedSiblings,
            renderWasConcurrent,
            null,
            -0,
            0
          );
        }
      }
      break;
    } while (1);
    ensureRootIsScheduled(root$jscomp$0);
  }
  function commitRootWhenReady(root2, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
    root2.timeoutHandle = -1;
    suspendedCommitReason = finishedWork.subtreeFlags;
    if (suspendedCommitReason & 8192 || 16785408 === (suspendedCommitReason & 16785408)) {
      suspendedCommitReason = {
        stylesheets: null,
        count: 0,
        imgCount: 0,
        imgBytes: 0,
        suspenseyImages: [],
        waitingForImages: true,
        waitingForViewTransition: false,
        unsuspend: noop$1
      };
      accumulateSuspenseyCommitOnFiber(
        finishedWork,
        lanes,
        suspendedCommitReason
      );
      var timeoutOffset = (lanes & 62914560) === lanes ? globalMostRecentFallbackTime - now2() : (lanes & 4194048) === lanes ? globalMostRecentTransitionTime - now2() : 0;
      timeoutOffset = waitForCommitToBeReady(
        suspendedCommitReason,
        timeoutOffset
      );
      if (null !== timeoutOffset) {
        pendingEffectsLanes = lanes;
        root2.cancelPendingCommit = timeoutOffset(
          commitRoot.bind(
            null,
            root2,
            finishedWork,
            lanes,
            recoverableErrors,
            transitions,
            didIncludeRenderPhaseUpdate,
            spawnedLane,
            updatedLanes,
            suspendedRetryLanes,
            exitStatus,
            suspendedCommitReason,
            null,
            completedRenderStartTime,
            completedRenderEndTime
          )
        );
        markRootSuspended(root2, lanes, spawnedLane, !didSkipSuspendedSiblings);
        return;
      }
    }
    commitRoot(
      root2,
      finishedWork,
      lanes,
      recoverableErrors,
      transitions,
      didIncludeRenderPhaseUpdate,
      spawnedLane,
      updatedLanes,
      suspendedRetryLanes
    );
  }
  function isRenderConsistentWithExternalStores(finishedWork) {
    for (var node = finishedWork; ; ) {
      var tag = node.tag;
      if ((0 === tag || 11 === tag || 15 === tag) && node.flags & 16384 && (tag = node.updateQueue, null !== tag && (tag = tag.stores, null !== tag)))
        for (var i = 0; i < tag.length; i++) {
          var check = tag[i], getSnapshot = check.getSnapshot;
          check = check.value;
          try {
            if (!objectIs(getSnapshot(), check)) return false;
          } catch (error2) {
            return false;
          }
        }
      tag = node.child;
      if (node.subtreeFlags & 16384 && null !== tag)
        tag.return = node, node = tag;
      else {
        if (node === finishedWork) break;
        for (; null === node.sibling; ) {
          if (null === node.return || node.return === finishedWork) return true;
          node = node.return;
        }
        node.sibling.return = node.return;
        node = node.sibling;
      }
    }
    return true;
  }
  function markRootSuspended(root2, suspendedLanes, spawnedLane, didAttemptEntireTree) {
    suspendedLanes &= ~workInProgressRootPingedLanes;
    suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
    root2.suspendedLanes |= suspendedLanes;
    root2.pingedLanes &= ~suspendedLanes;
    didAttemptEntireTree && (root2.warmLanes |= suspendedLanes);
    didAttemptEntireTree = root2.expirationTimes;
    for (var lanes = suspendedLanes; 0 < lanes; ) {
      var index$6 = 31 - clz32(lanes), lane = 1 << index$6;
      didAttemptEntireTree[index$6] = -1;
      lanes &= ~lane;
    }
    0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, suspendedLanes);
  }
  function flushSyncWork$1() {
    return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0), false) : true;
  }
  function resetWorkInProgressStack() {
    if (null !== workInProgress) {
      if (0 === workInProgressSuspendedReason)
        var interruptedWork = workInProgress.return;
      else
        interruptedWork = workInProgress, lastContextDependency = currentlyRenderingFiber$1 = null, resetHooksOnUnwind(interruptedWork), thenableState$1 = null, thenableIndexCounter$1 = 0, interruptedWork = workInProgress;
      for (; null !== interruptedWork; )
        unwindInterruptedWork(interruptedWork.alternate, interruptedWork), interruptedWork = interruptedWork.return;
      workInProgress = null;
    }
  }
  function prepareFreshStack(root2, lanes) {
    var timeoutHandle = root2.timeoutHandle;
    -1 !== timeoutHandle && (root2.timeoutHandle = -1, cancelTimeout2(timeoutHandle));
    timeoutHandle = root2.cancelPendingCommit;
    null !== timeoutHandle && (root2.cancelPendingCommit = null, timeoutHandle());
    pendingEffectsLanes = 0;
    resetWorkInProgressStack();
    workInProgressRoot = root2;
    workInProgress = timeoutHandle = createWorkInProgress(root2.current, null);
    workInProgressRootRenderLanes = lanes;
    workInProgressSuspendedReason = 0;
    workInProgressThrownValue = null;
    workInProgressRootDidSkipSuspendedSiblings = false;
    workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root2, lanes);
    workInProgressRootDidAttachPingListener = false;
    workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = workInProgressRootExitStatus = 0;
    workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
    workInProgressRootDidIncludeRecursiveRenderUpdate = false;
    0 !== (lanes & 8) && (lanes |= lanes & 32);
    var allEntangledLanes = root2.entangledLanes;
    if (0 !== allEntangledLanes)
      for (root2 = root2.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
        var index$4 = 31 - clz32(allEntangledLanes), lane = 1 << index$4;
        lanes |= root2[index$4];
        allEntangledLanes &= ~lane;
      }
    entangledRenderLanes = lanes;
    finishQueueingConcurrentUpdates();
    return timeoutHandle;
  }
  function handleThrow(root2, thrownValue) {
    currentlyRenderingFiber = null;
    ReactSharedInternals.H = ContextOnlyDispatcher;
    thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 3) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 4) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? 6 : 1;
    workInProgressThrownValue = thrownValue;
    null === workInProgress && (workInProgressRootExitStatus = 1, logUncaughtError(
      root2,
      createCapturedValueAtFiber(thrownValue, root2.current)
    ));
  }
  function shouldRemainOnPreviousScreen() {
    var handler = suspenseHandlerStackCursor.current;
    return null === handler ? true : (workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null === shellBoundary ? true : false : (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes || 0 !== (workInProgressRootRenderLanes & 536870912) ? handler === shellBoundary : false;
  }
  function pushDispatcher() {
    var prevDispatcher = ReactSharedInternals.H;
    ReactSharedInternals.H = ContextOnlyDispatcher;
    return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
  }
  function pushAsyncDispatcher() {
    var prevAsyncDispatcher = ReactSharedInternals.A;
    ReactSharedInternals.A = DefaultAsyncDispatcher;
    return prevAsyncDispatcher;
  }
  function renderDidSuspendDelayIfPossible() {
    workInProgressRootExitStatus = 4;
    workInProgressRootDidSkipSuspendedSiblings || (workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current || (workInProgressRootIsPrerendering = true);
    0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) || null === workInProgressRoot || markRootSuspended(
      workInProgressRoot,
      workInProgressRootRenderLanes,
      workInProgressDeferredLane,
      false
    );
  }
  function renderRootSync(root2, lanes, shouldYieldForPrerendering) {
    var prevExecutionContext = executionContext;
    executionContext |= 2;
    var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
    if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes)
      workInProgressTransitions = null, prepareFreshStack(root2, lanes);
    lanes = false;
    var exitStatus = workInProgressRootExitStatus;
    a: do
      try {
        if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
          var unitOfWork = workInProgress, thrownValue = workInProgressThrownValue;
          switch (workInProgressSuspendedReason) {
            case 8:
              resetWorkInProgressStack();
              exitStatus = 6;
              break a;
            case 3:
            case 2:
            case 9:
            case 6:
              null === suspenseHandlerStackCursor.current && (lanes = true);
              var reason = workInProgressSuspendedReason;
              workInProgressSuspendedReason = 0;
              workInProgressThrownValue = null;
              throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
              if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
                exitStatus = 0;
                break a;
              }
              break;
            default:
              reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
          }
        }
        workLoopSync();
        exitStatus = workInProgressRootExitStatus;
        break;
      } catch (thrownValue$165) {
        handleThrow(root2, thrownValue$165);
      }
    while (1);
    lanes && root2.shellSuspendCounter++;
    lastContextDependency = currentlyRenderingFiber$1 = null;
    executionContext = prevExecutionContext;
    ReactSharedInternals.H = prevDispatcher;
    ReactSharedInternals.A = prevAsyncDispatcher;
    null === workInProgress && (workInProgressRoot = null, workInProgressRootRenderLanes = 0, finishQueueingConcurrentUpdates());
    return exitStatus;
  }
  function workLoopSync() {
    for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
  }
  function renderRootConcurrent(root2, lanes) {
    var prevExecutionContext = executionContext;
    executionContext |= 2;
    var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
    workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now2() + 500, prepareFreshStack(root2, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
      root2,
      lanes
    );
    a: do
      try {
        if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
          lanes = workInProgress;
          var thrownValue = workInProgressThrownValue;
          b: switch (workInProgressSuspendedReason) {
            case 1:
              workInProgressSuspendedReason = 0;
              workInProgressThrownValue = null;
              throwAndUnwindWorkLoop(root2, lanes, thrownValue, 1);
              break;
            case 2:
            case 9:
              if (isThenableResolved(thrownValue)) {
                workInProgressSuspendedReason = 0;
                workInProgressThrownValue = null;
                replaySuspendedUnitOfWork(lanes);
                break;
              }
              lanes = function() {
                2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root2 || (workInProgressSuspendedReason = 7);
                ensureRootIsScheduled(root2);
              };
              thrownValue.then(lanes, lanes);
              break a;
            case 3:
              workInProgressSuspendedReason = 7;
              break a;
            case 4:
              workInProgressSuspendedReason = 5;
              break a;
            case 7:
              isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, lanes, thrownValue, 7));
              break;
            case 5:
              var resource = null;
              switch (workInProgress.tag) {
                case 26:
                  resource = workInProgress.memoizedState;
                case 5:
                case 27:
                  var hostFiber = workInProgress;
                  if (resource ? preloadResource(resource) : hostFiber.stateNode.complete) {
                    workInProgressSuspendedReason = 0;
                    workInProgressThrownValue = null;
                    var sibling = hostFiber.sibling;
                    if (null !== sibling) workInProgress = sibling;
                    else {
                      var returnFiber = hostFiber.return;
                      null !== returnFiber ? (workInProgress = returnFiber, completeUnitOfWork(returnFiber)) : workInProgress = null;
                    }
                    break b;
                  }
              }
              workInProgressSuspendedReason = 0;
              workInProgressThrownValue = null;
              throwAndUnwindWorkLoop(root2, lanes, thrownValue, 5);
              break;
            case 6:
              workInProgressSuspendedReason = 0;
              workInProgressThrownValue = null;
              throwAndUnwindWorkLoop(root2, lanes, thrownValue, 6);
              break;
            case 8:
              resetWorkInProgressStack();
              workInProgressRootExitStatus = 6;
              break a;
            default:
              throw Error(formatProdErrorMessage(462));
          }
        }
        workLoopConcurrentByScheduler();
        break;
      } catch (thrownValue$167) {
        handleThrow(root2, thrownValue$167);
      }
    while (1);
    lastContextDependency = currentlyRenderingFiber$1 = null;
    ReactSharedInternals.H = prevDispatcher;
    ReactSharedInternals.A = prevAsyncDispatcher;
    executionContext = prevExecutionContext;
    if (null !== workInProgress) return 0;
    workInProgressRoot = null;
    workInProgressRootRenderLanes = 0;
    finishQueueingConcurrentUpdates();
    return workInProgressRootExitStatus;
  }
  function workLoopConcurrentByScheduler() {
    for (; null !== workInProgress && !shouldYield(); )
      performUnitOfWork(workInProgress);
  }
  function performUnitOfWork(unitOfWork) {
    var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
    unitOfWork.memoizedProps = unitOfWork.pendingProps;
    null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
  }
  function replaySuspendedUnitOfWork(unitOfWork) {
    var next = unitOfWork;
    var current = next.alternate;
    switch (next.tag) {
      case 15:
      case 0:
        next = replayFunctionComponent(
          current,
          next,
          next.pendingProps,
          next.type,
          void 0,
          workInProgressRootRenderLanes
        );
        break;
      case 11:
        next = replayFunctionComponent(
          current,
          next,
          next.pendingProps,
          next.type.render,
          next.ref,
          workInProgressRootRenderLanes
        );
        break;
      case 5:
        resetHooksOnUnwind(next);
      default:
        unwindInterruptedWork(current, next), next = workInProgress = resetWorkInProgress(next, entangledRenderLanes), next = beginWork(current, next, entangledRenderLanes);
    }
    unitOfWork.memoizedProps = unitOfWork.pendingProps;
    null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
  }
  function throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, suspendedReason) {
    lastContextDependency = currentlyRenderingFiber$1 = null;
    resetHooksOnUnwind(unitOfWork);
    thenableState$1 = null;
    thenableIndexCounter$1 = 0;
    var returnFiber = unitOfWork.return;
    try {
      if (throwException(
        root2,
        returnFiber,
        unitOfWork,
        thrownValue,
        workInProgressRootRenderLanes
      )) {
        workInProgressRootExitStatus = 1;
        logUncaughtError(
          root2,
          createCapturedValueAtFiber(thrownValue, root2.current)
        );
        workInProgress = null;
        return;
      }
    } catch (error2) {
      if (null !== returnFiber) throw workInProgress = returnFiber, error2;
      workInProgressRootExitStatus = 1;
      logUncaughtError(
        root2,
        createCapturedValueAtFiber(thrownValue, root2.current)
      );
      workInProgress = null;
      return;
    }
    if (unitOfWork.flags & 32768) {
      if (isHydrating || 1 === suspendedReason) root2 = true;
      else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
        root2 = false;
      else if (workInProgressRootDidSkipSuspendedSiblings = root2 = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
        suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
      unwindUnitOfWork(unitOfWork, root2);
    } else completeUnitOfWork(unitOfWork);
  }
  function completeUnitOfWork(unitOfWork) {
    var completedWork = unitOfWork;
    do {
      if (0 !== (completedWork.flags & 32768)) {
        unwindUnitOfWork(
          completedWork,
          workInProgressRootDidSkipSuspendedSiblings
        );
        return;
      }
      unitOfWork = completedWork.return;
      var next = completeWork(
        completedWork.alternate,
        completedWork,
        entangledRenderLanes
      );
      if (null !== next) {
        workInProgress = next;
        return;
      }
      completedWork = completedWork.sibling;
      if (null !== completedWork) {
        workInProgress = completedWork;
        return;
      }
      workInProgress = completedWork = unitOfWork;
    } while (null !== completedWork);
    0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
  }
  function unwindUnitOfWork(unitOfWork, skipSiblings) {
    do {
      var next = unwindWork(unitOfWork.alternate, unitOfWork);
      if (null !== next) {
        next.flags &= 32767;
        workInProgress = next;
        return;
      }
      next = unitOfWork.return;
      null !== next && (next.flags |= 32768, next.subtreeFlags = 0, next.deletions = null);
      if (!skipSiblings && (unitOfWork = unitOfWork.sibling, null !== unitOfWork)) {
        workInProgress = unitOfWork;
        return;
      }
      workInProgress = unitOfWork = next;
    } while (null !== unitOfWork);
    workInProgressRootExitStatus = 6;
    workInProgress = null;
  }
  function commitRoot(root2, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
    root2.cancelPendingCommit = null;
    do
      flushPendingEffects();
    while (0 !== pendingEffectsStatus);
    if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
    if (null !== finishedWork) {
      if (finishedWork === root2.current) throw Error(formatProdErrorMessage(177));
      didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
      didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
      markRootFinished(
        root2,
        lanes,
        didIncludeRenderPhaseUpdate,
        spawnedLane,
        updatedLanes,
        suspendedRetryLanes
      );
      root2 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
      pendingFinishedWork = finishedWork;
      pendingEffectsRoot = root2;
      pendingEffectsLanes = lanes;
      pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
      pendingPassiveTransitions = transitions;
      pendingRecoverableErrors = recoverableErrors;
      0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root2.callbackNode = null, root2.callbackPriority = 0, scheduleCallback$1(NormalPriority$1, function() {
        flushPassiveEffects();
        return null;
      })) : (root2.callbackNode = null, root2.callbackPriority = 0);
      recoverableErrors = 0 !== (finishedWork.flags & 13878);
      if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
        recoverableErrors = ReactSharedInternals.T;
        ReactSharedInternals.T = null;
        transitions = ReactDOMSharedInternals.p;
        ReactDOMSharedInternals.p = 2;
        spawnedLane = executionContext;
        executionContext |= 4;
        try {
          commitBeforeMutationEffects(root2, finishedWork, lanes);
        } finally {
          executionContext = spawnedLane, ReactDOMSharedInternals.p = transitions, ReactSharedInternals.T = recoverableErrors;
        }
      }
      pendingEffectsStatus = 1;
      flushMutationEffects();
      flushLayoutEffects();
      flushSpawnedWork();
    }
  }
  function flushMutationEffects() {
    if (1 === pendingEffectsStatus) {
      pendingEffectsStatus = 0;
      var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
      if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
        rootMutationHasEffect = ReactSharedInternals.T;
        ReactSharedInternals.T = null;
        var previousPriority = ReactDOMSharedInternals.p;
        ReactDOMSharedInternals.p = 2;
        var prevExecutionContext = executionContext;
        executionContext |= 4;
        try {
          commitMutationEffectsOnFiber(finishedWork, root2);
          var priorSelectionInformation = selectionInformation, curFocusedElem = getActiveElementDeep(root2.containerInfo), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange;
          if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && containsNode(
            priorFocusedElem.ownerDocument.documentElement,
            priorFocusedElem
          )) {
            if (null !== priorSelectionRange && hasSelectionCapabilities(priorFocusedElem)) {
              var start2 = priorSelectionRange.start, end = priorSelectionRange.end;
              void 0 === end && (end = start2);
              if ("selectionStart" in priorFocusedElem)
                priorFocusedElem.selectionStart = start2, priorFocusedElem.selectionEnd = Math.min(
                  end,
                  priorFocusedElem.value.length
                );
              else {
                var doc = priorFocusedElem.ownerDocument || document, win = doc && doc.defaultView || window;
                if (win.getSelection) {
                  var selection = win.getSelection(), length = priorFocusedElem.textContent.length, start$jscomp$0 = Math.min(priorSelectionRange.start, length), end$jscomp$0 = void 0 === priorSelectionRange.end ? start$jscomp$0 : Math.min(priorSelectionRange.end, length);
                  !selection.extend && start$jscomp$0 > end$jscomp$0 && (curFocusedElem = end$jscomp$0, end$jscomp$0 = start$jscomp$0, start$jscomp$0 = curFocusedElem);
                  var startMarker = getNodeForCharacterOffset(
                    priorFocusedElem,
                    start$jscomp$0
                  ), endMarker = getNodeForCharacterOffset(
                    priorFocusedElem,
                    end$jscomp$0
                  );
                  if (startMarker && endMarker && (1 !== selection.rangeCount || selection.anchorNode !== startMarker.node || selection.anchorOffset !== startMarker.offset || selection.focusNode !== endMarker.node || selection.focusOffset !== endMarker.offset)) {
                    var range = doc.createRange();
                    range.setStart(startMarker.node, startMarker.offset);
                    selection.removeAllRanges();
                    start$jscomp$0 > end$jscomp$0 ? (selection.addRange(range), selection.extend(endMarker.node, endMarker.offset)) : (range.setEnd(endMarker.node, endMarker.offset), selection.addRange(range));
                  }
                }
              }
            }
            doc = [];
            for (selection = priorFocusedElem; selection = selection.parentNode; )
              1 === selection.nodeType && doc.push({
                element: selection,
                left: selection.scrollLeft,
                top: selection.scrollTop
              });
            "function" === typeof priorFocusedElem.focus && priorFocusedElem.focus();
            for (priorFocusedElem = 0; priorFocusedElem < doc.length; priorFocusedElem++) {
              var info = doc[priorFocusedElem];
              info.element.scrollLeft = info.left;
              info.element.scrollTop = info.top;
            }
          }
          _enabled = !!eventsEnabled;
          selectionInformation = eventsEnabled = null;
        } finally {
          executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootMutationHasEffect;
        }
      }
      root2.current = finishedWork;
      pendingEffectsStatus = 2;
    }
  }
  function flushLayoutEffects() {
    if (2 === pendingEffectsStatus) {
      pendingEffectsStatus = 0;
      var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
      if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
        rootHasLayoutEffect = ReactSharedInternals.T;
        ReactSharedInternals.T = null;
        var previousPriority = ReactDOMSharedInternals.p;
        ReactDOMSharedInternals.p = 2;
        var prevExecutionContext = executionContext;
        executionContext |= 4;
        try {
          commitLayoutEffectOnFiber(root2, finishedWork.alternate, finishedWork);
        } finally {
          executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootHasLayoutEffect;
        }
      }
      pendingEffectsStatus = 3;
    }
  }
  function flushSpawnedWork() {
    if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
      pendingEffectsStatus = 0;
      requestPaint();
      var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
      0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root2, root2.pendingLanes));
      var remainingLanes = root2.pendingLanes;
      0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
      lanesToEventPriority(lanes);
      finishedWork = finishedWork.stateNode;
      if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
        try {
          injectedHook.onCommitFiberRoot(
            rendererID,
            finishedWork,
            void 0,
            128 === (finishedWork.current.flags & 128)
          );
        } catch (err) {
        }
      if (null !== recoverableErrors) {
        finishedWork = ReactSharedInternals.T;
        remainingLanes = ReactDOMSharedInternals.p;
        ReactDOMSharedInternals.p = 2;
        ReactSharedInternals.T = null;
        try {
          for (var onRecoverableError = root2.onRecoverableError, i = 0; i < recoverableErrors.length; i++) {
            var recoverableError = recoverableErrors[i];
            onRecoverableError(recoverableError.value, {
              componentStack: recoverableError.stack
            });
          }
        } finally {
          ReactSharedInternals.T = finishedWork, ReactDOMSharedInternals.p = remainingLanes;
        }
      }
      0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
      ensureRootIsScheduled(root2);
      remainingLanes = root2.pendingLanes;
      0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) ? root2 === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root2) : nestedUpdateCount = 0;
      flushSyncWorkAcrossRoots_impl(0);
    }
  }
  function releaseRootPooledCache(root2, remainingLanes) {
    0 === (root2.pooledCacheLanes &= remainingLanes) && (remainingLanes = root2.pooledCache, null != remainingLanes && (root2.pooledCache = null, releaseCache(remainingLanes)));
  }
  function flushPendingEffects() {
    flushMutationEffects();
    flushLayoutEffects();
    flushSpawnedWork();
    return flushPassiveEffects();
  }
  function flushPassiveEffects() {
    if (5 !== pendingEffectsStatus) return false;
    var root2 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
    pendingEffectsRemainingLanes = 0;
    var renderPriority = lanesToEventPriority(pendingEffectsLanes), prevTransition = ReactSharedInternals.T, previousPriority = ReactDOMSharedInternals.p;
    try {
      ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority;
      ReactSharedInternals.T = null;
      renderPriority = pendingPassiveTransitions;
      pendingPassiveTransitions = null;
      var root$jscomp$0 = pendingEffectsRoot, lanes = pendingEffectsLanes;
      pendingEffectsStatus = 0;
      pendingFinishedWork = pendingEffectsRoot = null;
      pendingEffectsLanes = 0;
      if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331));
      var prevExecutionContext = executionContext;
      executionContext |= 4;
      commitPassiveUnmountOnFiber(root$jscomp$0.current);
      commitPassiveMountOnFiber(
        root$jscomp$0,
        root$jscomp$0.current,
        lanes,
        renderPriority
      );
      executionContext = prevExecutionContext;
      flushSyncWorkAcrossRoots_impl(0, false);
      if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot)
        try {
          injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0);
        } catch (err) {
        }
      return true;
    } finally {
      ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition, releaseRootPooledCache(root2, remainingLanes);
    }
  }
  function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
    sourceFiber = createCapturedValueAtFiber(error2, sourceFiber);
    sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
    rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
    null !== rootFiber && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
  }
  function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error2) {
    if (3 === sourceFiber.tag)
      captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
    else
      for (; null !== nearestMountedAncestor; ) {
        if (3 === nearestMountedAncestor.tag) {
          captureCommitPhaseErrorOnRoot(
            nearestMountedAncestor,
            sourceFiber,
            error2
          );
          break;
        } else if (1 === nearestMountedAncestor.tag) {
          var instance = nearestMountedAncestor.stateNode;
          if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) {
            sourceFiber = createCapturedValueAtFiber(error2, sourceFiber);
            error2 = createClassErrorUpdate(2);
            instance = enqueueUpdate(nearestMountedAncestor, error2, 2);
            null !== instance && (initializeClassErrorUpdate(
              error2,
              instance,
              nearestMountedAncestor,
              sourceFiber
            ), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance));
            break;
          }
        }
        nearestMountedAncestor = nearestMountedAncestor.return;
      }
  }
  function attachPingListener(root2, wakeable, lanes) {
    var pingCache = root2.pingCache;
    if (null === pingCache) {
      pingCache = root2.pingCache = new PossiblyWeakMap();
      var threadIDs = /* @__PURE__ */ new Set();
      pingCache.set(wakeable, threadIDs);
    } else
      threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
    threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root2 = pingSuspendedRoot.bind(null, root2, wakeable, lanes), wakeable.then(root2, root2));
  }
  function pingSuspendedRoot(root2, wakeable, pingedLanes) {
    var pingCache = root2.pingCache;
    null !== pingCache && pingCache.delete(wakeable);
    root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
    root2.warmLanes &= ~pingedLanes;
    workInProgressRoot === root2 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now2() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root2, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
    ensureRootIsScheduled(root2);
  }
  function retryTimedOutBoundary(boundaryFiber, retryLane) {
    0 === retryLane && (retryLane = claimNextRetryLane());
    boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
    null !== boundaryFiber && (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber));
  }
  function retryDehydratedSuspenseBoundary(boundaryFiber) {
    var suspenseState = boundaryFiber.memoizedState, retryLane = 0;
    null !== suspenseState && (retryLane = suspenseState.retryLane);
    retryTimedOutBoundary(boundaryFiber, retryLane);
  }
  function resolveRetryWakeable(boundaryFiber, wakeable) {
    var retryLane = 0;
    switch (boundaryFiber.tag) {
      case 31:
      case 13:
        var retryCache = boundaryFiber.stateNode;
        var suspenseState = boundaryFiber.memoizedState;
        null !== suspenseState && (retryLane = suspenseState.retryLane);
        break;
      case 19:
        retryCache = boundaryFiber.stateNode;
        break;
      case 22:
        retryCache = boundaryFiber.stateNode._retryCache;
        break;
      default:
        throw Error(formatProdErrorMessage(314));
    }
    null !== retryCache && retryCache.delete(wakeable);
    retryTimedOutBoundary(boundaryFiber, retryLane);
  }
  function scheduleCallback$1(priorityLevel, callback) {
    return scheduleCallback$3(priorityLevel, callback);
  }
  var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0;
  function ensureRootIsScheduled(root2) {
    root2 !== lastScheduledRoot && null === root2.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root2 : lastScheduledRoot = lastScheduledRoot.next = root2);
    mightHavePendingSyncWork = true;
    didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
  }
  function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
    if (!isFlushingWork && mightHavePendingSyncWork) {
      isFlushingWork = true;
      do {
        var didPerformSomeWork = false;
        for (var root$170 = firstScheduledRoot; null !== root$170; ) {
          if (0 !== syncTransitionLanes) {
            var pendingLanes = root$170.pendingLanes;
            if (0 === pendingLanes) var JSCompiler_inline_result = 0;
            else {
              var suspendedLanes = root$170.suspendedLanes, pingedLanes = root$170.pingedLanes;
              JSCompiler_inline_result = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
              JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
              JSCompiler_inline_result = JSCompiler_inline_result & 201326741 ? JSCompiler_inline_result & 201326741 | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0;
            }
            0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
          } else
            JSCompiler_inline_result = workInProgressRootRenderLanes, JSCompiler_inline_result = getNextLanes(
              root$170,
              root$170 === workInProgressRoot ? JSCompiler_inline_result : 0,
              null !== root$170.cancelPendingCommit || -1 !== root$170.timeoutHandle
            ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root$170, JSCompiler_inline_result));
          root$170 = root$170.next;
        }
      } while (didPerformSomeWork);
      isFlushingWork = false;
    }
  }
  function processRootScheduleInImmediateTask() {
    processRootScheduleInMicrotask();
  }
  function processRootScheduleInMicrotask() {
    mightHavePendingSyncWork = didScheduleMicrotask = false;
    var syncTransitionLanes = 0;
    0 !== currentEventTransitionLane && shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane);
    for (var currentTime = now2(), prev = null, root2 = firstScheduledRoot; null !== root2; ) {
      var next = root2.next, nextLanes = scheduleTaskForRootDuringMicrotask(root2, currentTime);
      if (0 === nextLanes)
        root2.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
      else if (prev = root2, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
        mightHavePendingSyncWork = true;
      root2 = next;
    }
    0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus || flushSyncWorkAcrossRoots_impl(syncTransitionLanes);
    0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
  }
  function scheduleTaskForRootDuringMicrotask(root2, currentTime) {
    for (var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes, expirationTimes = root2.expirationTimes, lanes = root2.pendingLanes & -62914561; 0 < lanes; ) {
      var index$5 = 31 - clz32(lanes), lane = 1 << index$5, expirationTime = expirationTimes[index$5];
      if (-1 === expirationTime) {
        if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
          expirationTimes[index$5] = computeExpirationTime(lane, currentTime);
      } else expirationTime <= currentTime && (root2.expiredLanes |= lane);
      lanes &= ~lane;
    }
    currentTime = workInProgressRoot;
    suspendedLanes = workInProgressRootRenderLanes;
    suspendedLanes = getNextLanes(
      root2,
      root2 === currentTime ? suspendedLanes : 0,
      null !== root2.cancelPendingCommit || -1 !== root2.timeoutHandle
    );
    pingedLanes = root2.callbackNode;
    if (0 === suspendedLanes || root2 === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
      return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root2.callbackNode = null, root2.callbackPriority = 0;
    if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root2, suspendedLanes)) {
      currentTime = suspendedLanes & -suspendedLanes;
      if (currentTime === root2.callbackPriority) return currentTime;
      null !== pingedLanes && cancelCallback$1(pingedLanes);
      switch (lanesToEventPriority(suspendedLanes)) {
        case 2:
        case 8:
          suspendedLanes = UserBlockingPriority;
          break;
        case 32:
          suspendedLanes = NormalPriority$1;
          break;
        case 268435456:
          suspendedLanes = IdlePriority;
          break;
        default:
          suspendedLanes = NormalPriority$1;
      }
      pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root2);
      suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
      root2.callbackPriority = currentTime;
      root2.callbackNode = suspendedLanes;
      return currentTime;
    }
    null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
    root2.callbackPriority = 2;
    root2.callbackNode = null;
    return 2;
  }
  function performWorkOnRootViaSchedulerTask(root2, didTimeout) {
    if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
      return root2.callbackNode = null, root2.callbackPriority = 0, null;
    var originalCallbackNode = root2.callbackNode;
    if (flushPendingEffects() && root2.callbackNode !== originalCallbackNode)
      return null;
    var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
    workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
      root2,
      root2 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
      null !== root2.cancelPendingCommit || -1 !== root2.timeoutHandle
    );
    if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
    performWorkOnRoot(root2, workInProgressRootRenderLanes$jscomp$0, didTimeout);
    scheduleTaskForRootDuringMicrotask(root2, now2());
    return null != root2.callbackNode && root2.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root2) : null;
  }
  function performSyncWorkOnRoot(root2, lanes) {
    if (flushPendingEffects()) return null;
    performWorkOnRoot(root2, lanes, true);
  }
  function scheduleImmediateRootScheduleTask() {
    scheduleMicrotask(function() {
      0 !== (executionContext & 6) ? scheduleCallback$3(
        ImmediatePriority,
        processRootScheduleInImmediateTask
      ) : processRootScheduleInMicrotask();
    });
  }
  function requestTransitionLane() {
    if (0 === currentEventTransitionLane) {
      var actionScopeLane = currentEntangledLane;
      0 === actionScopeLane && (actionScopeLane = nextTransitionUpdateLane, nextTransitionUpdateLane <<= 1, 0 === (nextTransitionUpdateLane & 261888) && (nextTransitionUpdateLane = 256));
      currentEventTransitionLane = actionScopeLane;
    }
    return currentEventTransitionLane;
  }
  function coerceFormActionProp(actionProp) {
    return null == actionProp || "symbol" === typeof actionProp || "boolean" === typeof actionProp ? null : "function" === typeof actionProp ? actionProp : sanitizeURL("" + actionProp);
  }
  function createFormDataWithSubmitter(form, submitter) {
    var temp = submitter.ownerDocument.createElement("input");
    temp.name = submitter.name;
    temp.value = submitter.value;
    form.id && temp.setAttribute("form", form.id);
    submitter.parentNode.insertBefore(temp, submitter);
    form = new FormData(form);
    temp.parentNode.removeChild(temp);
    return form;
  }
  function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEvent, nativeEventTarget) {
    if ("submit" === domEventName && maybeTargetInst && maybeTargetInst.stateNode === nativeEventTarget) {
      var action = coerceFormActionProp(
        (nativeEventTarget[internalPropsKey] || null).action
      ), submitter = nativeEvent.submitter;
      submitter && (domEventName = (domEventName = submitter[internalPropsKey] || null) ? coerceFormActionProp(domEventName.formAction) : submitter.getAttribute("formAction"), null !== domEventName && (action = domEventName, submitter = null));
      var event = new SyntheticEvent(
        "action",
        "action",
        null,
        nativeEvent,
        nativeEventTarget
      );
      dispatchQueue.push({
        event,
        listeners: [
          {
            instance: null,
            listener: function() {
              if (nativeEvent.defaultPrevented) {
                if (0 !== currentEventTransitionLane) {
                  var formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget);
                  startHostTransition(
                    maybeTargetInst,
                    {
                      pending: true,
                      data: formData,
                      method: nativeEventTarget.method,
                      action
                    },
                    null,
                    formData
                  );
                }
              } else
                "function" === typeof action && (event.preventDefault(), formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget), startHostTransition(
                  maybeTargetInst,
                  {
                    pending: true,
                    data: formData,
                    method: nativeEventTarget.method,
                    action
                  },
                  action,
                  formData
                ));
            },
            currentTarget: nativeEventTarget
          }
        ]
      });
    }
  }
  for (var i$jscomp$inline_1577 = 0; i$jscomp$inline_1577 < simpleEventPluginEvents.length; i$jscomp$inline_1577++) {
    var eventName$jscomp$inline_1578 = simpleEventPluginEvents[i$jscomp$inline_1577], domEventName$jscomp$inline_1579 = eventName$jscomp$inline_1578.toLowerCase(), capitalizedEvent$jscomp$inline_1580 = eventName$jscomp$inline_1578[0].toUpperCase() + eventName$jscomp$inline_1578.slice(1);
    registerSimpleEvent(
      domEventName$jscomp$inline_1579,
      "on" + capitalizedEvent$jscomp$inline_1580
    );
  }
  registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
  registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
  registerSimpleEvent(ANIMATION_START, "onAnimationStart");
  registerSimpleEvent("dblclick", "onDoubleClick");
  registerSimpleEvent("focusin", "onFocus");
  registerSimpleEvent("focusout", "onBlur");
  registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
  registerSimpleEvent(TRANSITION_START, "onTransitionStart");
  registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
  registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
  registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
  registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
  registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
  registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
  registerTwoPhaseEvent(
    "onChange",
    "change click focusin focusout input keydown keyup selectionchange".split(" ")
  );
  registerTwoPhaseEvent(
    "onSelect",
    "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
      " "
    )
  );
  registerTwoPhaseEvent("onBeforeInput", [
    "compositionend",
    "keypress",
    "textInput",
    "paste"
  ]);
  registerTwoPhaseEvent(
    "onCompositionEnd",
    "compositionend focusout keydown keypress keyup mousedown".split(" ")
  );
  registerTwoPhaseEvent(
    "onCompositionStart",
    "compositionstart focusout keydown keypress keyup mousedown".split(" ")
  );
  registerTwoPhaseEvent(
    "onCompositionUpdate",
    "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
  );
  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".split(
    " "
  ), nonDelegatedEvents = new Set(
    "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes)
  );
  function processDispatchQueue(dispatchQueue, eventSystemFlags) {
    eventSystemFlags = 0 !== (eventSystemFlags & 4);
    for (var i = 0; i < dispatchQueue.length; i++) {
      var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event;
      _dispatchQueue$i = _dispatchQueue$i.listeners;
      a: {
        var previousInstance = void 0;
        if (eventSystemFlags)
          for (var i$jscomp$0 = _dispatchQueue$i.length - 1; 0 <= i$jscomp$0; i$jscomp$0--) {
            var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget;
            _dispatchListeners$i = _dispatchListeners$i.listener;
            if (instance !== previousInstance && event.isPropagationStopped())
              break a;
            previousInstance = _dispatchListeners$i;
            event.currentTarget = currentTarget;
            try {
              previousInstance(event);
            } catch (error2) {
              reportGlobalError(error2);
            }
            event.currentTarget = null;
            previousInstance = instance;
          }
        else
          for (i$jscomp$0 = 0; i$jscomp$0 < _dispatchQueue$i.length; i$jscomp$0++) {
            _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
            instance = _dispatchListeners$i.instance;
            currentTarget = _dispatchListeners$i.currentTarget;
            _dispatchListeners$i = _dispatchListeners$i.listener;
            if (instance !== previousInstance && event.isPropagationStopped())
              break a;
            previousInstance = _dispatchListeners$i;
            event.currentTarget = currentTarget;
            try {
              previousInstance(event);
            } catch (error2) {
              reportGlobalError(error2);
            }
            event.currentTarget = null;
            previousInstance = instance;
          }
      }
    }
  }
  function listenToNonDelegatedEvent(domEventName, targetElement) {
    var JSCompiler_inline_result = targetElement[internalEventHandlersKey];
    void 0 === JSCompiler_inline_result && (JSCompiler_inline_result = targetElement[internalEventHandlersKey] = /* @__PURE__ */ new Set());
    var listenerSetKey = domEventName + "__bubble";
    JSCompiler_inline_result.has(listenerSetKey) || (addTrappedEventListener(targetElement, domEventName, 2, false), JSCompiler_inline_result.add(listenerSetKey));
  }
  function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
    var eventSystemFlags = 0;
    isCapturePhaseListener && (eventSystemFlags |= 4);
    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) {
        "selectionchange" !== domEventName && (nonDelegatedEvents.has(domEventName) || listenToNativeEvent(domEventName, false, rootContainerElement), listenToNativeEvent(domEventName, true, rootContainerElement));
      });
      var ownerDocument = 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
      null === ownerDocument || ownerDocument[listeningMarker] || (ownerDocument[listeningMarker] = true, listenToNativeEvent("selectionchange", false, ownerDocument));
    }
  }
  function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener) {
    switch (getEventPriority(domEventName)) {
      case 2:
        var listenerWrapper = dispatchDiscreteEvent;
        break;
      case 8:
        listenerWrapper = dispatchContinuousEvent;
        break;
      default:
        listenerWrapper = dispatchEvent;
    }
    eventSystemFlags = listenerWrapper.bind(
      null,
      domEventName,
      eventSystemFlags,
      targetContainer
    );
    listenerWrapper = void 0;
    !passiveBrowserEventsSupported || "touchstart" !== domEventName && "touchmove" !== domEventName && "wheel" !== domEventName || (listenerWrapper = true);
    isCapturePhaseListener ? void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
      capture: true,
      passive: listenerWrapper
    }) : targetContainer.addEventListener(domEventName, eventSystemFlags, true) : void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
      passive: listenerWrapper
    }) : targetContainer.addEventListener(domEventName, eventSystemFlags, false);
  }
  function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst$jscomp$0, targetContainer) {
    var ancestorInst = targetInst$jscomp$0;
    if (0 === (eventSystemFlags & 1) && 0 === (eventSystemFlags & 2) && null !== targetInst$jscomp$0)
      a: for (; ; ) {
        if (null === targetInst$jscomp$0) return;
        var nodeTag = targetInst$jscomp$0.tag;
        if (3 === nodeTag || 4 === nodeTag) {
          var container2 = targetInst$jscomp$0.stateNode.containerInfo;
          if (container2 === targetContainer) break;
          if (4 === nodeTag)
            for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
              var grandTag = nodeTag.tag;
              if ((3 === grandTag || 4 === grandTag) && nodeTag.stateNode.containerInfo === targetContainer)
                return;
              nodeTag = nodeTag.return;
            }
          for (; null !== container2; ) {
            nodeTag = getClosestInstanceFromNode(container2);
            if (null === nodeTag) return;
            grandTag = nodeTag.tag;
            if (5 === grandTag || 6 === grandTag || 26 === grandTag || 27 === grandTag) {
              targetInst$jscomp$0 = ancestorInst = nodeTag;
              continue a;
            }
            container2 = container2.parentNode;
          }
        }
        targetInst$jscomp$0 = targetInst$jscomp$0.return;
      }
    batchedUpdates$1(function() {
      var targetInst = ancestorInst, nativeEventTarget = getEventTarget(nativeEvent), dispatchQueue = [];
      a: {
        var reactName = topLevelEventsToReactNames.get(domEventName);
        if (void 0 !== reactName) {
          var SyntheticEventCtor = SyntheticEvent, reactEventType = domEventName;
          switch (domEventName) {
            case "keypress":
              if (0 === getEventCharCode(nativeEvent)) break a;
            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 (2 === nativeEvent.button) break a;
            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":
            case "scrollend":
              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;
            case "toggle":
            case "beforetoggle":
              SyntheticEventCtor = SyntheticToggleEvent;
          }
          var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
          inCapturePhase = [];
          for (var instance = targetInst, lastHostComponent; null !== instance; ) {
            var _instance = instance;
            lastHostComponent = _instance.stateNode;
            _instance = _instance.tag;
            5 !== _instance && 26 !== _instance && 27 !== _instance || null === lastHostComponent || null === reactEventName || (_instance = getListener(instance, reactEventName), null != _instance && inCapturePhase.push(
              createDispatchListener(instance, _instance, lastHostComponent)
            ));
            if (accumulateTargetOnly) break;
            instance = instance.return;
          }
          0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
            reactName,
            reactEventType,
            null,
            nativeEvent,
            nativeEventTarget
          ), dispatchQueue.push({ event: reactName, listeners: inCapturePhase }));
        }
      }
      if (0 === (eventSystemFlags & 7)) {
        a: {
          reactName = "mouseover" === domEventName || "pointerover" === domEventName;
          SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
          if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
            break a;
          if (SyntheticEventCtor || reactName) {
            reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
            if (SyntheticEventCtor) {
              if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
                reactEventType = null;
            } else SyntheticEventCtor = null, reactEventType = targetInst;
            if (SyntheticEventCtor !== reactEventType) {
              inCapturePhase = SyntheticMouseEvent;
              _instance = "onMouseLeave";
              reactEventName = "onMouseEnter";
              instance = "mouse";
              if ("pointerout" === domEventName || "pointerover" === domEventName)
                inCapturePhase = SyntheticPointerEvent, _instance = "onPointerLeave", reactEventName = "onPointerEnter", instance = "pointer";
              accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
              lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
              reactName = new inCapturePhase(
                _instance,
                instance + "leave",
                SyntheticEventCtor,
                nativeEvent,
                nativeEventTarget
              );
              reactName.target = accumulateTargetOnly;
              reactName.relatedTarget = lastHostComponent;
              _instance = null;
              getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
                reactEventName,
                instance + "enter",
                reactEventType,
                nativeEvent,
                nativeEventTarget
              ), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance = inCapturePhase);
              accumulateTargetOnly = _instance;
              if (SyntheticEventCtor && reactEventType)
                b: {
                  inCapturePhase = getParent;
                  reactEventName = SyntheticEventCtor;
                  instance = reactEventType;
                  lastHostComponent = 0;
                  for (_instance = reactEventName; _instance; _instance = inCapturePhase(_instance))
                    lastHostComponent++;
                  _instance = 0;
                  for (var tempB = instance; tempB; tempB = inCapturePhase(tempB))
                    _instance++;
                  for (; 0 < lastHostComponent - _instance; )
                    reactEventName = inCapturePhase(reactEventName), lastHostComponent--;
                  for (; 0 < _instance - lastHostComponent; )
                    instance = inCapturePhase(instance), _instance--;
                  for (; lastHostComponent--; ) {
                    if (reactEventName === instance || null !== instance && reactEventName === instance.alternate) {
                      inCapturePhase = reactEventName;
                      break b;
                    }
                    reactEventName = inCapturePhase(reactEventName);
                    instance = inCapturePhase(instance);
                  }
                  inCapturePhase = null;
                }
              else inCapturePhase = null;
              null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
                dispatchQueue,
                reactName,
                SyntheticEventCtor,
                inCapturePhase,
                false
              );
              null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
                dispatchQueue,
                accumulateTargetOnly,
                reactEventType,
                inCapturePhase,
                true
              );
            }
          }
        }
        a: {
          reactName = targetInst ? getNodeFromInstance(targetInst) : window;
          SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
          if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
            var getTargetInstFunc = getTargetInstForChangeEvent;
          else if (isTextInputElement(reactName))
            if (isInputEventSupported)
              getTargetInstFunc = getTargetInstForInputOrChangeEvent;
            else {
              getTargetInstFunc = getTargetInstForInputEventPolyfill;
              var handleEventFunc = handleEventsForInputEventPolyfill;
            }
          else
            SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
          if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
            createAndAccumulateChangeEvent(
              dispatchQueue,
              getTargetInstFunc,
              nativeEvent,
              nativeEventTarget
            );
            break a;
          }
          handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
          "focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
        }
        handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
        switch (domEventName) {
          case "focusin":
            if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
              activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
            break;
          case "focusout":
            lastSelection = activeElementInst = activeElement = 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);
        }
        var fallbackData;
        if (canUseCompositionEvent)
          b: {
            switch (domEventName) {
              case "compositionstart":
                var eventType = "onCompositionStart";
                break b;
              case "compositionend":
                eventType = "onCompositionEnd";
                break b;
              case "compositionupdate":
                eventType = "onCompositionUpdate";
                break b;
            }
            eventType = void 0;
          }
        else
          isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && 229 === nativeEvent.keyCode && (eventType = "onCompositionStart");
        eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root = nativeEventTarget, startText = "value" in root ? root.value : root.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
          eventType,
          domEventName,
          null,
          nativeEvent,
          nativeEventTarget
        ), dispatchQueue.push({ event: eventType, listeners: handleEventFunc }), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
        if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
          eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput"), 0 < eventType.length && (handleEventFunc = new SyntheticCompositionEvent(
            "onBeforeInput",
            "beforeinput",
            null,
            nativeEvent,
            nativeEventTarget
          ), dispatchQueue.push({
            event: handleEventFunc,
            listeners: eventType
          }), handleEventFunc.data = fallbackData);
        extractEvents$1(
          dispatchQueue,
          domEventName,
          targetInst,
          nativeEvent,
          nativeEventTarget
        );
      }
      processDispatchQueue(dispatchQueue, eventSystemFlags);
    });
  }
  function createDispatchListener(instance, listener, currentTarget) {
    return {
      instance,
      listener,
      currentTarget
    };
  }
  function accumulateTwoPhaseListeners(targetFiber, reactName) {
    for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
      var _instance2 = targetFiber, stateNode = _instance2.stateNode;
      _instance2 = _instance2.tag;
      5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === stateNode || (_instance2 = getListener(targetFiber, captureName), null != _instance2 && listeners.unshift(
        createDispatchListener(targetFiber, _instance2, stateNode)
      ), _instance2 = getListener(targetFiber, reactName), null != _instance2 && listeners.push(
        createDispatchListener(targetFiber, _instance2, stateNode)
      ));
      if (3 === targetFiber.tag) return listeners;
      targetFiber = targetFiber.return;
    }
    return [];
  }
  function getParent(inst) {
    if (null === inst) return null;
    do
      inst = inst.return;
    while (inst && 5 !== inst.tag && 27 !== inst.tag);
    return inst ? inst : null;
  }
  function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
    for (var registrationName = event._reactName, listeners = []; null !== target && target !== common; ) {
      var _instance3 = target, alternate = _instance3.alternate, stateNode = _instance3.stateNode;
      _instance3 = _instance3.tag;
      if (null !== alternate && alternate === common) break;
      5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener(target, registrationName), null != stateNode && listeners.unshift(
        createDispatchListener(target, stateNode, alternate)
      )) : inCapturePhase || (stateNode = getListener(target, registrationName), null != stateNode && listeners.push(
        createDispatchListener(target, stateNode, alternate)
      )));
      target = target.return;
    }
    0 !== listeners.length && dispatchQueue.push({ event, listeners });
  }
  var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
  function normalizeMarkupForTextOrAttribute(markup) {
    return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
  }
  function checkForUnmatchedText(serverText, clientText) {
    clientText = normalizeMarkupForTextOrAttribute(clientText);
    return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
  }
  function setProp(domElement, tag, key, value, props, prevValue) {
    switch (key) {
      case "children":
        "string" === typeof value ? "body" === tag || "textarea" === tag && "" === value || setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && "body" !== tag && setTextContent(domElement, "" + value);
        break;
      case "className":
        setValueForKnownAttribute(domElement, "class", value);
        break;
      case "tabIndex":
        setValueForKnownAttribute(domElement, "tabindex", value);
        break;
      case "dir":
      case "role":
      case "viewBox":
      case "width":
      case "height":
        setValueForKnownAttribute(domElement, key, value);
        break;
      case "style":
        setValueForStyles(domElement, value, prevValue);
        break;
      case "data":
        if ("object" !== tag) {
          setValueForKnownAttribute(domElement, "data", value);
          break;
        }
      case "src":
      case "href":
        if ("" === value && ("a" !== tag || "href" !== key)) {
          domElement.removeAttribute(key);
          break;
        }
        if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) {
          domElement.removeAttribute(key);
          break;
        }
        value = sanitizeURL("" + value);
        domElement.setAttribute(key, value);
        break;
      case "action":
      case "formAction":
        if ("function" === typeof value) {
          domElement.setAttribute(
            key,
            "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
          );
          break;
        } else
          "function" === typeof prevValue && ("formAction" === key ? ("input" !== tag && setProp(domElement, tag, "name", props.name, props, null), setProp(
            domElement,
            tag,
            "formEncType",
            props.formEncType,
            props,
            null
          ), setProp(
            domElement,
            tag,
            "formMethod",
            props.formMethod,
            props,
            null
          ), setProp(
            domElement,
            tag,
            "formTarget",
            props.formTarget,
            props,
            null
          )) : (setProp(domElement, tag, "encType", props.encType, props, null), setProp(domElement, tag, "method", props.method, props, null), setProp(domElement, tag, "target", props.target, props, null)));
        if (null == value || "symbol" === typeof value || "boolean" === typeof value) {
          domElement.removeAttribute(key);
          break;
        }
        value = sanitizeURL("" + value);
        domElement.setAttribute(key, value);
        break;
      case "onClick":
        null != value && (domElement.onclick = noop$1);
        break;
      case "onScroll":
        null != value && listenToNonDelegatedEvent("scroll", domElement);
        break;
      case "onScrollEnd":
        null != value && listenToNonDelegatedEvent("scrollend", domElement);
        break;
      case "dangerouslySetInnerHTML":
        if (null != value) {
          if ("object" !== typeof value || !("__html" in value))
            throw Error(formatProdErrorMessage(61));
          key = value.__html;
          if (null != key) {
            if (null != props.children) throw Error(formatProdErrorMessage(60));
            domElement.innerHTML = key;
          }
        }
        break;
      case "multiple":
        domElement.multiple = value && "function" !== typeof value && "symbol" !== typeof value;
        break;
      case "muted":
        domElement.muted = value && "function" !== typeof value && "symbol" !== typeof value;
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "defaultValue":
      case "defaultChecked":
      case "innerHTML":
      case "ref":
        break;
      case "autoFocus":
        break;
      case "xlinkHref":
        if (null == value || "function" === typeof value || "boolean" === typeof value || "symbol" === typeof value) {
          domElement.removeAttribute("xlink:href");
          break;
        }
        key = sanitizeURL("" + value);
        domElement.setAttributeNS(
          "http://www.w3.org/1999/xlink",
          "xlink:href",
          key
        );
        break;
      case "contentEditable":
      case "spellCheck":
      case "draggable":
      case "value":
      case "autoReverse":
      case "externalResourcesRequired":
      case "focusable":
      case "preserveAlpha":
        null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "" + value) : domElement.removeAttribute(key);
        break;
      case "inert":
      case "allowFullScreen":
      case "async":
      case "autoPlay":
      case "controls":
      case "default":
      case "defer":
      case "disabled":
      case "disablePictureInPicture":
      case "disableRemotePlayback":
      case "formNoValidate":
      case "hidden":
      case "loop":
      case "noModule":
      case "noValidate":
      case "open":
      case "playsInline":
      case "readOnly":
      case "required":
      case "reversed":
      case "scoped":
      case "seamless":
      case "itemScope":
        value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "") : domElement.removeAttribute(key);
        break;
      case "capture":
      case "download":
        true === value ? domElement.setAttribute(key, "") : false !== value && null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
        break;
      case "cols":
      case "rows":
      case "size":
      case "span":
        null != value && "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
        break;
      case "rowSpan":
      case "start":
        null == value || "function" === typeof value || "symbol" === typeof value || isNaN(value) ? domElement.removeAttribute(key) : domElement.setAttribute(key, value);
        break;
      case "popover":
        listenToNonDelegatedEvent("beforetoggle", domElement);
        listenToNonDelegatedEvent("toggle", domElement);
        setValueForAttribute(domElement, "popover", value);
        break;
      case "xlinkActuate":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:actuate",
          value
        );
        break;
      case "xlinkArcrole":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:arcrole",
          value
        );
        break;
      case "xlinkRole":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:role",
          value
        );
        break;
      case "xlinkShow":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:show",
          value
        );
        break;
      case "xlinkTitle":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:title",
          value
        );
        break;
      case "xlinkType":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/1999/xlink",
          "xlink:type",
          value
        );
        break;
      case "xmlBase":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/XML/1998/namespace",
          "xml:base",
          value
        );
        break;
      case "xmlLang":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/XML/1998/namespace",
          "xml:lang",
          value
        );
        break;
      case "xmlSpace":
        setValueForNamespacedAttribute(
          domElement,
          "http://www.w3.org/XML/1998/namespace",
          "xml:space",
          value
        );
        break;
      case "is":
        setValueForAttribute(domElement, "is", value);
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        if (!(2 < key.length) || "o" !== key[0] && "O" !== key[0] || "n" !== key[1] && "N" !== key[1])
          key = aliases.get(key) || key, setValueForAttribute(domElement, key, value);
    }
  }
  function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
    switch (key) {
      case "style":
        setValueForStyles(domElement, value, prevValue);
        break;
      case "dangerouslySetInnerHTML":
        if (null != value) {
          if ("object" !== typeof value || !("__html" in value))
            throw Error(formatProdErrorMessage(61));
          key = value.__html;
          if (null != key) {
            if (null != props.children) throw Error(formatProdErrorMessage(60));
            domElement.innerHTML = key;
          }
        }
        break;
      case "children":
        "string" === typeof value ? setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && setTextContent(domElement, "" + value);
        break;
      case "onScroll":
        null != value && listenToNonDelegatedEvent("scroll", domElement);
        break;
      case "onScrollEnd":
        null != value && listenToNonDelegatedEvent("scrollend", domElement);
        break;
      case "onClick":
        null != value && (domElement.onclick = noop$1);
        break;
      case "suppressContentEditableWarning":
      case "suppressHydrationWarning":
      case "innerHTML":
      case "ref":
        break;
      case "innerText":
      case "textContent":
        break;
      default:
        if (!registrationNameDependencies.hasOwnProperty(key))
          a: {
            if ("o" === key[0] && "n" === key[1] && (props = key.endsWith("Capture"), tag = key.slice(2, props ? key.length - 7 : void 0), prevValue = domElement[internalPropsKey] || null, prevValue = null != prevValue ? prevValue[key] : null, "function" === typeof prevValue && domElement.removeEventListener(tag, prevValue, props), "function" === typeof value)) {
              "function" !== typeof prevValue && null !== prevValue && (key in domElement ? domElement[key] = null : domElement.hasAttribute(key) && domElement.removeAttribute(key));
              domElement.addEventListener(tag, value, props);
              break a;
            }
            key in domElement ? domElement[key] = value : true === value ? domElement.setAttribute(key, "") : setValueForAttribute(domElement, key, value);
          }
    }
  }
  function setInitialProperties(domElement, tag, props) {
    switch (tag) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "img":
        listenToNonDelegatedEvent("error", domElement);
        listenToNonDelegatedEvent("load", domElement);
        var hasSrc = false, hasSrcSet = false, propKey;
        for (propKey in props)
          if (props.hasOwnProperty(propKey)) {
            var propValue = props[propKey];
            if (null != propValue)
              switch (propKey) {
                case "src":
                  hasSrc = true;
                  break;
                case "srcSet":
                  hasSrcSet = true;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(formatProdErrorMessage(137, tag));
                default:
                  setProp(domElement, tag, propKey, propValue, props, null);
              }
          }
        hasSrcSet && setProp(domElement, tag, "srcSet", props.srcSet, props, null);
        hasSrc && setProp(domElement, tag, "src", props.src, props, null);
        return;
      case "input":
        listenToNonDelegatedEvent("invalid", domElement);
        var defaultValue = propKey = propValue = hasSrcSet = null, checked = null, defaultChecked = null;
        for (hasSrc in props)
          if (props.hasOwnProperty(hasSrc)) {
            var propValue$184 = props[hasSrc];
            if (null != propValue$184)
              switch (hasSrc) {
                case "name":
                  hasSrcSet = propValue$184;
                  break;
                case "type":
                  propValue = propValue$184;
                  break;
                case "checked":
                  checked = propValue$184;
                  break;
                case "defaultChecked":
                  defaultChecked = propValue$184;
                  break;
                case "value":
                  propKey = propValue$184;
                  break;
                case "defaultValue":
                  defaultValue = propValue$184;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (null != propValue$184)
                    throw Error(formatProdErrorMessage(137, tag));
                  break;
                default:
                  setProp(domElement, tag, hasSrc, propValue$184, props, null);
              }
          }
        initInput(
          domElement,
          propKey,
          defaultValue,
          checked,
          defaultChecked,
          propValue,
          hasSrcSet,
          false
        );
        return;
      case "select":
        listenToNonDelegatedEvent("invalid", domElement);
        hasSrc = propValue = propKey = null;
        for (hasSrcSet in props)
          if (props.hasOwnProperty(hasSrcSet) && (defaultValue = props[hasSrcSet], null != defaultValue))
            switch (hasSrcSet) {
              case "value":
                propKey = defaultValue;
                break;
              case "defaultValue":
                propValue = defaultValue;
                break;
              case "multiple":
                hasSrc = defaultValue;
              default:
                setProp(domElement, tag, hasSrcSet, defaultValue, props, null);
            }
        tag = propKey;
        props = propValue;
        domElement.multiple = !!hasSrc;
        null != tag ? updateOptions(domElement, !!hasSrc, tag, false) : null != props && updateOptions(domElement, !!hasSrc, props, true);
        return;
      case "textarea":
        listenToNonDelegatedEvent("invalid", domElement);
        propKey = hasSrcSet = hasSrc = null;
        for (propValue in props)
          if (props.hasOwnProperty(propValue) && (defaultValue = props[propValue], null != defaultValue))
            switch (propValue) {
              case "value":
                hasSrc = defaultValue;
                break;
              case "defaultValue":
                hasSrcSet = defaultValue;
                break;
              case "children":
                propKey = defaultValue;
                break;
              case "dangerouslySetInnerHTML":
                if (null != defaultValue) throw Error(formatProdErrorMessage(91));
                break;
              default:
                setProp(domElement, tag, propValue, defaultValue, props, null);
            }
        initTextarea(domElement, hasSrc, hasSrcSet, propKey);
        return;
      case "option":
        for (checked in props)
          if (props.hasOwnProperty(checked) && (hasSrc = props[checked], null != hasSrc))
            switch (checked) {
              case "selected":
                domElement.selected = hasSrc && "function" !== typeof hasSrc && "symbol" !== typeof hasSrc;
                break;
              default:
                setProp(domElement, tag, checked, hasSrc, props, null);
            }
        return;
      case "dialog":
        listenToNonDelegatedEvent("beforetoggle", domElement);
        listenToNonDelegatedEvent("toggle", domElement);
        listenToNonDelegatedEvent("cancel", domElement);
        listenToNonDelegatedEvent("close", domElement);
        break;
      case "iframe":
      case "object":
        listenToNonDelegatedEvent("load", domElement);
        break;
      case "video":
      case "audio":
        for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
          listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
        break;
      case "image":
        listenToNonDelegatedEvent("error", domElement);
        listenToNonDelegatedEvent("load", domElement);
        break;
      case "details":
        listenToNonDelegatedEvent("toggle", domElement);
        break;
      case "embed":
      case "source":
      case "link":
        listenToNonDelegatedEvent("error", domElement), listenToNonDelegatedEvent("load", domElement);
      case "area":
      case "base":
      case "br":
      case "col":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "track":
      case "wbr":
      case "menuitem":
        for (defaultChecked in props)
          if (props.hasOwnProperty(defaultChecked) && (hasSrc = props[defaultChecked], null != hasSrc))
            switch (defaultChecked) {
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(formatProdErrorMessage(137, tag));
              default:
                setProp(domElement, tag, defaultChecked, hasSrc, props, null);
            }
        return;
      default:
        if (isCustomElement(tag)) {
          for (propValue$184 in props)
            props.hasOwnProperty(propValue$184) && (hasSrc = props[propValue$184], void 0 !== hasSrc && setPropOnCustomElement(
              domElement,
              tag,
              propValue$184,
              hasSrc,
              props,
              void 0
            ));
          return;
        }
    }
    for (defaultValue in props)
      props.hasOwnProperty(defaultValue) && (hasSrc = props[defaultValue], null != hasSrc && setProp(domElement, tag, defaultValue, hasSrc, props, null));
  }
  function updateProperties(domElement, tag, lastProps, nextProps) {
    switch (tag) {
      case "div":
      case "span":
      case "svg":
      case "path":
      case "a":
      case "g":
      case "p":
      case "li":
        break;
      case "input":
        var name = null, type = null, value = null, defaultValue = null, lastDefaultValue = null, checked = null, defaultChecked = null;
        for (propKey in lastProps) {
          var lastProp = lastProps[propKey];
          if (lastProps.hasOwnProperty(propKey) && null != lastProp)
            switch (propKey) {
              case "checked":
                break;
              case "value":
                break;
              case "defaultValue":
                lastDefaultValue = lastProp;
              default:
                nextProps.hasOwnProperty(propKey) || setProp(domElement, tag, propKey, null, nextProps, lastProp);
            }
        }
        for (var propKey$201 in nextProps) {
          var propKey = nextProps[propKey$201];
          lastProp = lastProps[propKey$201];
          if (nextProps.hasOwnProperty(propKey$201) && (null != propKey || null != lastProp))
            switch (propKey$201) {
              case "type":
                type = propKey;
                break;
              case "name":
                name = propKey;
                break;
              case "checked":
                checked = propKey;
                break;
              case "defaultChecked":
                defaultChecked = propKey;
                break;
              case "value":
                value = propKey;
                break;
              case "defaultValue":
                defaultValue = propKey;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                if (null != propKey)
                  throw Error(formatProdErrorMessage(137, tag));
                break;
              default:
                propKey !== lastProp && setProp(
                  domElement,
                  tag,
                  propKey$201,
                  propKey,
                  nextProps,
                  lastProp
                );
            }
        }
        updateInput(
          domElement,
          value,
          defaultValue,
          lastDefaultValue,
          checked,
          defaultChecked,
          type,
          name
        );
        return;
      case "select":
        propKey = value = defaultValue = propKey$201 = null;
        for (type in lastProps)
          if (lastDefaultValue = lastProps[type], lastProps.hasOwnProperty(type) && null != lastDefaultValue)
            switch (type) {
              case "value":
                break;
              case "multiple":
                propKey = lastDefaultValue;
              default:
                nextProps.hasOwnProperty(type) || setProp(
                  domElement,
                  tag,
                  type,
                  null,
                  nextProps,
                  lastDefaultValue
                );
            }
        for (name in nextProps)
          if (type = nextProps[name], lastDefaultValue = lastProps[name], nextProps.hasOwnProperty(name) && (null != type || null != lastDefaultValue))
            switch (name) {
              case "value":
                propKey$201 = type;
                break;
              case "defaultValue":
                defaultValue = type;
                break;
              case "multiple":
                value = type;
              default:
                type !== lastDefaultValue && setProp(
                  domElement,
                  tag,
                  name,
                  type,
                  nextProps,
                  lastDefaultValue
                );
            }
        tag = defaultValue;
        lastProps = value;
        nextProps = propKey;
        null != propKey$201 ? updateOptions(domElement, !!lastProps, propKey$201, false) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, true) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false));
        return;
      case "textarea":
        propKey = propKey$201 = null;
        for (defaultValue in lastProps)
          if (name = lastProps[defaultValue], lastProps.hasOwnProperty(defaultValue) && null != name && !nextProps.hasOwnProperty(defaultValue))
            switch (defaultValue) {
              case "value":
                break;
              case "children":
                break;
              default:
                setProp(domElement, tag, defaultValue, null, nextProps, name);
            }
        for (value in nextProps)
          if (name = nextProps[value], type = lastProps[value], nextProps.hasOwnProperty(value) && (null != name || null != type))
            switch (value) {
              case "value":
                propKey$201 = name;
                break;
              case "defaultValue":
                propKey = name;
                break;
              case "children":
                break;
              case "dangerouslySetInnerHTML":
                if (null != name) throw Error(formatProdErrorMessage(91));
                break;
              default:
                name !== type && setProp(domElement, tag, value, name, nextProps, type);
            }
        updateTextarea(domElement, propKey$201, propKey);
        return;
      case "option":
        for (var propKey$217 in lastProps)
          if (propKey$201 = lastProps[propKey$217], lastProps.hasOwnProperty(propKey$217) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$217))
            switch (propKey$217) {
              case "selected":
                domElement.selected = false;
                break;
              default:
                setProp(
                  domElement,
                  tag,
                  propKey$217,
                  null,
                  nextProps,
                  propKey$201
                );
            }
        for (lastDefaultValue in nextProps)
          if (propKey$201 = nextProps[lastDefaultValue], propKey = lastProps[lastDefaultValue], nextProps.hasOwnProperty(lastDefaultValue) && propKey$201 !== propKey && (null != propKey$201 || null != propKey))
            switch (lastDefaultValue) {
              case "selected":
                domElement.selected = propKey$201 && "function" !== typeof propKey$201 && "symbol" !== typeof propKey$201;
                break;
              default:
                setProp(
                  domElement,
                  tag,
                  lastDefaultValue,
                  propKey$201,
                  nextProps,
                  propKey
                );
            }
        return;
      case "img":
      case "link":
      case "area":
      case "base":
      case "br":
      case "col":
      case "embed":
      case "hr":
      case "keygen":
      case "meta":
      case "param":
      case "source":
      case "track":
      case "wbr":
      case "menuitem":
        for (var propKey$222 in lastProps)
          propKey$201 = lastProps[propKey$222], lastProps.hasOwnProperty(propKey$222) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$222) && setProp(domElement, tag, propKey$222, null, nextProps, propKey$201);
        for (checked in nextProps)
          if (propKey$201 = nextProps[checked], propKey = lastProps[checked], nextProps.hasOwnProperty(checked) && propKey$201 !== propKey && (null != propKey$201 || null != propKey))
            switch (checked) {
              case "children":
              case "dangerouslySetInnerHTML":
                if (null != propKey$201)
                  throw Error(formatProdErrorMessage(137, tag));
                break;
              default:
                setProp(
                  domElement,
                  tag,
                  checked,
                  propKey$201,
                  nextProps,
                  propKey
                );
            }
        return;
      default:
        if (isCustomElement(tag)) {
          for (var propKey$227 in lastProps)
            propKey$201 = lastProps[propKey$227], lastProps.hasOwnProperty(propKey$227) && void 0 !== propKey$201 && !nextProps.hasOwnProperty(propKey$227) && setPropOnCustomElement(
              domElement,
              tag,
              propKey$227,
              void 0,
              nextProps,
              propKey$201
            );
          for (defaultChecked in nextProps)
            propKey$201 = nextProps[defaultChecked], propKey = lastProps[defaultChecked], !nextProps.hasOwnProperty(defaultChecked) || propKey$201 === propKey || void 0 === propKey$201 && void 0 === propKey || setPropOnCustomElement(
              domElement,
              tag,
              defaultChecked,
              propKey$201,
              nextProps,
              propKey
            );
          return;
        }
    }
    for (var propKey$232 in lastProps)
      propKey$201 = lastProps[propKey$232], lastProps.hasOwnProperty(propKey$232) && null != propKey$201 && !nextProps.hasOwnProperty(propKey$232) && setProp(domElement, tag, propKey$232, null, nextProps, propKey$201);
    for (lastProp in nextProps)
      propKey$201 = nextProps[lastProp], propKey = lastProps[lastProp], !nextProps.hasOwnProperty(lastProp) || propKey$201 === propKey || null == propKey$201 && null == propKey || setProp(domElement, tag, lastProp, propKey$201, nextProps, propKey);
  }
  function isLikelyStaticResource(initiatorType) {
    switch (initiatorType) {
      case "css":
      case "script":
      case "font":
      case "img":
      case "image":
      case "input":
      case "link":
        return true;
      default:
        return false;
    }
  }
  function estimateBandwidth() {
    if ("function" === typeof performance.getEntriesByType) {
      for (var count = 0, bits = 0, resourceEntries = performance.getEntriesByType("resource"), i = 0; i < resourceEntries.length; i++) {
        var entry = resourceEntries[i], transferSize = entry.transferSize, initiatorType = entry.initiatorType, duration = entry.duration;
        if (transferSize && duration && isLikelyStaticResource(initiatorType)) {
          initiatorType = 0;
          duration = entry.responseEnd;
          for (i += 1; i < resourceEntries.length; i++) {
            var overlapEntry = resourceEntries[i], overlapStartTime = overlapEntry.startTime;
            if (overlapStartTime > duration) break;
            var overlapTransferSize = overlapEntry.transferSize, overlapInitiatorType = overlapEntry.initiatorType;
            overlapTransferSize && isLikelyStaticResource(overlapInitiatorType) && (overlapEntry = overlapEntry.responseEnd, initiatorType += overlapTransferSize * (overlapEntry < duration ? 1 : (duration - overlapStartTime) / (overlapEntry - overlapStartTime)));
          }
          --i;
          bits += 8 * (transferSize + initiatorType) / (entry.duration / 1e3);
          count++;
          if (10 < count) break;
        }
      }
      if (0 < count) return bits / count / 1e6;
    }
    return navigator.connection && (count = navigator.connection.downlink, "number" === typeof count) ? count : 5;
  }
  var eventsEnabled = null, selectionInformation = null;
  function getOwnerDocumentFromRootContainer(rootContainerElement) {
    return 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
  }
  function getOwnHostContext(namespaceURI) {
    switch (namespaceURI) {
      case "http://www.w3.org/2000/svg":
        return 1;
      case "http://www.w3.org/1998/Math/MathML":
        return 2;
      default:
        return 0;
    }
  }
  function getChildHostContextProd(parentNamespace, type) {
    if (0 === parentNamespace)
      switch (type) {
        case "svg":
          return 1;
        case "math":
          return 2;
        default:
          return 0;
      }
    return 1 === parentNamespace && "foreignObject" === type ? 0 : parentNamespace;
  }
  function shouldSetTextContent(type, props) {
    return "textarea" === type || "noscript" === type || "string" === typeof props.children || "number" === typeof props.children || "bigint" === typeof props.children || "object" === typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
  }
  var currentPopstateTransitionEvent = null;
  function shouldAttemptEagerTransition() {
    var event = window.event;
    if (event && "popstate" === event.type) {
      if (event === currentPopstateTransitionEvent) return false;
      currentPopstateTransitionEvent = event;
      return true;
    }
    currentPopstateTransitionEvent = null;
    return false;
  }
  var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, cancelTimeout2 = "function" === typeof clearTimeout ? clearTimeout : void 0, localPromise = "function" === typeof Promise ? Promise : void 0, scheduleMicrotask = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof localPromise ? function(callback) {
    return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
  } : scheduleTimeout;
  function handleErrorInNextTick(error2) {
    setTimeout(function() {
      throw error2;
    });
  }
  function isSingletonScope(type) {
    return "head" === type;
  }
  function clearHydrationBoundary(parentInstance, hydrationInstance) {
    var node = hydrationInstance, depth = 0;
    do {
      var nextNode = node.nextSibling;
      parentInstance.removeChild(node);
      if (nextNode && 8 === nextNode.nodeType)
        if (node = nextNode.data, "/$" === node || "/&" === node) {
          if (0 === depth) {
            parentInstance.removeChild(nextNode);
            retryIfBlockedOn(hydrationInstance);
            return;
          }
          depth--;
        } else if ("$" === node || "$?" === node || "$~" === node || "$!" === node || "&" === node)
          depth++;
        else if ("html" === node)
          releaseSingletonInstance(parentInstance.ownerDocument.documentElement);
        else if ("head" === node) {
          node = parentInstance.ownerDocument.head;
          releaseSingletonInstance(node);
          for (var node$jscomp$0 = node.firstChild; node$jscomp$0; ) {
            var nextNode$jscomp$0 = node$jscomp$0.nextSibling, nodeName = node$jscomp$0.nodeName;
            node$jscomp$0[internalHoistableMarker] || "SCRIPT" === nodeName || "STYLE" === nodeName || "LINK" === nodeName && "stylesheet" === node$jscomp$0.rel.toLowerCase() || node.removeChild(node$jscomp$0);
            node$jscomp$0 = nextNode$jscomp$0;
          }
        } else
          "body" === node && releaseSingletonInstance(parentInstance.ownerDocument.body);
      node = nextNode;
    } while (node);
    retryIfBlockedOn(hydrationInstance);
  }
  function hideOrUnhideDehydratedBoundary(suspenseInstance, isHidden) {
    var node = suspenseInstance;
    suspenseInstance = 0;
    do {
      var nextNode = node.nextSibling;
      1 === node.nodeType ? isHidden ? (node._stashedDisplay = node.style.display, node.style.display = "none") : (node.style.display = node._stashedDisplay || "", "" === node.getAttribute("style") && node.removeAttribute("style")) : 3 === node.nodeType && (isHidden ? (node._stashedText = node.nodeValue, node.nodeValue = "") : node.nodeValue = node._stashedText || "");
      if (nextNode && 8 === nextNode.nodeType)
        if (node = nextNode.data, "/$" === node)
          if (0 === suspenseInstance) break;
          else suspenseInstance--;
        else
          "$" !== node && "$?" !== node && "$~" !== node && "$!" !== node || suspenseInstance++;
      node = nextNode;
    } while (node);
  }
  function clearContainerSparingly(container2) {
    var nextNode = container2.firstChild;
    nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
    for (; nextNode; ) {
      var node = nextNode;
      nextNode = nextNode.nextSibling;
      switch (node.nodeName) {
        case "HTML":
        case "HEAD":
        case "BODY":
          clearContainerSparingly(node);
          detachDeletedInstance(node);
          continue;
        case "SCRIPT":
        case "STYLE":
          continue;
        case "LINK":
          if ("stylesheet" === node.rel.toLowerCase()) continue;
      }
      container2.removeChild(node);
    }
  }
  function canHydrateInstance(instance, type, props, inRootOrSingleton) {
    for (; 1 === instance.nodeType; ) {
      var anyProps = props;
      if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
        if (!inRootOrSingleton && ("INPUT" !== instance.nodeName || "hidden" !== instance.type))
          break;
      } else if (!inRootOrSingleton)
        if ("input" === type && "hidden" === instance.type) {
          var name = null == anyProps.name ? null : "" + anyProps.name;
          if ("hidden" === anyProps.type && instance.getAttribute("name") === name)
            return instance;
        } else return instance;
      else if (!instance[internalHoistableMarker])
        switch (type) {
          case "meta":
            if (!instance.hasAttribute("itemprop")) break;
            return instance;
          case "link":
            name = instance.getAttribute("rel");
            if ("stylesheet" === name && instance.hasAttribute("data-precedence"))
              break;
            else if (name !== anyProps.rel || instance.getAttribute("href") !== (null == anyProps.href || "" === anyProps.href ? null : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== (null == anyProps.title ? null : anyProps.title))
              break;
            return instance;
          case "style":
            if (instance.hasAttribute("data-precedence")) break;
            return instance;
          case "script":
            name = instance.getAttribute("src");
            if ((name !== (null == anyProps.src ? null : anyProps.src) || instance.getAttribute("type") !== (null == anyProps.type ? null : anyProps.type) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && name && instance.hasAttribute("async") && !instance.hasAttribute("itemprop"))
              break;
            return instance;
          default:
            return instance;
        }
      instance = getNextHydratable(instance.nextSibling);
      if (null === instance) break;
    }
    return null;
  }
  function canHydrateTextInstance(instance, text2, inRootOrSingleton) {
    if ("" === text2) return null;
    for (; 3 !== instance.nodeType; ) {
      if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
        return null;
      instance = getNextHydratable(instance.nextSibling);
      if (null === instance) return null;
    }
    return instance;
  }
  function canHydrateHydrationBoundary(instance, inRootOrSingleton) {
    for (; 8 !== instance.nodeType; ) {
      if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
        return null;
      instance = getNextHydratable(instance.nextSibling);
      if (null === instance) return null;
    }
    return instance;
  }
  function isSuspenseInstancePending(instance) {
    return "$?" === instance.data || "$~" === instance.data;
  }
  function isSuspenseInstanceFallback(instance) {
    return "$!" === instance.data || "$?" === instance.data && "loading" !== instance.ownerDocument.readyState;
  }
  function registerSuspenseInstanceRetry(instance, callback) {
    var ownerDocument = instance.ownerDocument;
    if ("$~" === instance.data) instance._reactRetry = callback;
    else if ("$?" !== instance.data || "loading" !== ownerDocument.readyState)
      callback();
    else {
      var listener = function() {
        callback();
        ownerDocument.removeEventListener("DOMContentLoaded", listener);
      };
      ownerDocument.addEventListener("DOMContentLoaded", listener);
      instance._reactRetry = listener;
    }
  }
  function getNextHydratable(node) {
    for (; null != node; node = node.nextSibling) {
      var nodeType = node.nodeType;
      if (1 === nodeType || 3 === nodeType) break;
      if (8 === nodeType) {
        nodeType = node.data;
        if ("$" === nodeType || "$!" === nodeType || "$?" === nodeType || "$~" === nodeType || "&" === nodeType || "F!" === nodeType || "F" === nodeType)
          break;
        if ("/$" === nodeType || "/&" === nodeType) return null;
      }
    }
    return node;
  }
  var previousHydratableOnEnteringScopedSingleton = null;
  function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance) {
    hydrationInstance = hydrationInstance.nextSibling;
    for (var depth = 0; hydrationInstance; ) {
      if (8 === hydrationInstance.nodeType) {
        var data = hydrationInstance.data;
        if ("/$" === data || "/&" === data) {
          if (0 === depth)
            return getNextHydratable(hydrationInstance.nextSibling);
          depth--;
        } else
          "$" !== data && "$!" !== data && "$?" !== data && "$~" !== data && "&" !== data || depth++;
      }
      hydrationInstance = hydrationInstance.nextSibling;
    }
    return null;
  }
  function getParentHydrationBoundary(targetInstance) {
    targetInstance = targetInstance.previousSibling;
    for (var depth = 0; targetInstance; ) {
      if (8 === targetInstance.nodeType) {
        var data = targetInstance.data;
        if ("$" === data || "$!" === data || "$?" === data || "$~" === data || "&" === data) {
          if (0 === depth) return targetInstance;
          depth--;
        } else "/$" !== data && "/&" !== data || depth++;
      }
      targetInstance = targetInstance.previousSibling;
    }
    return null;
  }
  function resolveSingletonInstance(type, props, rootContainerInstance) {
    props = getOwnerDocumentFromRootContainer(rootContainerInstance);
    switch (type) {
      case "html":
        type = props.documentElement;
        if (!type) throw Error(formatProdErrorMessage(452));
        return type;
      case "head":
        type = props.head;
        if (!type) throw Error(formatProdErrorMessage(453));
        return type;
      case "body":
        type = props.body;
        if (!type) throw Error(formatProdErrorMessage(454));
        return type;
      default:
        throw Error(formatProdErrorMessage(451));
    }
  }
  function releaseSingletonInstance(instance) {
    for (var attributes = instance.attributes; attributes.length; )
      instance.removeAttributeNode(attributes[0]);
    detachDeletedInstance(instance);
  }
  var preloadPropsMap = /* @__PURE__ */ new Map(), preconnectsSet = /* @__PURE__ */ new Set();
  function getHoistableRoot(container2) {
    return "function" === typeof container2.getRootNode ? container2.getRootNode() : 9 === container2.nodeType ? container2 : container2.ownerDocument;
  }
  var previousDispatcher = ReactDOMSharedInternals.d;
  ReactDOMSharedInternals.d = {
    f: flushSyncWork,
    r: requestFormReset,
    D: prefetchDNS,
    C: preconnect,
    L: preload,
    m: preloadModule,
    X: preinitScript,
    S: preinitStyle,
    M: preinitModuleScript
  };
  function flushSyncWork() {
    var previousWasRendering = previousDispatcher.f(), wasRendering = flushSyncWork$1();
    return previousWasRendering || wasRendering;
  }
  function requestFormReset(form) {
    var formInst = getInstanceFromNode(form);
    null !== formInst && 5 === formInst.tag && "form" === formInst.type ? requestFormReset$1(formInst) : previousDispatcher.r(form);
  }
  var globalDocument = "undefined" === typeof document ? null : document;
  function preconnectAs(rel, href, crossOrigin) {
    var ownerDocument = globalDocument;
    if (ownerDocument && "string" === typeof href && href) {
      var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href);
      limitedEscapedHref = 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
      "string" === typeof crossOrigin && (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
      preconnectsSet.has(limitedEscapedHref) || (preconnectsSet.add(limitedEscapedHref), rel = { rel, crossOrigin, href }, null === ownerDocument.querySelector(limitedEscapedHref) && (href = ownerDocument.createElement("link"), setInitialProperties(href, "link", rel), markNodeAsHoistable(href), ownerDocument.head.appendChild(href)));
    }
  }
  function prefetchDNS(href) {
    previousDispatcher.D(href);
    preconnectAs("dns-prefetch", href, null);
  }
  function preconnect(href, crossOrigin) {
    previousDispatcher.C(href, crossOrigin);
    preconnectAs("preconnect", href, crossOrigin);
  }
  function preload(href, as, options2) {
    previousDispatcher.L(href, as, options2);
    var ownerDocument = globalDocument;
    if (ownerDocument && href && as) {
      var preloadSelector = 'link[rel="preload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"]';
      "image" === as ? options2 && options2.imageSrcSet ? (preloadSelector += '[imagesrcset="' + escapeSelectorAttributeValueInsideDoubleQuotes(
        options2.imageSrcSet
      ) + '"]', "string" === typeof options2.imageSizes && (preloadSelector += '[imagesizes="' + escapeSelectorAttributeValueInsideDoubleQuotes(
        options2.imageSizes
      ) + '"]')) : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]' : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]';
      var key = preloadSelector;
      switch (as) {
        case "style":
          key = getStyleKey(href);
          break;
        case "script":
          key = getScriptKey(href);
      }
      preloadPropsMap.has(key) || (href = assign2(
        {
          rel: "preload",
          href: "image" === as && options2 && options2.imageSrcSet ? void 0 : href,
          as
        },
        options2
      ), preloadPropsMap.set(key, href), null !== ownerDocument.querySelector(preloadSelector) || "style" === as && ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || "script" === as && ownerDocument.querySelector(getScriptSelectorFromKey(key)) || (as = ownerDocument.createElement("link"), setInitialProperties(as, "link", href), markNodeAsHoistable(as), ownerDocument.head.appendChild(as)));
    }
  }
  function preloadModule(href, options2) {
    previousDispatcher.m(href, options2);
    var ownerDocument = globalDocument;
    if (ownerDocument && href) {
      var as = options2 && "string" === typeof options2.as ? options2.as : "script", preloadSelector = 'link[rel="modulepreload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"][href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]', key = preloadSelector;
      switch (as) {
        case "audioworklet":
        case "paintworklet":
        case "serviceworker":
        case "sharedworker":
        case "worker":
        case "script":
          key = getScriptKey(href);
      }
      if (!preloadPropsMap.has(key) && (href = assign2({ rel: "modulepreload", href }, options2), preloadPropsMap.set(key, href), null === ownerDocument.querySelector(preloadSelector))) {
        switch (as) {
          case "audioworklet":
          case "paintworklet":
          case "serviceworker":
          case "sharedworker":
          case "worker":
          case "script":
            if (ownerDocument.querySelector(getScriptSelectorFromKey(key)))
              return;
        }
        as = ownerDocument.createElement("link");
        setInitialProperties(as, "link", href);
        markNodeAsHoistable(as);
        ownerDocument.head.appendChild(as);
      }
    }
  }
  function preinitStyle(href, precedence, options2) {
    previousDispatcher.S(href, precedence, options2);
    var ownerDocument = globalDocument;
    if (ownerDocument && href) {
      var styles2 = getResourcesFromRoot(ownerDocument).hoistableStyles, key = getStyleKey(href);
      precedence = precedence || "default";
      var resource = styles2.get(key);
      if (!resource) {
        var state = { loading: 0, preload: null };
        if (resource = ownerDocument.querySelector(
          getStylesheetSelectorFromKey(key)
        ))
          state.loading = 5;
        else {
          href = assign2(
            { rel: "stylesheet", href, "data-precedence": precedence },
            options2
          );
          (options2 = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(href, options2);
          var link2 = resource = ownerDocument.createElement("link");
          markNodeAsHoistable(link2);
          setInitialProperties(link2, "link", href);
          link2._p = new Promise(function(resolve, reject) {
            link2.onload = resolve;
            link2.onerror = reject;
          });
          link2.addEventListener("load", function() {
            state.loading |= 1;
          });
          link2.addEventListener("error", function() {
            state.loading |= 2;
          });
          state.loading |= 4;
          insertStylesheet(resource, precedence, ownerDocument);
        }
        resource = {
          type: "stylesheet",
          instance: resource,
          count: 1,
          state
        };
        styles2.set(key, resource);
      }
    }
  }
  function preinitScript(src, options2) {
    previousDispatcher.X(src, options2);
    var ownerDocument = globalDocument;
    if (ownerDocument && src) {
      var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
      resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign2({ src, async: true }, options2), (options2 = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options2), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
        type: "script",
        instance: resource,
        count: 1,
        state: null
      }, scripts.set(key, resource));
    }
  }
  function preinitModuleScript(src, options2) {
    previousDispatcher.M(src, options2);
    var ownerDocument = globalDocument;
    if (ownerDocument && src) {
      var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
      resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign2({ src, async: true, type: "module" }, options2), (options2 = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options2), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
        type: "script",
        instance: resource,
        count: 1,
        state: null
      }, scripts.set(key, resource));
    }
  }
  function getResource(type, currentProps, pendingProps, currentResource) {
    var JSCompiler_inline_result = (JSCompiler_inline_result = rootInstanceStackCursor.current) ? getHoistableRoot(JSCompiler_inline_result) : null;
    if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage(446));
    switch (type) {
      case "meta":
      case "title":
        return null;
      case "style":
        return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href ? (currentProps = getStyleKey(pendingProps.href), pendingProps = getResourcesFromRoot(
          JSCompiler_inline_result
        ).hoistableStyles, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
          type: "style",
          instance: null,
          count: 0,
          state: null
        }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
      case "link":
        if ("stylesheet" === pendingProps.rel && "string" === typeof pendingProps.href && "string" === typeof pendingProps.precedence) {
          type = getStyleKey(pendingProps.href);
          var styles$243 = getResourcesFromRoot(
            JSCompiler_inline_result
          ).hoistableStyles, resource$244 = styles$243.get(type);
          resource$244 || (JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result, resource$244 = {
            type: "stylesheet",
            instance: null,
            count: 0,
            state: { loading: 0, preload: null }
          }, styles$243.set(type, resource$244), (styles$243 = JSCompiler_inline_result.querySelector(
            getStylesheetSelectorFromKey(type)
          )) && !styles$243._p && (resource$244.instance = styles$243, resource$244.state.loading = 5), preloadPropsMap.has(type) || (pendingProps = {
            rel: "preload",
            as: "style",
            href: pendingProps.href,
            crossOrigin: pendingProps.crossOrigin,
            integrity: pendingProps.integrity,
            media: pendingProps.media,
            hrefLang: pendingProps.hrefLang,
            referrerPolicy: pendingProps.referrerPolicy
          }, preloadPropsMap.set(type, pendingProps), styles$243 || preloadStylesheet(
            JSCompiler_inline_result,
            type,
            pendingProps,
            resource$244.state
          )));
          if (currentProps && null === currentResource)
            throw Error(formatProdErrorMessage(528, ""));
          return resource$244;
        }
        if (currentProps && null !== currentResource)
          throw Error(formatProdErrorMessage(529, ""));
        return null;
      case "script":
        return currentProps = pendingProps.async, pendingProps = pendingProps.src, "string" === typeof pendingProps && currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps ? (currentProps = getScriptKey(pendingProps), pendingProps = getResourcesFromRoot(
          JSCompiler_inline_result
        ).hoistableScripts, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
          type: "script",
          instance: null,
          count: 0,
          state: null
        }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
      default:
        throw Error(formatProdErrorMessage(444, type));
    }
  }
  function getStyleKey(href) {
    return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
  }
  function getStylesheetSelectorFromKey(key) {
    return 'link[rel="stylesheet"][' + key + "]";
  }
  function stylesheetPropsFromRawProps(rawProps) {
    return assign2({}, rawProps, {
      "data-precedence": rawProps.precedence,
      precedence: null
    });
  }
  function preloadStylesheet(ownerDocument, key, preloadProps, state) {
    ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") ? state.loading = 1 : (key = ownerDocument.createElement("link"), state.preload = key, key.addEventListener("load", function() {
      return state.loading |= 1;
    }), key.addEventListener("error", function() {
      return state.loading |= 2;
    }), setInitialProperties(key, "link", preloadProps), markNodeAsHoistable(key), ownerDocument.head.appendChild(key));
  }
  function getScriptKey(src) {
    return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
  }
  function getScriptSelectorFromKey(key) {
    return "script[async]" + key;
  }
  function acquireResource(hoistableRoot, resource, props) {
    resource.count++;
    if (null === resource.instance)
      switch (resource.type) {
        case "style":
          var instance = hoistableRoot.querySelector(
            'style[data-href~="' + escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + '"]'
          );
          if (instance)
            return resource.instance = instance, markNodeAsHoistable(instance), instance;
          var styleProps = assign2({}, props, {
            "data-href": props.href,
            "data-precedence": props.precedence,
            href: null,
            precedence: null
          });
          instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement(
            "style"
          );
          markNodeAsHoistable(instance);
          setInitialProperties(instance, "style", styleProps);
          insertStylesheet(instance, props.precedence, hoistableRoot);
          return resource.instance = instance;
        case "stylesheet":
          styleProps = getStyleKey(props.href);
          var instance$249 = hoistableRoot.querySelector(
            getStylesheetSelectorFromKey(styleProps)
          );
          if (instance$249)
            return resource.state.loading |= 4, resource.instance = instance$249, markNodeAsHoistable(instance$249), instance$249;
          instance = stylesheetPropsFromRawProps(props);
          (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps);
          instance$249 = (hoistableRoot.ownerDocument || hoistableRoot).createElement("link");
          markNodeAsHoistable(instance$249);
          var linkInstance = instance$249;
          linkInstance._p = new Promise(function(resolve, reject) {
            linkInstance.onload = resolve;
            linkInstance.onerror = reject;
          });
          setInitialProperties(instance$249, "link", instance);
          resource.state.loading |= 4;
          insertStylesheet(instance$249, props.precedence, hoistableRoot);
          return resource.instance = instance$249;
        case "script":
          instance$249 = getScriptKey(props.src);
          if (styleProps = hoistableRoot.querySelector(
            getScriptSelectorFromKey(instance$249)
          ))
            return resource.instance = styleProps, markNodeAsHoistable(styleProps), styleProps;
          instance = props;
          if (styleProps = preloadPropsMap.get(instance$249))
            instance = assign2({}, props), adoptPreloadPropsForScript(instance, styleProps);
          hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
          styleProps = hoistableRoot.createElement("script");
          markNodeAsHoistable(styleProps);
          setInitialProperties(styleProps, "link", instance);
          hoistableRoot.head.appendChild(styleProps);
          return resource.instance = styleProps;
        case "void":
          return null;
        default:
          throw Error(formatProdErrorMessage(443, resource.type));
      }
    else
      "stylesheet" === resource.type && 0 === (resource.state.loading & 4) && (instance = resource.instance, resource.state.loading |= 4, insertStylesheet(instance, props.precedence, hoistableRoot));
    return resource.instance;
  }
  function insertStylesheet(instance, precedence, root2) {
    for (var nodes = root2.querySelectorAll(
      'link[rel="stylesheet"][data-precedence],style[data-precedence]'
    ), last = nodes.length ? nodes[nodes.length - 1] : null, prior = last, i = 0; i < nodes.length; i++) {
      var node = nodes[i];
      if (node.dataset.precedence === precedence) prior = node;
      else if (prior !== last) break;
    }
    prior ? prior.parentNode.insertBefore(instance, prior.nextSibling) : (precedence = 9 === root2.nodeType ? root2.head : root2, precedence.insertBefore(instance, precedence.firstChild));
  }
  function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
    null == stylesheetProps.crossOrigin && (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
    null == stylesheetProps.referrerPolicy && (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
    null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
  }
  function adoptPreloadPropsForScript(scriptProps, preloadProps) {
    null == scriptProps.crossOrigin && (scriptProps.crossOrigin = preloadProps.crossOrigin);
    null == scriptProps.referrerPolicy && (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
    null == scriptProps.integrity && (scriptProps.integrity = preloadProps.integrity);
  }
  var tagCaches = null;
  function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
    if (null === tagCaches) {
      var cache = /* @__PURE__ */ new Map();
      var caches = tagCaches = /* @__PURE__ */ new Map();
      caches.set(ownerDocument, cache);
    } else
      caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
    if (cache.has(type)) return cache;
    cache.set(type, null);
    ownerDocument = ownerDocument.getElementsByTagName(type);
    for (caches = 0; caches < ownerDocument.length; caches++) {
      var node = ownerDocument[caches];
      if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node.namespaceURI) {
        var nodeKey = node.getAttribute(keyAttribute) || "";
        nodeKey = type + nodeKey;
        var existing = cache.get(nodeKey);
        existing ? existing.push(node) : cache.set(nodeKey, [node]);
      }
    }
    return cache;
  }
  function mountHoistable(hoistableRoot, type, instance) {
    hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
    hoistableRoot.head.insertBefore(
      instance,
      "title" === type ? hoistableRoot.querySelector("head > title") : null
    );
  }
  function isHostHoistableType(type, props, hostContext) {
    if (1 === hostContext || null != props.itemProp) return false;
    switch (type) {
      case "meta":
      case "title":
        return true;
      case "style":
        if ("string" !== typeof props.precedence || "string" !== typeof props.href || "" === props.href)
          break;
        return true;
      case "link":
        if ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href || props.onLoad || props.onError)
          break;
        switch (props.rel) {
          case "stylesheet":
            return type = props.disabled, "string" === typeof props.precedence && null == type;
          default:
            return true;
        }
      case "script":
        if (props.async && "function" !== typeof props.async && "symbol" !== typeof props.async && !props.onLoad && !props.onError && props.src && "string" === typeof props.src)
          return true;
    }
    return false;
  }
  function preloadResource(resource) {
    return "stylesheet" === resource.type && 0 === (resource.state.loading & 3) ? false : true;
  }
  function suspendResource(state, hoistableRoot, resource, props) {
    if ("stylesheet" === resource.type && ("string" !== typeof props.media || false !== matchMedia(props.media).matches) && 0 === (resource.state.loading & 4)) {
      if (null === resource.instance) {
        var key = getStyleKey(props.href), instance = hoistableRoot.querySelector(
          getStylesheetSelectorFromKey(key)
        );
        if (instance) {
          hoistableRoot = instance._p;
          null !== hoistableRoot && "object" === typeof hoistableRoot && "function" === typeof hoistableRoot.then && (state.count++, state = onUnsuspend.bind(state), hoistableRoot.then(state, state));
          resource.state.loading |= 4;
          resource.instance = instance;
          markNodeAsHoistable(instance);
          return;
        }
        instance = hoistableRoot.ownerDocument || hoistableRoot;
        props = stylesheetPropsFromRawProps(props);
        (key = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(props, key);
        instance = instance.createElement("link");
        markNodeAsHoistable(instance);
        var linkInstance = instance;
        linkInstance._p = new Promise(function(resolve, reject) {
          linkInstance.onload = resolve;
          linkInstance.onerror = reject;
        });
        setInitialProperties(instance, "link", props);
        resource.instance = instance;
      }
      null === state.stylesheets && (state.stylesheets = /* @__PURE__ */ new Map());
      state.stylesheets.set(resource, hoistableRoot);
      (hoistableRoot = resource.state.preload) && 0 === (resource.state.loading & 3) && (state.count++, resource = onUnsuspend.bind(state), hoistableRoot.addEventListener("load", resource), hoistableRoot.addEventListener("error", resource));
    }
  }
  var estimatedBytesWithinLimit = 0;
  function waitForCommitToBeReady(state, timeoutOffset) {
    state.stylesheets && 0 === state.count && insertSuspendedStylesheets(state, state.stylesheets);
    return 0 < state.count || 0 < state.imgCount ? function(commit) {
      var stylesheetTimer = setTimeout(function() {
        state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets);
        if (state.unsuspend) {
          var unsuspend = state.unsuspend;
          state.unsuspend = null;
          unsuspend();
        }
      }, 6e4 + timeoutOffset);
      0 < state.imgBytes && 0 === estimatedBytesWithinLimit && (estimatedBytesWithinLimit = 62500 * estimateBandwidth());
      var imgTimer = setTimeout(
        function() {
          state.waitingForImages = false;
          if (0 === state.count && (state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets), state.unsuspend)) {
            var unsuspend = state.unsuspend;
            state.unsuspend = null;
            unsuspend();
          }
        },
        (state.imgBytes > estimatedBytesWithinLimit ? 50 : 800) + timeoutOffset
      );
      state.unsuspend = commit;
      return function() {
        state.unsuspend = null;
        clearTimeout(stylesheetTimer);
        clearTimeout(imgTimer);
      };
    } : null;
  }
  function onUnsuspend() {
    this.count--;
    if (0 === this.count && (0 === this.imgCount || !this.waitingForImages)) {
      if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets);
      else if (this.unsuspend) {
        var unsuspend = this.unsuspend;
        this.unsuspend = null;
        unsuspend();
      }
    }
  }
  var precedencesByRoot = null;
  function insertSuspendedStylesheets(state, resources) {
    state.stylesheets = null;
    null !== state.unsuspend && (state.count++, precedencesByRoot = /* @__PURE__ */ new Map(), resources.forEach(insertStylesheetIntoRoot, state), precedencesByRoot = null, onUnsuspend.call(state));
  }
  function insertStylesheetIntoRoot(root2, resource) {
    if (!(resource.state.loading & 4)) {
      var precedences = precedencesByRoot.get(root2);
      if (precedences) var last = precedences.get(null);
      else {
        precedences = /* @__PURE__ */ new Map();
        precedencesByRoot.set(root2, precedences);
        for (var nodes = root2.querySelectorAll(
          "link[data-precedence],style[data-precedence]"
        ), i = 0; i < nodes.length; i++) {
          var node = nodes[i];
          if ("LINK" === node.nodeName || "not all" !== node.getAttribute("media"))
            precedences.set(node.dataset.precedence, node), last = node;
        }
        last && precedences.set(null, last);
      }
      nodes = resource.instance;
      node = nodes.getAttribute("data-precedence");
      i = precedences.get(node) || last;
      i === last && precedences.set(null, nodes);
      precedences.set(node, nodes);
      this.count++;
      last = onUnsuspend.bind(this);
      nodes.addEventListener("load", last);
      nodes.addEventListener("error", last);
      i ? i.parentNode.insertBefore(nodes, i.nextSibling) : (root2 = 9 === root2.nodeType ? root2.head : root2, root2.insertBefore(nodes, root2.firstChild));
      resource.state.loading |= 4;
    }
  }
  var HostTransitionContext = {
    $$typeof: REACT_CONTEXT_TYPE,
    Provider: null,
    Consumer: null,
    _currentValue: sharedNotPendingObject,
    _currentValue2: sharedNotPendingObject,
    _threadCount: 0
  };
  function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator, formState) {
    this.tag = 1;
    this.containerInfo = containerInfo;
    this.pingCache = this.current = this.pendingChildren = null;
    this.timeoutHandle = -1;
    this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null;
    this.callbackPriority = 0;
    this.expirationTimes = createLaneMap(-1);
    this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
    this.entanglements = createLaneMap(0);
    this.hiddenUpdates = createLaneMap(null);
    this.identifierPrefix = identifierPrefix;
    this.onUncaughtError = onUncaughtError;
    this.onCaughtError = onCaughtError;
    this.onRecoverableError = onRecoverableError;
    this.pooledCache = null;
    this.pooledCacheLanes = 0;
    this.formState = formState;
    this.incompleteTransitions = /* @__PURE__ */ new Map();
  }
  function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, formState, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator) {
    containerInfo = new FiberRootNode(
      containerInfo,
      tag,
      hydrate,
      identifierPrefix,
      onUncaughtError,
      onCaughtError,
      onRecoverableError,
      onDefaultTransitionIndicator,
      formState
    );
    tag = 1;
    true === isStrictMode && (tag |= 24);
    isStrictMode = createFiberImplClass(3, null, null, tag);
    containerInfo.current = isStrictMode;
    isStrictMode.stateNode = containerInfo;
    tag = createCache();
    tag.refCount++;
    containerInfo.pooledCache = tag;
    tag.refCount++;
    isStrictMode.memoizedState = {
      element: initialChildren,
      isDehydrated: hydrate,
      cache: tag
    };
    initializeUpdateQueue(isStrictMode);
    return containerInfo;
  }
  function getContextForSubtree(parentComponent) {
    if (!parentComponent) return emptyContextObject;
    parentComponent = emptyContextObject;
    return parentComponent;
  }
  function updateContainerImpl(rootFiber, lane, element, container2, parentComponent, callback) {
    parentComponent = getContextForSubtree(parentComponent);
    null === container2.context ? container2.context = parentComponent : container2.pendingContext = parentComponent;
    container2 = createUpdate2(lane);
    container2.payload = { element };
    callback = void 0 === callback ? null : callback;
    null !== callback && (container2.callback = callback);
    element = enqueueUpdate(rootFiber, container2, lane);
    null !== element && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane));
  }
  function markRetryLaneImpl(fiber, retryLane) {
    fiber = fiber.memoizedState;
    if (null !== fiber && null !== fiber.dehydrated) {
      var a = fiber.retryLane;
      fiber.retryLane = 0 !== a && a < retryLane ? a : retryLane;
    }
  }
  function markRetryLaneIfNotHydrated(fiber, retryLane) {
    markRetryLaneImpl(fiber, retryLane);
    (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
  }
  function attemptContinuousHydration(fiber) {
    if (13 === fiber.tag || 31 === fiber.tag) {
      var root2 = enqueueConcurrentRenderForLane(fiber, 67108864);
      null !== root2 && scheduleUpdateOnFiber(root2, fiber, 67108864);
      markRetryLaneIfNotHydrated(fiber, 67108864);
    }
  }
  function attemptHydrationAtCurrentPriority(fiber) {
    if (13 === fiber.tag || 31 === fiber.tag) {
      var lane = requestUpdateLane();
      lane = getBumpedLaneForHydrationByLane(lane);
      var root2 = enqueueConcurrentRenderForLane(fiber, lane);
      null !== root2 && scheduleUpdateOnFiber(root2, fiber, lane);
      markRetryLaneIfNotHydrated(fiber, lane);
    }
  }
  var _enabled = true;
  function dispatchDiscreteEvent(domEventName, eventSystemFlags, container2, nativeEvent) {
    var prevTransition = ReactSharedInternals.T;
    ReactSharedInternals.T = null;
    var previousPriority = ReactDOMSharedInternals.p;
    try {
      ReactDOMSharedInternals.p = 2, dispatchEvent(domEventName, eventSystemFlags, container2, nativeEvent);
    } finally {
      ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
    }
  }
  function dispatchContinuousEvent(domEventName, eventSystemFlags, container2, nativeEvent) {
    var prevTransition = ReactSharedInternals.T;
    ReactSharedInternals.T = null;
    var previousPriority = ReactDOMSharedInternals.p;
    try {
      ReactDOMSharedInternals.p = 8, dispatchEvent(domEventName, eventSystemFlags, container2, nativeEvent);
    } finally {
      ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
    }
  }
  function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
    if (_enabled) {
      var blockedOn = findInstanceBlockingEvent(nativeEvent);
      if (null === blockedOn)
        dispatchEventForPluginEventSystem(
          domEventName,
          eventSystemFlags,
          nativeEvent,
          return_targetInst,
          targetContainer
        ), clearIfContinuousEvent(domEventName, nativeEvent);
      else if (queueIfContinuousEvent(
        blockedOn,
        domEventName,
        eventSystemFlags,
        targetContainer,
        nativeEvent
      ))
        nativeEvent.stopPropagation();
      else if (clearIfContinuousEvent(domEventName, nativeEvent), eventSystemFlags & 4 && -1 < discreteReplayableEvents.indexOf(domEventName)) {
        for (; null !== blockedOn; ) {
          var fiber = getInstanceFromNode(blockedOn);
          if (null !== fiber)
            switch (fiber.tag) {
              case 3:
                fiber = fiber.stateNode;
                if (fiber.current.memoizedState.isDehydrated) {
                  var lanes = getHighestPriorityLanes(fiber.pendingLanes);
                  if (0 !== lanes) {
                    var root2 = fiber;
                    root2.pendingLanes |= 2;
                    for (root2.entangledLanes |= 2; lanes; ) {
                      var lane = 1 << 31 - clz32(lanes);
                      root2.entanglements[1] |= lane;
                      lanes &= ~lane;
                    }
                    ensureRootIsScheduled(fiber);
                    0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now2() + 500, flushSyncWorkAcrossRoots_impl(0));
                  }
                }
                break;
              case 31:
              case 13:
                root2 = enqueueConcurrentRenderForLane(fiber, 2), null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2), flushSyncWork$1(), markRetryLaneIfNotHydrated(fiber, 2);
            }
          fiber = findInstanceBlockingEvent(nativeEvent);
          null === fiber && dispatchEventForPluginEventSystem(
            domEventName,
            eventSystemFlags,
            nativeEvent,
            return_targetInst,
            targetContainer
          );
          if (fiber === blockedOn) break;
          blockedOn = fiber;
        }
        null !== blockedOn && nativeEvent.stopPropagation();
      } else
        dispatchEventForPluginEventSystem(
          domEventName,
          eventSystemFlags,
          nativeEvent,
          null,
          targetContainer
        );
    }
  }
  function findInstanceBlockingEvent(nativeEvent) {
    nativeEvent = getEventTarget(nativeEvent);
    return findInstanceBlockingTarget(nativeEvent);
  }
  var return_targetInst = null;
  function findInstanceBlockingTarget(targetNode) {
    return_targetInst = null;
    targetNode = getClosestInstanceFromNode(targetNode);
    if (null !== targetNode) {
      var nearestMounted = getNearestMountedFiber(targetNode);
      if (null === nearestMounted) targetNode = null;
      else {
        var tag = nearestMounted.tag;
        if (13 === tag) {
          targetNode = getSuspenseInstanceFromFiber(nearestMounted);
          if (null !== targetNode) return targetNode;
          targetNode = null;
        } else if (31 === tag) {
          targetNode = getActivityInstanceFromFiber(nearestMounted);
          if (null !== targetNode) return targetNode;
          targetNode = null;
        } else if (3 === tag) {
          if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
            return 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
          targetNode = null;
        } else nearestMounted !== targetNode && (targetNode = null);
      }
    }
    return_targetInst = targetNode;
    return null;
  }
  function getEventPriority(domEventName) {
    switch (domEventName) {
      case "beforetoggle":
      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 "toggle":
      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 2;
      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 "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 8;
      case "message":
        switch (getCurrentPriorityLevel()) {
          case ImmediatePriority:
            return 2;
          case UserBlockingPriority:
            return 8;
          case NormalPriority$1:
          case LowPriority:
            return 32;
          case IdlePriority:
            return 268435456;
          default:
            return 32;
        }
      default:
        return 32;
    }
  }
  var hasScheduledReplayAttempt = false, queuedFocus = null, queuedDrag = null, queuedMouse = null, queuedPointers = /* @__PURE__ */ new Map(), queuedPointerCaptures = /* @__PURE__ */ new Map(), queuedExplicitHydrationTargets = [], discreteReplayableEvents = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
    " "
  );
  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":
        queuedPointers.delete(nativeEvent.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        queuedPointerCaptures.delete(nativeEvent.pointerId);
    }
  }
  function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
    if (null === existingQueuedEvent || existingQueuedEvent.nativeEvent !== nativeEvent)
      return existingQueuedEvent = {
        blockedOn,
        domEventName,
        eventSystemFlags,
        nativeEvent,
        targetContainers: [targetContainer]
      }, null !== blockedOn && (blockedOn = getInstanceFromNode(blockedOn), null !== blockedOn && attemptContinuousHydration(blockedOn)), existingQueuedEvent;
    existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
    blockedOn = existingQueuedEvent.targetContainers;
    null !== targetContainer && -1 === blockedOn.indexOf(targetContainer) && blockedOn.push(targetContainer);
    return existingQueuedEvent;
  }
  function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
    switch (domEventName) {
      case "focusin":
        return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedFocus,
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        ), true;
      case "dragenter":
        return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedDrag,
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        ), true;
      case "mouseover":
        return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedMouse,
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        ), true;
      case "pointerover":
        var pointerId = nativeEvent.pointerId;
        queuedPointers.set(
          pointerId,
          accumulateOrCreateContinuousQueuedReplayableEvent(
            queuedPointers.get(pointerId) || null,
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          )
        );
        return true;
      case "gotpointercapture":
        return pointerId = nativeEvent.pointerId, queuedPointerCaptures.set(
          pointerId,
          accumulateOrCreateContinuousQueuedReplayableEvent(
            queuedPointerCaptures.get(pointerId) || null,
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          )
        ), true;
    }
    return false;
  }
  function attemptExplicitHydrationTarget(queuedTarget) {
    var targetInst = getClosestInstanceFromNode(queuedTarget.target);
    if (null !== targetInst) {
      var nearestMounted = getNearestMountedFiber(targetInst);
      if (null !== nearestMounted) {
        if (targetInst = nearestMounted.tag, 13 === targetInst) {
          if (targetInst = getSuspenseInstanceFromFiber(nearestMounted), null !== targetInst) {
            queuedTarget.blockedOn = targetInst;
            runWithPriority(queuedTarget.priority, function() {
              attemptHydrationAtCurrentPriority(nearestMounted);
            });
            return;
          }
        } else if (31 === targetInst) {
          if (targetInst = getActivityInstanceFromFiber(nearestMounted), null !== targetInst) {
            queuedTarget.blockedOn = targetInst;
            runWithPriority(queuedTarget.priority, function() {
              attemptHydrationAtCurrentPriority(nearestMounted);
            });
            return;
          }
        } else if (3 === targetInst && nearestMounted.stateNode.current.memoizedState.isDehydrated) {
          queuedTarget.blockedOn = 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
          return;
        }
      }
    }
    queuedTarget.blockedOn = null;
  }
  function attemptReplayContinuousQueuedEvent(queuedEvent) {
    if (null !== queuedEvent.blockedOn) return false;
    for (var targetContainers = queuedEvent.targetContainers; 0 < targetContainers.length; ) {
      var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
      if (null === nextBlockedOn) {
        nextBlockedOn = queuedEvent.nativeEvent;
        var nativeEventClone = new nextBlockedOn.constructor(
          nextBlockedOn.type,
          nextBlockedOn
        );
        currentReplayingEvent = nativeEventClone;
        nextBlockedOn.target.dispatchEvent(nativeEventClone);
        currentReplayingEvent = null;
      } else
        return targetContainers = getInstanceFromNode(nextBlockedOn), null !== targetContainers && attemptContinuousHydration(targetContainers), queuedEvent.blockedOn = nextBlockedOn, false;
      targetContainers.shift();
    }
    return true;
  }
  function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
    attemptReplayContinuousQueuedEvent(queuedEvent) && map.delete(key);
  }
  function replayUnblockedEvents() {
    hasScheduledReplayAttempt = false;
    null !== queuedFocus && attemptReplayContinuousQueuedEvent(queuedFocus) && (queuedFocus = null);
    null !== queuedDrag && attemptReplayContinuousQueuedEvent(queuedDrag) && (queuedDrag = null);
    null !== queuedMouse && attemptReplayContinuousQueuedEvent(queuedMouse) && (queuedMouse = null);
    queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
    queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
  }
  function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
    queuedEvent.blockedOn === unblocked && (queuedEvent.blockedOn = null, hasScheduledReplayAttempt || (hasScheduledReplayAttempt = true, Scheduler.unstable_scheduleCallback(
      Scheduler.unstable_NormalPriority,
      replayUnblockedEvents
    )));
  }
  var lastScheduledReplayQueue = null;
  function scheduleReplayQueueIfNeeded(formReplayingQueue) {
    lastScheduledReplayQueue !== formReplayingQueue && (lastScheduledReplayQueue = formReplayingQueue, Scheduler.unstable_scheduleCallback(
      Scheduler.unstable_NormalPriority,
      function() {
        lastScheduledReplayQueue === formReplayingQueue && (lastScheduledReplayQueue = null);
        for (var i = 0; i < formReplayingQueue.length; i += 3) {
          var form = formReplayingQueue[i], submitterOrAction = formReplayingQueue[i + 1], formData = formReplayingQueue[i + 2];
          if ("function" !== typeof submitterOrAction)
            if (null === findInstanceBlockingTarget(submitterOrAction || form))
              continue;
            else break;
          var formInst = getInstanceFromNode(form);
          null !== formInst && (formReplayingQueue.splice(i, 3), i -= 3, startHostTransition(
            formInst,
            {
              pending: true,
              data: formData,
              method: form.method,
              action: submitterOrAction
            },
            submitterOrAction,
            formData
          ));
        }
      }
    ));
  }
  function retryIfBlockedOn(unblocked) {
    function unblock(queuedEvent) {
      return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
    }
    null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
    null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
    null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
    queuedPointers.forEach(unblock);
    queuedPointerCaptures.forEach(unblock);
    for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
      var queuedTarget = queuedExplicitHydrationTargets[i];
      queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
    }
    for (; 0 < queuedExplicitHydrationTargets.length && (i = queuedExplicitHydrationTargets[0], null === i.blockedOn); )
      attemptExplicitHydrationTarget(i), null === i.blockedOn && queuedExplicitHydrationTargets.shift();
    i = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
    if (null != i)
      for (queuedTarget = 0; queuedTarget < i.length; queuedTarget += 3) {
        var form = i[queuedTarget], submitterOrAction = i[queuedTarget + 1], formProps = form[internalPropsKey] || null;
        if ("function" === typeof submitterOrAction)
          formProps || scheduleReplayQueueIfNeeded(i);
        else if (formProps) {
          var action = null;
          if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
            if (form = submitterOrAction, formProps = submitterOrAction[internalPropsKey] || null)
              action = formProps.formAction;
            else {
              if (null !== findInstanceBlockingTarget(form)) continue;
            }
          else action = formProps.action;
          "function" === typeof action ? i[queuedTarget + 1] = action : (i.splice(queuedTarget, 3), queuedTarget -= 3);
          scheduleReplayQueueIfNeeded(i);
        }
      }
  }
  function defaultOnDefaultTransitionIndicator() {
    function handleNavigate(event) {
      event.canIntercept && "react-transition" === event.info && event.intercept({
        handler: function() {
          return new Promise(function(resolve) {
            return pendingResolve = resolve;
          });
        },
        focusReset: "manual",
        scroll: "manual"
      });
    }
    function handleNavigateComplete() {
      null !== pendingResolve && (pendingResolve(), pendingResolve = null);
      isCancelled || setTimeout(startFakeNavigation, 20);
    }
    function startFakeNavigation() {
      if (!isCancelled && !navigation.transition) {
        var currentEntry = navigation.currentEntry;
        currentEntry && null != currentEntry.url && navigation.navigate(currentEntry.url, {
          state: currentEntry.getState(),
          info: "react-transition",
          history: "replace"
        });
      }
    }
    if ("object" === typeof navigation) {
      var isCancelled = false, pendingResolve = null;
      navigation.addEventListener("navigate", handleNavigate);
      navigation.addEventListener("navigatesuccess", handleNavigateComplete);
      navigation.addEventListener("navigateerror", handleNavigateComplete);
      setTimeout(startFakeNavigation, 100);
      return function() {
        isCancelled = true;
        navigation.removeEventListener("navigate", handleNavigate);
        navigation.removeEventListener("navigatesuccess", handleNavigateComplete);
        navigation.removeEventListener("navigateerror", handleNavigateComplete);
        null !== pendingResolve && (pendingResolve(), pendingResolve = null);
      };
    }
  }
  function ReactDOMRoot(internalRoot) {
    this._internalRoot = internalRoot;
  }
  ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
    var root2 = this._internalRoot;
    if (null === root2) throw Error(formatProdErrorMessage(409));
    var current = root2.current, lane = requestUpdateLane();
    updateContainerImpl(current, lane, children, root2, null, null);
  };
  ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
    var root2 = this._internalRoot;
    if (null !== root2) {
      this._internalRoot = null;
      var container2 = root2.containerInfo;
      updateContainerImpl(root2.current, 2, null, root2, null, null);
      flushSyncWork$1();
      container2[internalContainerInstanceKey] = null;
    }
  };
  function ReactDOMHydrationRoot(internalRoot) {
    this._internalRoot = internalRoot;
  }
  ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function(target) {
    if (target) {
      var updatePriority = resolveUpdatePriority();
      target = { blockedOn: null, target, priority: updatePriority };
      for (var i = 0; i < queuedExplicitHydrationTargets.length && 0 !== updatePriority && updatePriority < queuedExplicitHydrationTargets[i].priority; i++) ;
      queuedExplicitHydrationTargets.splice(i, 0, target);
      0 === i && attemptExplicitHydrationTarget(target);
    }
  };
  var isomorphicReactPackageVersion$jscomp$inline_1840 = React2.version;
  if ("19.2.0" !== isomorphicReactPackageVersion$jscomp$inline_1840)
    throw Error(
      formatProdErrorMessage(
        527,
        isomorphicReactPackageVersion$jscomp$inline_1840,
        "19.2.0"
      )
    );
  ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
    var fiber = componentOrElement._reactInternals;
    if (void 0 === fiber) {
      if ("function" === typeof componentOrElement.render)
        throw Error(formatProdErrorMessage(188));
      componentOrElement = Object.keys(componentOrElement).join(",");
      throw Error(formatProdErrorMessage(268, componentOrElement));
    }
    componentOrElement = findCurrentFiberUsingSlowPath(fiber);
    componentOrElement = null !== componentOrElement ? findCurrentHostFiberImpl(componentOrElement) : null;
    componentOrElement = null === componentOrElement ? null : componentOrElement.stateNode;
    return componentOrElement;
  };
  var internals$jscomp$inline_2347 = {
    bundleType: 0,
    version: "19.2.0",
    rendererPackageName: "react-dom",
    currentDispatcherRef: ReactSharedInternals,
    reconcilerVersion: "19.2.0"
  };
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
    var hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!hook$jscomp$inline_2348.isDisabled && hook$jscomp$inline_2348.supportsFiber)
      try {
        rendererID = hook$jscomp$inline_2348.inject(
          internals$jscomp$inline_2347
        ), injectedHook = hook$jscomp$inline_2348;
      } catch (err) {
      }
  }
  reactDomClient_production.createRoot = function(container2, options2) {
    if (!isValidContainer(container2)) throw Error(formatProdErrorMessage(299));
    var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError;
    null !== options2 && void 0 !== options2 && (true === options2.unstable_strictMode && (isStrictMode = true), void 0 !== options2.identifierPrefix && (identifierPrefix = options2.identifierPrefix), void 0 !== options2.onUncaughtError && (onUncaughtError = options2.onUncaughtError), void 0 !== options2.onCaughtError && (onCaughtError = options2.onCaughtError), void 0 !== options2.onRecoverableError && (onRecoverableError = options2.onRecoverableError));
    options2 = createFiberRoot(
      container2,
      1,
      false,
      null,
      null,
      isStrictMode,
      identifierPrefix,
      null,
      onUncaughtError,
      onCaughtError,
      onRecoverableError,
      defaultOnDefaultTransitionIndicator
    );
    container2[internalContainerInstanceKey] = options2.current;
    listenToAllSupportedEvents(container2);
    return new ReactDOMRoot(options2);
  };
  reactDomClient_production.hydrateRoot = function(container2, initialChildren, options2) {
    if (!isValidContainer(container2)) throw Error(formatProdErrorMessage(299));
    var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, formState = null;
    null !== options2 && void 0 !== options2 && (true === options2.unstable_strictMode && (isStrictMode = true), void 0 !== options2.identifierPrefix && (identifierPrefix = options2.identifierPrefix), void 0 !== options2.onUncaughtError && (onUncaughtError = options2.onUncaughtError), void 0 !== options2.onCaughtError && (onCaughtError = options2.onCaughtError), void 0 !== options2.onRecoverableError && (onRecoverableError = options2.onRecoverableError), void 0 !== options2.formState && (formState = options2.formState));
    initialChildren = createFiberRoot(
      container2,
      1,
      true,
      initialChildren,
      null != options2 ? options2 : null,
      isStrictMode,
      identifierPrefix,
      formState,
      onUncaughtError,
      onCaughtError,
      onRecoverableError,
      defaultOnDefaultTransitionIndicator
    );
    initialChildren.context = getContextForSubtree(null);
    options2 = initialChildren.current;
    isStrictMode = requestUpdateLane();
    isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
    identifierPrefix = createUpdate2(isStrictMode);
    identifierPrefix.callback = null;
    enqueueUpdate(options2, identifierPrefix, isStrictMode);
    options2 = isStrictMode;
    initialChildren.current.lanes = options2;
    markRootUpdated$1(initialChildren, options2);
    ensureRootIsScheduled(initialChildren);
    container2[internalContainerInstanceKey] = initialChildren.current;
    listenToAllSupportedEvents(container2);
    return new ReactDOMHydrationRoot(initialChildren);
  };
  reactDomClient_production.version = "19.2.0";
  return reactDomClient_production;
}
var hasRequiredClient;
function requireClient() {
  if (hasRequiredClient) return client.exports;
  hasRequiredClient = 1;
  function checkDCE() {
    if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
      return;
    }
    try {
      __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
    } catch (err) {
      console.error(err);
    }
  }
  {
    checkDCE();
    client.exports = requireReactDomClient_production();
  }
  return client.exports;
}
var clientExports = requireClient();
function Provider(_ref) {
  var store = _ref.store, context = _ref.context, children = _ref.children;
  var contextValue = reactExports.useMemo(function() {
    var subscription = createSubscription(store);
    subscription.onStateChange = subscription.notifyNestedSubs;
    return {
      store,
      subscription
    };
  }, [store]);
  var previousState = reactExports.useMemo(function() {
    return store.getState();
  }, [store]);
  useIsomorphicLayoutEffect(function() {
    var subscription = contextValue.subscription;
    subscription.trySubscribe();
    if (previousState !== store.getState()) {
      subscription.notifyNestedSubs();
    }
    return function() {
      subscription.tryUnsubscribe();
      subscription.onStateChange = null;
    };
  }, [contextValue, previousState]);
  var Context = context || ReactReduxContext;
  return /* @__PURE__ */ React.createElement(Context.Provider, {
    value: contextValue
  }, children);
}
function _extends$3() {
  return _extends$3 = Object.assign ? Object.assign.bind() : function(n) {
    for (var e2 = 1; e2 < arguments.length; e2++) {
      var t = arguments[e2];
      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }, _extends$3.apply(null, arguments);
}
function _typeof$1(obj) {
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof$1 = function _typeof2(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof$1 = function _typeof2(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof$1(obj);
}
function ownKeys$2(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    });
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread$2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    if (i % 2) {
      ownKeys$2(source, true).forEach(function(key) {
        _defineProperty$3(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys$2(source).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function _defineProperty$3(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {
  _ref.debug;
  var newState = _objectSpread$2({}, reducedState);
  if (inboundState && _typeof$1(inboundState) === "object") {
    Object.keys(inboundState).forEach(function(key) {
      if (key === "_persist") return;
      if (originalState[key] !== reducedState[key]) {
        return;
      }
      newState[key] = inboundState[key];
    });
  }
  return newState;
}
function createPersistoid(config2) {
  var blacklist = config2.blacklist || null;
  var whitelist = config2.whitelist || null;
  var transforms = config2.transforms || [];
  var throttle = config2.throttle || 0;
  var storageKey = "".concat(config2.keyPrefix !== void 0 ? config2.keyPrefix : KEY_PREFIX).concat(config2.key);
  var storage2 = config2.storage;
  var serialize;
  if (config2.serialize === false) {
    serialize = function serialize2(x) {
      return x;
    };
  } else if (typeof config2.serialize === "function") {
    serialize = config2.serialize;
  } else {
    serialize = defaultSerialize;
  }
  var writeFailHandler = config2.writeFailHandler || null;
  var lastState = {};
  var stagedState = {};
  var keysToProcess = [];
  var timeIterator = null;
  var writePromise = null;
  var update2 = function update22(state) {
    Object.keys(state).forEach(function(key) {
      if (!passWhitelistBlacklist(key)) return;
      if (lastState[key] === state[key]) return;
      if (keysToProcess.indexOf(key) !== -1) return;
      keysToProcess.push(key);
    });
    Object.keys(lastState).forEach(function(key) {
      if (state[key] === void 0 && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== void 0) {
        keysToProcess.push(key);
      }
    });
    if (timeIterator === null) {
      timeIterator = setInterval(processNextKey, throttle);
    }
    lastState = state;
  };
  function processNextKey() {
    if (keysToProcess.length === 0) {
      if (timeIterator) clearInterval(timeIterator);
      timeIterator = null;
      return;
    }
    var key = keysToProcess.shift();
    var endState = transforms.reduce(function(subState, transformer) {
      return transformer.in(subState, key, lastState);
    }, lastState[key]);
    if (endState !== void 0) {
      try {
        stagedState[key] = serialize(endState);
      } catch (err) {
        console.error("redux-persist/createPersistoid: error serializing state", err);
      }
    } else {
      delete stagedState[key];
    }
    if (keysToProcess.length === 0) {
      writeStagedState();
    }
  }
  function writeStagedState() {
    Object.keys(stagedState).forEach(function(key) {
      if (lastState[key] === void 0) {
        delete stagedState[key];
      }
    });
    writePromise = storage2.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);
  }
  function passWhitelistBlacklist(key) {
    if (whitelist && whitelist.indexOf(key) === -1 && key !== "_persist") return false;
    if (blacklist && blacklist.indexOf(key) !== -1) return false;
    return true;
  }
  function onWriteFail(err) {
    if (writeFailHandler) writeFailHandler(err);
  }
  var flush2 = function flush22() {
    while (keysToProcess.length !== 0) {
      processNextKey();
    }
    return writePromise || Promise.resolve();
  };
  return {
    update: update2,
    flush: flush2
  };
}
function defaultSerialize(data) {
  return JSON.stringify(data);
}
function getStoredState(config2) {
  var transforms = config2.transforms || [];
  var storageKey = "".concat(config2.keyPrefix !== void 0 ? config2.keyPrefix : KEY_PREFIX).concat(config2.key);
  var storage2 = config2.storage;
  config2.debug;
  var deserialize;
  if (config2.deserialize === false) {
    deserialize = function deserialize2(x) {
      return x;
    };
  } else if (typeof config2.deserialize === "function") {
    deserialize = config2.deserialize;
  } else {
    deserialize = defaultDeserialize;
  }
  return storage2.getItem(storageKey).then(function(serialized) {
    if (!serialized) return void 0;
    else {
      try {
        var state = {};
        var rawState = deserialize(serialized);
        Object.keys(rawState).forEach(function(key) {
          state[key] = transforms.reduceRight(function(subState, transformer) {
            return transformer.out(subState, key, rawState);
          }, deserialize(rawState[key]));
        });
        return state;
      } catch (err) {
        throw err;
      }
    }
  });
}
function defaultDeserialize(serial) {
  return JSON.parse(serial);
}
function purgeStoredState(config2) {
  var storage2 = config2.storage;
  var storageKey = "".concat(config2.keyPrefix !== void 0 ? config2.keyPrefix : KEY_PREFIX).concat(config2.key);
  return storage2.removeItem(storageKey, warnIfRemoveError);
}
function warnIfRemoveError(err) {
}
function ownKeys$1(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    });
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread$1(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    if (i % 2) {
      ownKeys$1(source, true).forEach(function(key) {
        _defineProperty$2(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys$1(source).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function _defineProperty$2(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose$2(source, excluded);
  var key, i;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose$2(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}
var DEFAULT_TIMEOUT = 5e3;
function persistReducer(config2, baseReducer) {
  var version = config2.version !== void 0 ? config2.version : DEFAULT_VERSION;
  config2.debug || false;
  var stateReconciler = config2.stateReconciler === void 0 ? autoMergeLevel1 : config2.stateReconciler;
  var getStoredState$1 = config2.getStoredState || getStoredState;
  var timeout = config2.timeout !== void 0 ? config2.timeout : DEFAULT_TIMEOUT;
  var _persistoid = null;
  var _purge = false;
  var _paused = true;
  var conditionalUpdate = function conditionalUpdate2(state) {
    state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state);
    return state;
  };
  return function(state, action) {
    var _ref = state || {}, _persist = _ref._persist, rest = _objectWithoutProperties(_ref, ["_persist"]);
    var restState = rest;
    if (action.type === PERSIST) {
      var _sealed = false;
      var _rehydrate = function _rehydrate2(payload, err) {
        if (!_sealed) {
          action.rehydrate(config2.key, payload, err);
          _sealed = true;
        }
      };
      timeout && setTimeout(function() {
        !_sealed && _rehydrate(void 0, new Error('redux-persist: persist timed out for persist key "'.concat(config2.key, '"')));
      }, timeout);
      _paused = false;
      if (!_persistoid) _persistoid = createPersistoid(config2);
      if (_persist) {
        return _objectSpread$1({}, baseReducer(restState, action), {
          _persist
        });
      }
      if (typeof action.rehydrate !== "function" || typeof action.register !== "function") throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");
      action.register(config2.key);
      getStoredState$1(config2).then(function(restoredState) {
        var migrate = config2.migrate || function(s, v2) {
          return Promise.resolve(s);
        };
        migrate(restoredState, version).then(function(migratedState) {
          _rehydrate(migratedState);
        }, function(migrateErr) {
          _rehydrate(void 0, migrateErr);
        });
      }, function(err) {
        _rehydrate(void 0, err);
      });
      return _objectSpread$1({}, baseReducer(restState, action), {
        _persist: {
          version,
          rehydrated: false
        }
      });
    } else if (action.type === PURGE) {
      _purge = true;
      action.result(purgeStoredState(config2));
      return _objectSpread$1({}, baseReducer(restState, action), {
        _persist
      });
    } else if (action.type === FLUSH) {
      action.result(_persistoid && _persistoid.flush());
      return _objectSpread$1({}, baseReducer(restState, action), {
        _persist
      });
    } else if (action.type === PAUSE) {
      _paused = true;
    } else if (action.type === REHYDRATE) {
      if (_purge) return _objectSpread$1({}, restState, {
        _persist: _objectSpread$1({}, _persist, {
          rehydrated: true
        })
        // @NOTE if key does not match, will continue to default else below
      });
      if (action.key === config2.key) {
        var reducedState = baseReducer(restState, action);
        var inboundState = action.payload;
        var reconciledRest = stateReconciler !== false && inboundState !== void 0 ? stateReconciler(inboundState, state, reducedState, config2) : reducedState;
        var _newState = _objectSpread$1({}, reconciledRest, {
          _persist: _objectSpread$1({}, _persist, {
            rehydrated: true
          })
        });
        return conditionalUpdate(_newState);
      }
    }
    if (!_persist) return baseReducer(state, action);
    var newState = baseReducer(restState, action);
    if (newState === restState) return state;
    return conditionalUpdate(_objectSpread$1({}, newState, {
      _persist
    }));
  };
}
function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance");
}
function _iterableToArray(iter) {
  if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
}
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    });
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    if (i % 2) {
      ownKeys(source, true).forEach(function(key) {
        _defineProperty$1(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(source).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function _defineProperty$1(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var initialState = {
  registry: [],
  bootstrapped: false
};
var persistorReducer = function persistorReducer2() {
  var state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : initialState;
  var action = arguments.length > 1 ? arguments[1] : void 0;
  switch (action.type) {
    case REGISTER:
      return _objectSpread({}, state, {
        registry: [].concat(_toConsumableArray(state.registry), [action.key])
      });
    case REHYDRATE:
      var firstIndex = state.registry.indexOf(action.key);
      var registry = _toConsumableArray(state.registry);
      registry.splice(firstIndex, 1);
      return _objectSpread({}, state, {
        registry,
        bootstrapped: registry.length === 0
      });
    default:
      return state;
  }
};
function persistStore(store, options, cb) {
  var _pStore = createStore(persistorReducer, initialState, void 0);
  var register = function register2(key) {
    _pStore.dispatch({
      type: REGISTER,
      key
    });
  };
  var rehydrate = function rehydrate2(key, payload, err) {
    var rehydrateAction = {
      type: REHYDRATE,
      payload,
      err,
      key
      // dispatch to `store` to rehydrate and `persistor` to track result
    };
    store.dispatch(rehydrateAction);
    _pStore.dispatch(rehydrateAction);
  };
  var persistor = _objectSpread({}, _pStore, {
    purge: function purge() {
      var results = [];
      store.dispatch({
        type: PURGE,
        result: function result(purgeResult) {
          results.push(purgeResult);
        }
      });
      return Promise.all(results);
    },
    flush: function flush2() {
      var results = [];
      store.dispatch({
        type: FLUSH,
        result: function result(flushResult) {
          results.push(flushResult);
        }
      });
      return Promise.all(results);
    },
    pause: function pause() {
      store.dispatch({
        type: PAUSE
      });
    },
    persist: function persist2() {
      store.dispatch({
        type: PERSIST,
        register,
        rehydrate
      });
    }
  });
  {
    persistor.persist();
  }
  return persistor;
}
function _typeof(obj) {
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof2(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof = function _typeof2(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  return Constructor;
}
function _possibleConstructorReturn(self2, call2) {
  if (call2 && (_typeof(call2) === "object" || typeof call2 === "function")) {
    return call2;
  }
  return _assertThisInitialized$1(self2);
}
function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf(o);
}
function _assertThisInitialized$1(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
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 } });
  if (superClass) _setPrototypeOf$1(subClass, superClass);
}
function _setPrototypeOf$1(o, p) {
  _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf$1(o, p);
}
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var PersistGate = /* @__PURE__ */ (function(_PureComponent) {
  _inherits(PersistGate2, _PureComponent);
  function PersistGate2() {
    var _getPrototypeOf2;
    var _this;
    _classCallCheck(this, PersistGate2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PersistGate2)).call.apply(_getPrototypeOf2, [this].concat(args)));
    _defineProperty(_assertThisInitialized$1(_this), "state", {
      bootstrapped: false
    });
    _defineProperty(_assertThisInitialized$1(_this), "_unsubscribe", void 0);
    _defineProperty(_assertThisInitialized$1(_this), "handlePersistorState", function() {
      var persistor = _this.props.persistor;
      var _persistor$getState = persistor.getState(), bootstrapped = _persistor$getState.bootstrapped;
      if (bootstrapped) {
        if (_this.props.onBeforeLift) {
          Promise.resolve(_this.props.onBeforeLift()).finally(function() {
            return _this.setState({
              bootstrapped: true
            });
          });
        } else {
          _this.setState({
            bootstrapped: true
          });
        }
        _this._unsubscribe && _this._unsubscribe();
      }
    });
    return _this;
  }
  _createClass(PersistGate2, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState);
      this.handlePersistorState();
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this._unsubscribe && this._unsubscribe();
    }
  }, {
    key: "render",
    value: function render() {
      if (typeof this.props.children === "function") {
        return this.props.children(this.state.bootstrapped);
      }
      return this.state.bootstrapped ? this.props.children : this.props.loading;
    }
  }]);
  return PersistGate2;
})(reactExports.PureComponent);
_defineProperty(PersistGate, "defaultProps", {
  children: null,
  loading: null
});
var storage$1 = {};
var createWebStorage = {};
var getStorage = {};
var hasRequiredGetStorage;
function requireGetStorage() {
  if (hasRequiredGetStorage) return getStorage;
  hasRequiredGetStorage = 1;
  getStorage.__esModule = true;
  getStorage.default = getStorage$1;
  function _typeof2(obj) {
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof2 = function _typeof22(obj2) {
        return typeof obj2;
      };
    } else {
      _typeof2 = function _typeof22(obj2) {
        return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
      };
    }
    return _typeof2(obj);
  }
  function noop2() {
  }
  var noopStorage = {
    getItem: noop2,
    setItem: noop2,
    removeItem: noop2
  };
  function hasStorage(storageType) {
    if ((typeof self === "undefined" ? "undefined" : _typeof2(self)) !== "object" || !(storageType in self)) {
      return false;
    }
    try {
      var storage2 = self[storageType];
      var testKey = "redux-persist ".concat(storageType, " test");
      storage2.setItem(testKey, "test");
      storage2.getItem(testKey);
      storage2.removeItem(testKey);
    } catch (e2) {
      return false;
    }
    return true;
  }
  function getStorage$1(type) {
    var storageType = "".concat(type, "Storage");
    if (hasStorage(storageType)) return self[storageType];
    else {
      return noopStorage;
    }
  }
  return getStorage;
}
var hasRequiredCreateWebStorage;
function requireCreateWebStorage() {
  if (hasRequiredCreateWebStorage) return createWebStorage;
  hasRequiredCreateWebStorage = 1;
  createWebStorage.__esModule = true;
  createWebStorage.default = createWebStorage$1;
  var _getStorage = _interopRequireDefault(requireGetStorage());
  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : { default: obj };
  }
  function createWebStorage$1(type) {
    var storage2 = (0, _getStorage.default)(type);
    return {
      getItem: function getItem(key) {
        return new Promise(function(resolve, reject) {
          resolve(storage2.getItem(key));
        });
      },
      setItem: function setItem(key, item) {
        return new Promise(function(resolve, reject) {
          resolve(storage2.setItem(key, item));
        });
      },
      removeItem: function removeItem(key) {
        return new Promise(function(resolve, reject) {
          resolve(storage2.removeItem(key));
        });
      }
    };
  }
  return createWebStorage;
}
var hasRequiredStorage;
function requireStorage() {
  if (hasRequiredStorage) return storage$1;
  hasRequiredStorage = 1;
  storage$1.__esModule = true;
  storage$1.default = void 0;
  var _createWebStorage = _interopRequireDefault(requireCreateWebStorage());
  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : { default: obj };
  }
  var _default = (0, _createWebStorage.default)("local");
  storage$1.default = _default;
  return storage$1;
}
var storageExports = requireStorage();
const storage = /* @__PURE__ */ getDefaultExportFromCjs(storageExports);
const reducers = combineReducers({
  app: AppReducer,
  post: PostReducer
});
const persist = {
  key: "rankingcoach_persist",
  whitelist: [""],
  storage,
  timeout: 1
};
const MiddleWareConfig = (getDefaultMiddleware) => getDefaultMiddleware({
  serializableCheck: {
    ignoredActionPaths: ["register", "rehydrate"]
  }
});
const Reducer = persistReducer(persist, reducers);
const MainStore = configureStore({
  reducer: Reducer,
  middleware: MiddleWareConfig
});
const MainStorePersistor = persistStore(MainStore);
if (typeof window !== "undefined") {
  window.rankingCoachStore = MainStore;
}
const translationModules = /* @__PURE__ */ Object.assign({ "../../../languages/json/beyondseo-de_DE.json": () => __vitePreload(() => import("./beyondseo-de_DE.BRbNIZ8Q.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-el_GR.json": () => __vitePreload(() => import("./beyondseo-el_GR.C_HtEW5I.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-en_US.json": () => __vitePreload(() => import("./beyondseo-en_US.DilOTOpk.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-es_ES.json": () => __vitePreload(() => import("./beyondseo-es_ES.zQXB1r5h.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-fi_FI.json": () => __vitePreload(() => import("./beyondseo-fi_FI.W0onN6u0.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-fr_FR.json": () => __vitePreload(() => import("./beyondseo-fr_FR.DYEP52Pu.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-id_ID.json": () => __vitePreload(() => import("./beyondseo-id_ID.ggGZAPyY.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-it_IT.json": () => __vitePreload(() => import("./beyondseo-it_IT.omdyIXwJ.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-ja_JP.json": () => __vitePreload(() => import("./beyondseo-ja_JP.C_NPoyCl.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-nl_NL.json": () => __vitePreload(() => import("./beyondseo-nl_NL.D_ikuAtg.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-pl_PL.json": () => __vitePreload(() => import("./beyondseo-pl_PL.Bj4_Y3lV.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-pt_BR.json": () => __vitePreload(() => import("./beyondseo-pt_BR.CNIjrP5x.js"), true ? [] : void 0, import.meta.url), "../../../languages/json/beyondseo-sv_SE.json": () => __vitePreload(() => import("./beyondseo-sv_SE.Ig9jBM5K.js"), true ? [] : void 0, import.meta.url) });
const useLocaleLoader = () => {
  const [isLocaleReady, setIsLocaleReady] = reactExports.useState(false);
  reactExports.useEffect(() => {
    var _a2, _b2;
    const locale = ((_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.locale) || "en_US";
    const langCode = locale.replace("-", "_");
    const translationPath = `../../../languages/json/beyondseo-${langCode}.json`;
    const loadModule = translationModules[translationPath];
    if (loadModule) {
      loadModule().then((jsonModule) => {
        const moduleWithDefault = jsonModule;
        setLocaleData(moduleWithDefault.default, "beyondseo");
        setIsLocaleReady(true);
      }).catch((err) => {
        console.warn(`Failed to load translation JSON for ${langCode}`, err);
        setIsLocaleReady(true);
      });
    } else {
      console.warn(`Translation JSON for ${langCode} not found. Available translations:`, Object.keys(translationModules));
      setIsLocaleReady(true);
    }
  }, []);
  return isLocaleReady;
};
const seoScoreCellWrapper = "SeoScoreCell-module__seoScoreCellWrapper___JojsC";
const assistantCell = "SeoScoreCell-module__assistantCell___06yRM";
const scoreContainer$1 = "SeoScoreCell-module__scoreContainer___2u5Ji";
const issuesContainer = "SeoScoreCell-module__issuesContainer___JaM76";
const icon = "SeoScoreCell-module__icon___sZwGn";
const score = "SeoScoreCell-module__score___zy5Oa";
const popup = "SeoScoreCell-module__popup___t779x";
const popupInner = "SeoScoreCell-module__popupInner___ztV-9";
const recommendations = "SeoScoreCell-module__recommendations___Jd11n";
const iconText = "SeoScoreCell-module__iconText___TRAj8";
const recomandationsCount = "SeoScoreCell-module__recomandationsCount___qPVPO";
const success$1 = "SeoScoreCell-module__success___P2blY";
const warning = "SeoScoreCell-module__warning___-aQYs";
const styles$r = {
  seoScoreCellWrapper,
  assistantCell,
  scoreContainer: scoreContainer$1,
  issuesContainer,
  icon,
  score,
  popup,
  popupInner,
  recommendations,
  iconText,
  recomandationsCount,
  success: success$1,
  warning
};
const activationContainer = "Activation-module__activation-container___f8tFC";
const headerSection$2 = "Activation-module__header-section___7oBPo";
const logo$3 = "Activation-module__logo___KVdFd";
const topDivider$2 = "Activation-module__top-divider___uoypM";
const activationContent = "Activation-module__activation-content___S1LQS";
const authTitle$1 = "Activation-module__auth-title___OQL-3";
const authDescription$1 = "Activation-module__auth-description___3WVui";
const activationInput = "Activation-module__activation-input___fIqtA";
const codeError = "Activation-module__code-error___2wJIS";
const termsContainer$1 = "Activation-module__terms-container___6sIfq";
const errorIcon = "Activation-module__error-icon___GhJnI";
const bottomDivider$2 = "Activation-module__bottom-divider___nFigT";
const footerSection$2 = "Activation-module__footer-section___G6iRj";
const styles$q = {
  activationContainer,
  headerSection: headerSection$2,
  logo: logo$3,
  topDivider: topDivider$2,
  activationContent,
  authTitle: authTitle$1,
  authDescription: authDescription$1,
  activationInput,
  codeError,
  termsContainer: termsContainer$1,
  errorIcon,
  bottomDivider: bottomDivider$2,
  footerSection: footerSection$2
};
const beyondSEOLogo = "" + new URL("assets/beyondSEO-logo-BxalXM0R.svg", import.meta.url).href;
const Activation = ({ isPluginLoading }) => {
  const rcData = window.rankingCoachReactData || {};
  const ACTIVATE_URL = `${rcData.endpoint || ""}/account/activate`;
  const ONBOARDING_URL2 = `${rcData.adminurl || "admin.php"}?page=rankingcoach-onboarding&skipWelcomeScreen=1`;
  const locale = rcData.locale || "";
  const SUPPORT_URL = locale.startsWith("de") ? "https://mein.ionos.de/support/contact" : "https://my.ionos.com/support/contact";
  const [view, setView] = reactExports.useState("form");
  const [activationCode, setActivationCode] = reactExports.useState("");
  const [commOptIn, setCommOptIn] = reactExports.useState(false);
  const [errorMessage, setErrorMessage] = reactExports.useState("");
  const [isLoading, setIsLoading] = reactExports.useState(false);
  const [codeError2, setCodeError] = reactExports.useState("");
  reactExports.useEffect(() => {
    if (view !== "success") return;
    const timer = setTimeout(() => {
      window.location.href = ONBOARDING_URL2;
    }, 5e3);
    return () => clearTimeout(timer);
  }, [view]);
  const handleSubmit = async () => {
    if (!commOptIn || isLoading) return;
    if (activationCode.trim() === "") {
      setCodeError(__("Activation code is required.", "beyondseo"));
      return;
    }
    setCodeError("");
    setIsLoading(true);
    try {
      const res = await fetch(ACTIVATE_URL, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "X-WP-Nonce": rcData.restNonce || ""
        },
        body: JSON.stringify({ activationCode: activationCode.trim(), commOptIn })
      });
      const data = await res.json();
      if (data.success === true) {
        setView("success");
      } else {
        setErrorMessage(data.message || __("Activation failed.", "beyondseo"));
        setView("error");
      }
    } catch (e2) {
      setErrorMessage(__("An unexpected error occurred.", "beyondseo"));
      setView("error");
    } finally {
      setIsLoading(false);
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$q.activationContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.headerSection, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.logo, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: beyondSEOLogo, alt: "BeyondSEO" }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.topDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$q.activationContent, children: [
      view === "form" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          nr,
          {
            type: Er.heading1,
            fontWeight: si.bold,
            className: styles$q.authTitle,
            children: __("Enter your activation code", "beyondseo")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          nr,
          {
            type: Er.text,
            className: styles$q.authDescription,
            children: __("Enter the activation code provided by your provider.", "beyondseo")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          L8e,
          {
            label: __("Activation Code", "beyondseo"),
            required: true,
            value: activationCode,
            onChange: (e2) => setActivationCode(e2.target.value),
            placeholder: __("Enter your activation code", "beyondseo"),
            type: "text",
            className: styles$q.activationInput
          }
        ),
        codeError2 && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$q.codeError, children: codeError2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.termsContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          r9e,
          {
            checked: commOptIn,
            onChange: (e2) => setCommOptIn(e2.target.checked),
            label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
              __("I agree that the BeyondSEO plugin may create/authenticate my account and communicate with rankingCoach servers to provide its services. I have read and accept the ", "beyondseo"),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { href: "https://www.rankingcoach.com/en-us/privacy-policy", target: "_blank", rel: "noopener noreferrer", children: __("Privacy Policy", "beyondseo") }),
              __(" and the ", "beyondseo"),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { href: "https://www.rankingcoach.com/en-us/terms-and-conditions", target: "_blank", rel: "noopener noreferrer", children: __("Terms and Conditions", "beyondseo") }),
              "."
            ] })
          }
        ) })
      ] }),
      view === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.errorIcon, children: "!" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$q.authDescription, children: errorMessage }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { href: SUPPORT_URL, target: "_blank", rel: "noopener noreferrer", children: __("Contact support", "beyondseo") })
      ] }),
      view === "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          nr,
          {
            type: Er.heading1,
            fontWeight: si.bold,
            className: styles$q.authTitle,
            children: __("Activation done", "beyondseo")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$q.authDescription, children: __("You will be automatically redirected in 5 seconds...", "beyondseo") })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.bottomDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$q.footerSection, children: [
      view === "form" && /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.medium,
          onClick: handleSubmit,
          disabled: !commOptIn || isLoading,
          isLoading,
          "aria-busy": isLoading,
          children: __("Activate", "beyondseo")
        }
      ),
      view === "error" && /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.medium,
          onClick: () => setView("form"),
          children: __("Try another code", "beyondseo")
        }
      ),
      view === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.medium,
          onClick: () => {
            window.location.href = ONBOARDING_URL2;
          },
          children: __("Continue onboarding", "beyondseo")
        }
      )
    ] })
  ] });
};
const onboardingContainer = "Onboarding-module__onboarding-container___ffy4o";
const styles$p = {
  onboardingContainer
};
const onboardingWelcomeContainer = "OnboardingWelcome-module__onboarding-welcome-container___TOI-9";
const step2 = "OnboardingWelcome-module__step2___7MnOF";
const finalStep = "OnboardingWelcome-module__final-step___VWqP0";
const loaderComponent = "OnboardingWelcome-module__loader-component___o0EDP";
const sliderComponent$1 = "OnboardingWelcome-module__slider-component___IFshZ";
const buttonComponent = "OnboardingWelcome-module__button-component___SH82e";
const cancelComponent = "OnboardingWelcome-module__cancelComponent___NxvuZ";
const cancelLink = "OnboardingWelcome-module__cancelLink___qlZNJ";
const topRightLink = "OnboardingWelcome-module__topRightLink___MtCVx";
const fadeInButton = "OnboardingWelcome-module__fadeInButton___twthT";
const fadeIn$1 = "OnboardingWelcome-module__fadeIn___YWein";
const sliderTextStep1 = "OnboardingWelcome-module__slider-text-step1___8tgH7";
const sliderTextStep2 = "OnboardingWelcome-module__sliderTextStep2___L2l9N";
const hidden = "OnboardingWelcome-module__hidden___MzCT3";
const thankYouContainer = "OnboardingWelcome-module__thankYouContainer___fhh4m";
const loadingAnimation = "OnboardingWelcome-module__loadingAnimation___ldNlK";
const loadingStatusWrapper = "OnboardingWelcome-module__loadingStatusWrapper___j26eb";
const welcomeStyles = {
  onboardingWelcomeContainer,
  step2,
  finalStep,
  loaderComponent,
  sliderComponent: sliderComponent$1,
  buttonComponent,
  cancelComponent,
  cancelLink,
  topRightLink,
  fadeInButton,
  fadeIn: fadeIn$1,
  sliderTextStep1,
  sliderTextStep2,
  hidden,
  thankYouContainer,
  loadingAnimation,
  loadingStatusWrapper
};
const sliderComponent = "OnboardingStep-module__slider-component___Nf5hZ";
const sliderText = "OnboardingStep-module__slider-text___KzdA3";
const fadeIn = "OnboardingStep-module__fadeIn___vga6J";
const textareaWrapper = "OnboardingStep-module__textareaWrapper___Bpqpq";
const textareatransparent = "OnboardingStep-module__textareatransparent___211zX";
const noBoxShadow = "OnboardingStep-module__noBoxShadow___5tVuT";
const loadingBadgeWrapper = "OnboardingStep-module__loadingBadgeWrapper___CeFMh";
const subtitle = "OnboardingStep-module__subtitle___ZQ50R";
const sendButtonWrapperNonInteractive = "OnboardingStep-module__sendButtonWrapperNonInteractive___y5D7v";
const sendButtonNonInteractive = "OnboardingStep-module__sendButtonNonInteractive___zrbwB";
const styles$o = {
  sliderComponent,
  sliderText,
  fadeIn,
  textareaWrapper,
  textareatransparent,
  noBoxShadow,
  loadingBadgeWrapper,
  subtitle,
  sendButtonWrapperNonInteractive,
  sendButtonNonInteractive
};
const loadingIndicatorWrapper = "LoadingStatusBadge-module__loadingIndicatorWrapper___wVxvA";
const appearing = "LoadingStatusBadge-module__appearing___A32My";
const exiting = "LoadingStatusBadge-module__exiting___FqHqg";
const loadingIndicator = "LoadingStatusBadge-module__loadingIndicator___lgsyx";
const shrinkingText = "LoadingStatusBadge-module__shrinkingText___RsnVb";
const expandingText = "LoadingStatusBadge-module__expandingText___6Tpp0";
const styles$n = {
  loadingIndicatorWrapper,
  appearing,
  exiting,
  loadingIndicator,
  shrinkingText,
  expandingText
};
const LoadingStatusBadge = (props) => {
  const [loadingMessageIndex, setLoadingMessageIndex] = reactExports.useState(0);
  const [showLoadingBadge, setShowLoadingBadge] = reactExports.useState(true);
  const [isExiting, setIsExiting] = reactExports.useState(false);
  const [isAppearing, setIsAppearing] = reactExports.useState(false);
  const [textTransition, setTextTransition] = reactExports.useState("expandingText");
  reactExports.useEffect(() => {
    if (showLoadingBadge) {
      let currentIndex = 0;
      setLoadingMessageIndex(currentIndex);
      setIsAppearing(true);
      const interval = props.intervalDuration || 3e3;
      const transitionDuration = 300;
      const intervalId = setInterval(() => {
        setTextTransition("shrinkingText");
        setTimeout(() => {
          currentIndex = (currentIndex + 1) % props.texts.length;
          setLoadingMessageIndex(currentIndex);
          requestAnimationFrame(() => {
            requestAnimationFrame(() => {
              setTextTransition("expandingText");
            });
          });
        }, transitionDuration);
      }, interval);
      return () => clearInterval(intervalId);
    }
  }, [showLoadingBadge, props.texts, props.intervalDuration]);
  if (!showLoadingBadge) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    "div",
    {
      className: `${styles$n.loadingIndicatorWrapper}
      ${isAppearing ? styles$n.appearing : ""}
      ${isExiting ? styles$n.exiting : ""}`,
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Q8e,
        {
          className: `${styles$n.loadingIndicator} ${styles$n[textTransition]}`,
          text: props.texts[loadingMessageIndex],
          status: "publishing",
          hideIcon: true
        },
        loadingMessageIndex
      )
    }
  );
};
const modalWrapper$2 = "ErrorModal-module__modalWrapper___fOcEU";
const errorModalContent = "ErrorModal-module__errorModalContent___dNyOs";
const errorDetailsContainer = "ErrorModal-module__errorDetailsContainer___blRX8";
const errorPre = "ErrorModal-module__errorPre___miGFb";
const errorDetailsHeader = "ErrorModal-module__errorDetailsHeader___-uAx-";
const errorDetailsToggleInner = "ErrorModal-module__errorDetailsToggleInner___7if5B";
const errorDetailsContent = "ErrorModal-module__errorDetailsContent___Sxkse";
const styles$m = {
  modalWrapper: modalWrapper$2,
  errorModalContent,
  errorDetailsContainer,
  errorPre,
  errorDetailsHeader,
  errorDetailsToggleInner,
  errorDetailsContent
};
const ErrorModal = ({
  isOpen,
  onClose,
  errorMessage = __("Something went wrong from our side, please try again!", "beyondseo"),
  errorDetails,
  isLoading = false,
  title: title2 = "",
  width = "528px",
  primaryButtonText = __("Contact customer support", "beyondseo"),
  contactSupportUrl = "",
  onPrimaryAction
}) => {
  var _a2, _b2, _c2;
  const [hasCopied, setHasCopied] = reactExports.useState(false);
  const [isExpanded, setIsExpanded] = reactExports.useState(false);
  const resolvedSupportUrl = contactSupportUrl || (((_c2 = (_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.locale) == null ? void 0 : _c2.startsWith("de")) ? "https://mein.ionos.de/support/contact" : "https://my.ionos.com/support/contact");
  if (!isOpen) return null;
  const handleCopyClick = async () => {
    try {
      const textToCopy = typeof errorDetails === "string" ? errorDetails : JSON.stringify(errorDetails, null, 2);
      await navigator.clipboard.writeText(textToCopy);
      setHasCopied(true);
      setTimeout(() => setHasCopied(false), 2e3);
    } catch (err) {
      console.error("Failed to copy error details:", err);
    }
  };
  const handlePrimaryAction = () => {
    if (onPrimaryAction) {
      onPrimaryAction();
    } else {
      {
        window.open(resolvedSupportUrl, "_blank");
      }
      onClose();
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$m.modalWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
    e9e,
    {
      title: title2,
      close: onClose,
      closeOnSave: false,
      savable: true,
      positiveBtnText: primaryButtonText,
      showPositiveBtnIcon: false,
      saveCallback: handlePrimaryAction,
      cancelCallback: onClose,
      savingInProgress: isLoading,
      width,
      children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$m.errorModalContent, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          li,
          {
            children: Ln.exclamation,
            hasCircle: true,
            fillColor: "#ffeceb",
            color: "#ff4d4f",
            circleSize: 40,
            className: styles$m.errorIcon
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, children: errorMessage }),
        errorDetails && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$m.errorDetailsContainer, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$m.errorDetailsHeader, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: styles$m.errorDetailsToggleInner,
                onClick: () => setIsExpanded(!isExpanded),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, children: __("Error details", "beyondseo") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(li, { children: isExpanded ? Ln.caretUp : Ln.caretDown })
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(gh, { onClick: handleCopyClick, type: Vo.secondary, size: uf.small, children: hasCopied ? __("Copied!", "beyondseo") : __("Copy Error", "beyondseo") })
          ] }),
          isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$m.errorDetailsContent, children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$m.errorPre, children: typeof errorDetails === "string" ? errorDetails : JSON.stringify(errorDetails, null, 2) }) })
        ] })
      ] })
    }
  ) });
};
const OnboardingStep = ({
  texts,
  subtitle: subtitle2,
  loadingTexts = [],
  onSubmit,
  showLoadingBadge = false
}) => {
  const [textareaValue, setTextareaValue] = reactExports.useState("");
  const [isButtonLoading, setIsButtonLoading] = reactExports.useState(false);
  const [showSubtitle, setShowSubtitle] = reactExports.useState(false);
  const [showErrorModal, setShowErrorModal] = reactExports.useState(false);
  const [errorDetails, setErrorDetails] = reactExports.useState(null);
  const TEXT_FADE_ANIMATION_DURATION2 = 150;
  const TEXT_WELCOME_ANIMATION_WAIT_BETWEEN_COMPONENTS2 = 1e3;
  const TEXT_WELCOME_ANIMATION_ANIMATION_DURATION2 = 250;
  const MAX_CHARS = 255;
  const CHAR_LIMIT_MESSAGE = __("Message cannot exceed 255 characters", "beyondseo");
  const INVALID_TEXT_MESSAGE = __("Text contains URL or is missing a space after a period (.)", "beyondseo");
  const hasInvalidDotPattern = (text2) => {
    const urlPattern = /[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}/;
    return urlPattern.test(text2);
  };
  const isFormValid = () => {
    const validLength = textareaValue.length <= MAX_CHARS && textareaValue.trim().length > 0;
    return validLength && !hasInvalidDotPattern(textareaValue);
  };
  const getErrorMessage = () => {
    if (!isFormValid()) {
      if (textareaValue.length > MAX_CHARS) {
        return CHAR_LIMIT_MESSAGE;
      }
      if (hasInvalidDotPattern(textareaValue)) {
        return INVALID_TEXT_MESSAGE;
      }
    }
    return void 0;
  };
  reactExports.useEffect(() => {
    setShowSubtitle(false);
    if (subtitle2) {
      const totalTitleDuration = TEXT_WELCOME_ANIMATION_WAIT_BETWEEN_COMPONENTS2 * (texts.length - 1) + TEXT_WELCOME_ANIMATION_ANIMATION_DURATION2;
      const timer = setTimeout(() => {
        setShowSubtitle(true);
      }, totalTitleDuration);
      return () => clearTimeout(timer);
    }
  }, [texts, subtitle2]);
  const handleSubmit = async () => {
    if (isButtonLoading || !isFormValid()) return;
    setIsButtonLoading(true);
    try {
      await onSubmit(textareaValue);
      setTextareaValue("");
    } catch (error2) {
      setErrorDetails(error2);
      setShowErrorModal(true);
    } finally {
      setIsButtonLoading(false);
    }
  };
  const handleSendClick = () => {
    if (!isFormValid()) return;
    handleSubmit();
  };
  const handleKeyDown = (e2) => {
    if (e2.key === "Enter" && !e2.shiftKey) {
      e2.preventDefault();
      if (isFormValid()) {
        handleSubmit();
      }
    }
  };
  reactExports.useEffect(() => {
    if (!showLoadingBadge) {
      setIsButtonLoading(false);
    }
  }, [showLoadingBadge]);
  const formValid = isFormValid();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$o.sliderComponent), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: Kt(
          S8e.dFlex,
          S8e.alignItemsCenter,
          S8e.justifyContentCenter,
          S8e.dFlexColumn
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            q8e,
            {
              waitBetweenComponents: TEXT_WELCOME_ANIMATION_WAIT_BETWEEN_COMPONENTS2,
              duration: TEXT_WELCOME_ANIMATION_ANIMATION_DURATION2,
              children: texts.map((txt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                nr,
                {
                  className: styles$o.sliderText,
                  type: Er.heading3,
                  color: "white",
                  fontWeight: si.bold,
                  textAlign: "center",
                  animateWords: {
                    animation: "fade-up",
                    duration: TEXT_FADE_ANIMATION_DURATION2,
                    delay: 30
                  },
                  children: txt
                },
                txt
              ))
            }
          ),
          subtitle2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
            nr,
            {
              className: styles$o.subtitle,
              color: "white",
              type: Er.heading4,
              fontWeight: si.regular,
              textAlign: "center",
              animateWords: {
                animation: "fade-up",
                duration: TEXT_FADE_ANIMATION_DURATION2,
                delay: 30
              },
              children: subtitle2
            }
          )
        ]
      }
    ) }),
    showLoadingBadge && /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$o.loadingBadgeWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingStatusBadge, { loading: showLoadingBadge, texts: loadingTexts }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$o.textareaWrapper, styles$o.fadeIn), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      D8e,
      {
        autoFocus: true,
        required: true,
        counter: true,
        maxLength: MAX_CHARS,
        placeholder: __("Write here to communicate", "beyondseo"),
        className: Kt(styles$o.textareatransparent, styles$o.noBoxShadow),
        value: textareaValue,
        onChange: (e2) => setTextareaValue(e2.target.value),
        onKeyDown: handleKeyDown,
        endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(jp, { position: "right", message: getErrorMessage(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: !formValid ? styles$o.sendButtonWrapperNonInteractive : void 0,
            "aria-disabled": !formValid,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              gh,
              {
                type: Vo.default,
                iconRight: Ln.send,
                size: uf.medium,
                iconSize: ai.large,
                iconColor: "--n500",
                isLoading: isButtonLoading,
                onClick: handleSendClick,
                tabIndex: formValid ? 0 : -1,
                className: !formValid ? styles$o.sendButtonNonInteractive : void 0
              }
            )
          }
        ) })
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ErrorModal,
      {
        isOpen: showErrorModal,
        onClose: () => setShowErrorModal(false),
        errorMessage: __("Something went wrong from our side, please try again!", "beyondseo"),
        errorDetails
      }
    )
  ] });
};
const WPFlowDataCompletionObjectType = {
  BeyondSEO_Domain_Integrations_WordPress_Setup_Entities_Flows_Completions_WPFlowDataCompletion: "BeyondSEO\\Domain\\Integrations\\WordPress\\Setup\\Entities\\Flows\\Completions\\WPFlowDataCompletion"
};
function _assertThisInitialized(e2) {
  if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e2;
}
function _setPrototypeOf(t, e2) {
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e3) {
    return t2.__proto__ = e3, t2;
  }, _setPrototypeOf(t, e2);
}
function _inheritsLoose(t, o) {
  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
}
var safeIsNaN = Number.isNaN || function ponyfill(value) {
  return typeof value === "number" && value !== value;
};
function isEqual$1(first, second) {
  if (first === second) {
    return true;
  }
  if (safeIsNaN(first) && safeIsNaN(second)) {
    return true;
  }
  return false;
}
function areInputsEqual$1(newInputs, lastInputs) {
  if (newInputs.length !== lastInputs.length) {
    return false;
  }
  for (var i = 0; i < newInputs.length; i++) {
    if (!isEqual$1(newInputs[i], lastInputs[i])) {
      return false;
    }
  }
  return true;
}
function memoizeOne(resultFn, isEqual2) {
  if (isEqual2 === void 0) {
    isEqual2 = areInputsEqual$1;
  }
  var lastThis;
  var lastArgs = [];
  var lastResult;
  var calledOnce = false;
  function memoized() {
    var newArgs = [];
    for (var _i = 0; _i < arguments.length; _i++) {
      newArgs[_i] = arguments[_i];
    }
    if (calledOnce && lastThis === this && isEqual2(newArgs, lastArgs)) {
      return lastResult;
    }
    lastResult = resultFn.apply(this, newArgs);
    calledOnce = true;
    lastThis = this;
    lastArgs = newArgs;
    return lastResult;
  }
  return memoized;
}
var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
var now = hasNativePerformanceNow ? function() {
  return performance.now();
} : function() {
  return Date.now();
};
function cancelTimeout(timeoutID) {
  cancelAnimationFrame(timeoutID.id);
}
function requestTimeout(callback, delay) {
  var start2 = now();
  function tick() {
    if (now() - start2 >= delay) {
      callback.call(null);
    } else {
      timeoutID.id = requestAnimationFrame(tick);
    }
  }
  var timeoutID = {
    id: requestAnimationFrame(tick)
  };
  return timeoutID;
}
var size = -1;
function getScrollbarSize(recalculate) {
  if (recalculate === void 0) {
    recalculate = false;
  }
  if (size === -1 || recalculate) {
    var div = document.createElement("div");
    var style = div.style;
    style.width = "50px";
    style.height = "50px";
    style.overflow = "scroll";
    document.body.appendChild(div);
    size = div.offsetWidth - div.clientWidth;
    document.body.removeChild(div);
  }
  return size;
}
var cachedRTLResult = null;
function getRTLOffsetType(recalculate) {
  if (recalculate === void 0) {
    recalculate = false;
  }
  if (cachedRTLResult === null || recalculate) {
    var outerDiv = document.createElement("div");
    var outerStyle = outerDiv.style;
    outerStyle.width = "50px";
    outerStyle.height = "50px";
    outerStyle.overflow = "scroll";
    outerStyle.direction = "rtl";
    var innerDiv = document.createElement("div");
    var innerStyle = innerDiv.style;
    innerStyle.width = "100px";
    innerStyle.height = "100px";
    outerDiv.appendChild(innerDiv);
    document.body.appendChild(outerDiv);
    if (outerDiv.scrollLeft > 0) {
      cachedRTLResult = "positive-descending";
    } else {
      outerDiv.scrollLeft = 1;
      if (outerDiv.scrollLeft === 0) {
        cachedRTLResult = "negative";
      } else {
        cachedRTLResult = "positive-ascending";
      }
    }
    document.body.removeChild(outerDiv);
    return cachedRTLResult;
  }
  return cachedRTLResult;
}
var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
var defaultItemKey$1 = function defaultItemKey3(index, data) {
  return index;
};
function createListComponent(_ref) {
  var _class;
  var getItemOffset3 = _ref.getItemOffset, getEstimatedTotalSize4 = _ref.getEstimatedTotalSize, getItemSize3 = _ref.getItemSize, getOffsetForIndexAndAlignment5 = _ref.getOffsetForIndexAndAlignment, getStartIndexForOffset3 = _ref.getStartIndexForOffset, getStopIndexForStartIndex3 = _ref.getStopIndexForStartIndex, initInstanceProps5 = _ref.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange, validateProps5 = _ref.validateProps;
  return _class = /* @__PURE__ */ (function(_PureComponent) {
    _inheritsLoose(List, _PureComponent);
    function List(props) {
      var _this;
      _this = _PureComponent.call(this, props) || this;
      _this._instanceProps = initInstanceProps5(_this.props, _assertThisInitialized(_this));
      _this._outerRef = void 0;
      _this._resetIsScrollingTimeoutId = null;
      _this.state = {
        instance: _assertThisInitialized(_this),
        isScrolling: false,
        scrollDirection: "forward",
        scrollOffset: typeof _this.props.initialScrollOffset === "number" ? _this.props.initialScrollOffset : 0,
        scrollUpdateWasRequested: false
      };
      _this._callOnItemsRendered = void 0;
      _this._callOnItemsRendered = memoizeOne(function(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
        return _this.props.onItemsRendered({
          overscanStartIndex,
          overscanStopIndex,
          visibleStartIndex,
          visibleStopIndex
        });
      });
      _this._callOnScroll = void 0;
      _this._callOnScroll = memoizeOne(function(scrollDirection, scrollOffset, scrollUpdateWasRequested) {
        return _this.props.onScroll({
          scrollDirection,
          scrollOffset,
          scrollUpdateWasRequested
        });
      });
      _this._getItemStyle = void 0;
      _this._getItemStyle = function(index) {
        var _this$props = _this.props, direction = _this$props.direction, itemSize = _this$props.itemSize, layout = _this$props.layout;
        var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
        var style;
        if (itemStyleCache.hasOwnProperty(index)) {
          style = itemStyleCache[index];
        } else {
          var _offset = getItemOffset3(_this.props, index, _this._instanceProps);
          var size2 = getItemSize3(_this.props, index, _this._instanceProps);
          var isHorizontal = direction === "horizontal" || layout === "horizontal";
          var isRtl = direction === "rtl";
          var offsetHorizontal = isHorizontal ? _offset : 0;
          itemStyleCache[index] = style = {
            position: "absolute",
            left: isRtl ? void 0 : offsetHorizontal,
            right: isRtl ? offsetHorizontal : void 0,
            top: !isHorizontal ? _offset : 0,
            height: !isHorizontal ? size2 : "100%",
            width: isHorizontal ? size2 : "100%"
          };
        }
        return style;
      };
      _this._getItemStyleCache = void 0;
      _this._getItemStyleCache = memoizeOne(function(_, __2, ___) {
        return {};
      });
      _this._onScrollHorizontal = function(event) {
        var _event$currentTarget = event.currentTarget, clientWidth = _event$currentTarget.clientWidth, scrollLeft = _event$currentTarget.scrollLeft, scrollWidth = _event$currentTarget.scrollWidth;
        _this.setState(function(prevState) {
          if (prevState.scrollOffset === scrollLeft) {
            return null;
          }
          var direction = _this.props.direction;
          var scrollOffset = scrollLeft;
          if (direction === "rtl") {
            switch (getRTLOffsetType()) {
              case "negative":
                scrollOffset = -scrollLeft;
                break;
              case "positive-descending":
                scrollOffset = scrollWidth - clientWidth - scrollLeft;
                break;
            }
          }
          scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
          return {
            isScrolling: true,
            scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
            scrollOffset,
            scrollUpdateWasRequested: false
          };
        }, _this._resetIsScrollingDebounced);
      };
      _this._onScrollVertical = function(event) {
        var _event$currentTarget2 = event.currentTarget, clientHeight = _event$currentTarget2.clientHeight, scrollHeight = _event$currentTarget2.scrollHeight, scrollTop = _event$currentTarget2.scrollTop;
        _this.setState(function(prevState) {
          if (prevState.scrollOffset === scrollTop) {
            return null;
          }
          var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
          return {
            isScrolling: true,
            scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
            scrollOffset,
            scrollUpdateWasRequested: false
          };
        }, _this._resetIsScrollingDebounced);
      };
      _this._outerRefSetter = function(ref) {
        var outerRef = _this.props.outerRef;
        _this._outerRef = ref;
        if (typeof outerRef === "function") {
          outerRef(ref);
        } else if (outerRef != null && typeof outerRef === "object" && outerRef.hasOwnProperty("current")) {
          outerRef.current = ref;
        }
      };
      _this._resetIsScrollingDebounced = function() {
        if (_this._resetIsScrollingTimeoutId !== null) {
          cancelTimeout(_this._resetIsScrollingTimeoutId);
        }
        _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
      };
      _this._resetIsScrolling = function() {
        _this._resetIsScrollingTimeoutId = null;
        _this.setState({
          isScrolling: false
        }, function() {
          _this._getItemStyleCache(-1, null);
        });
      };
      return _this;
    }
    List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      validateSharedProps$1(nextProps, prevState);
      validateProps5(nextProps);
      return null;
    };
    var _proto = List.prototype;
    _proto.scrollTo = function scrollTo(scrollOffset) {
      scrollOffset = Math.max(0, scrollOffset);
      this.setState(function(prevState) {
        if (prevState.scrollOffset === scrollOffset) {
          return null;
        }
        return {
          scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
          scrollOffset,
          scrollUpdateWasRequested: true
        };
      }, this._resetIsScrollingDebounced);
    };
    _proto.scrollToItem = function scrollToItem(index, align) {
      if (align === void 0) {
        align = "auto";
      }
      var _this$props2 = this.props, itemCount = _this$props2.itemCount, layout = _this$props2.layout;
      var scrollOffset = this.state.scrollOffset;
      index = Math.max(0, Math.min(index, itemCount - 1));
      var scrollbarSize = 0;
      if (this._outerRef) {
        var outerRef = this._outerRef;
        if (layout === "vertical") {
          scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
        } else {
          scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
        }
      }
      this.scrollTo(getOffsetForIndexAndAlignment5(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
    };
    _proto.componentDidMount = function componentDidMount() {
      var _this$props3 = this.props, direction = _this$props3.direction, initialScrollOffset = _this$props3.initialScrollOffset, layout = _this$props3.layout;
      if (typeof initialScrollOffset === "number" && this._outerRef != null) {
        var outerRef = this._outerRef;
        if (direction === "horizontal" || layout === "horizontal") {
          outerRef.scrollLeft = initialScrollOffset;
        } else {
          outerRef.scrollTop = initialScrollOffset;
        }
      }
      this._callPropsCallbacks();
    };
    _proto.componentDidUpdate = function componentDidUpdate() {
      var _this$props4 = this.props, direction = _this$props4.direction, layout = _this$props4.layout;
      var _this$state = this.state, scrollOffset = _this$state.scrollOffset, scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
      if (scrollUpdateWasRequested && this._outerRef != null) {
        var outerRef = this._outerRef;
        if (direction === "horizontal" || layout === "horizontal") {
          if (direction === "rtl") {
            switch (getRTLOffsetType()) {
              case "negative":
                outerRef.scrollLeft = -scrollOffset;
                break;
              case "positive-ascending":
                outerRef.scrollLeft = scrollOffset;
                break;
              default:
                var clientWidth = outerRef.clientWidth, scrollWidth = outerRef.scrollWidth;
                outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
                break;
            }
          } else {
            outerRef.scrollLeft = scrollOffset;
          }
        } else {
          outerRef.scrollTop = scrollOffset;
        }
      }
      this._callPropsCallbacks();
    };
    _proto.componentWillUnmount = function componentWillUnmount() {
      if (this._resetIsScrollingTimeoutId !== null) {
        cancelTimeout(this._resetIsScrollingTimeoutId);
      }
    };
    _proto.render = function render() {
      var _this$props5 = this.props, children = _this$props5.children, className = _this$props5.className, direction = _this$props5.direction, height = _this$props5.height, innerRef = _this$props5.innerRef, innerElementType = _this$props5.innerElementType, innerTagName = _this$props5.innerTagName, itemCount = _this$props5.itemCount, itemData = _this$props5.itemData, _this$props5$itemKey = _this$props5.itemKey, itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey, layout = _this$props5.layout, outerElementType = _this$props5.outerElementType, outerTagName = _this$props5.outerTagName, style = _this$props5.style, useIsScrolling = _this$props5.useIsScrolling, width = _this$props5.width;
      var isScrolling = this.state.isScrolling;
      var isHorizontal = direction === "horizontal" || layout === "horizontal";
      var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
      var _this$_getRangeToRend = this._getRangeToRender(), startIndex = _this$_getRangeToRend[0], stopIndex = _this$_getRangeToRend[1];
      var items = [];
      if (itemCount > 0) {
        for (var _index = startIndex; _index <= stopIndex; _index++) {
          items.push(reactExports.createElement(children, {
            data: itemData,
            key: itemKey(_index, itemData),
            index: _index,
            isScrolling: useIsScrolling ? isScrolling : void 0,
            style: this._getItemStyle(_index)
          }));
        }
      }
      var estimatedTotalSize = getEstimatedTotalSize4(this.props, this._instanceProps);
      return reactExports.createElement(outerElementType || outerTagName || "div", {
        className,
        onScroll,
        ref: this._outerRefSetter,
        style: _extends$3({
          position: "relative",
          height,
          width,
          overflow: "auto",
          WebkitOverflowScrolling: "touch",
          willChange: "transform",
          direction
        }, style)
      }, reactExports.createElement(innerElementType || innerTagName || "div", {
        children: items,
        ref: innerRef,
        style: {
          height: isHorizontal ? "100%" : estimatedTotalSize,
          pointerEvents: isScrolling ? "none" : void 0,
          width: isHorizontal ? estimatedTotalSize : "100%"
        }
      }));
    };
    _proto._callPropsCallbacks = function _callPropsCallbacks() {
      if (typeof this.props.onItemsRendered === "function") {
        var itemCount = this.props.itemCount;
        if (itemCount > 0) {
          var _this$_getRangeToRend2 = this._getRangeToRender(), _overscanStartIndex = _this$_getRangeToRend2[0], _overscanStopIndex = _this$_getRangeToRend2[1], _visibleStartIndex = _this$_getRangeToRend2[2], _visibleStopIndex = _this$_getRangeToRend2[3];
          this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
        }
      }
      if (typeof this.props.onScroll === "function") {
        var _this$state2 = this.state, _scrollDirection = _this$state2.scrollDirection, _scrollOffset = _this$state2.scrollOffset, _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
        this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
      }
    };
    _proto._getRangeToRender = function _getRangeToRender() {
      var _this$props6 = this.props, itemCount = _this$props6.itemCount, overscanCount = _this$props6.overscanCount;
      var _this$state3 = this.state, isScrolling = _this$state3.isScrolling, scrollDirection = _this$state3.scrollDirection, scrollOffset = _this$state3.scrollOffset;
      if (itemCount === 0) {
        return [0, 0, 0, 0];
      }
      var startIndex = getStartIndexForOffset3(this.props, scrollOffset, this._instanceProps);
      var stopIndex = getStopIndexForStartIndex3(this.props, startIndex, scrollOffset, this._instanceProps);
      var overscanBackward = !isScrolling || scrollDirection === "backward" ? Math.max(1, overscanCount) : 1;
      var overscanForward = !isScrolling || scrollDirection === "forward" ? Math.max(1, overscanCount) : 1;
      return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
    };
    return List;
  })(reactExports.PureComponent), _class.defaultProps = {
    direction: "ltr",
    itemData: void 0,
    layout: "vertical",
    overscanCount: 2,
    useIsScrolling: false
  }, _class;
}
var validateSharedProps$1 = function validateSharedProps3(_ref2, _ref3) {
  _ref2.children;
  _ref2.direction;
  _ref2.height;
  _ref2.layout;
  _ref2.innerTagName;
  _ref2.outerTagName;
  _ref2.width;
  _ref3.instance;
};
var FixedSizeList = /* @__PURE__ */ createListComponent({
  getItemOffset: function getItemOffset2(_ref, index) {
    var itemSize = _ref.itemSize;
    return index * itemSize;
  },
  getItemSize: function getItemSize2(_ref2, index) {
    var itemSize = _ref2.itemSize;
    return itemSize;
  },
  getEstimatedTotalSize: function getEstimatedTotalSize3(_ref3) {
    var itemCount = _ref3.itemCount, itemSize = _ref3.itemSize;
    return itemSize * itemCount;
  },
  getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment4(_ref4, index, align, scrollOffset, instanceProps, scrollbarSize) {
    var direction = _ref4.direction, height = _ref4.height, itemCount = _ref4.itemCount, itemSize = _ref4.itemSize, layout = _ref4.layout, width = _ref4.width;
    var isHorizontal = direction === "horizontal" || layout === "horizontal";
    var size2 = isHorizontal ? width : height;
    var lastItemOffset = Math.max(0, itemCount * itemSize - size2);
    var maxOffset = Math.min(lastItemOffset, index * itemSize);
    var minOffset = Math.max(0, index * itemSize - size2 + itemSize + scrollbarSize);
    if (align === "smart") {
      if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
        align = "auto";
      } else {
        align = "center";
      }
    }
    switch (align) {
      case "start":
        return maxOffset;
      case "end":
        return minOffset;
      case "center": {
        var middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
        if (middleOffset < Math.ceil(size2 / 2)) {
          return 0;
        } else if (middleOffset > lastItemOffset + Math.floor(size2 / 2)) {
          return lastItemOffset;
        } else {
          return middleOffset;
        }
      }
      case "auto":
      default:
        if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
          return scrollOffset;
        } else if (scrollOffset < minOffset) {
          return minOffset;
        } else {
          return maxOffset;
        }
    }
  },
  getStartIndexForOffset: function getStartIndexForOffset2(_ref5, offset) {
    var itemCount = _ref5.itemCount, itemSize = _ref5.itemSize;
    return Math.max(0, Math.min(itemCount - 1, Math.floor(offset / itemSize)));
  },
  getStopIndexForStartIndex: function getStopIndexForStartIndex2(_ref6, startIndex, scrollOffset) {
    var direction = _ref6.direction, height = _ref6.height, itemCount = _ref6.itemCount, itemSize = _ref6.itemSize, layout = _ref6.layout, width = _ref6.width;
    var isHorizontal = direction === "horizontal" || layout === "horizontal";
    var offset = startIndex * itemSize;
    var size2 = isHorizontal ? width : height;
    var numVisibleItems = Math.ceil((size2 + scrollOffset - offset) / itemSize);
    return Math.max(0, Math.min(
      itemCount - 1,
      startIndex + numVisibleItems - 1
      // -1 is because stop index is inclusive
    ));
  },
  initInstanceProps: function initInstanceProps4(props) {
  },
  shouldResetStyleCacheOnItemSizeChange: true,
  validateProps: function validateProps4(_ref7) {
    _ref7.itemSize;
  }
});
const editableCardsContainer = "OnboardingSummary-module__editableCardsContainer___-z36F";
const summaryTitle$1 = "OnboardingSummary-module__summaryTitle___Fc7MW";
const summaryTitlePlaceholder = "OnboardingSummary-module__summaryTitlePlaceholder___td6c5";
const cardPlaceholder = "OnboardingSummary-module__cardPlaceholder___OyNIt";
const cardContentPlaceholder = "OnboardingSummary-module__cardContentPlaceholder___k9egl";
const inputWithButtonPlaceholder = "OnboardingSummary-module__inputWithButtonPlaceholder___B3fMv";
const tagsPlaceholder = "OnboardingSummary-module__tagsPlaceholder___pguQk";
const finishButtonPlaceholder = "OnboardingSummary-module__finishButtonPlaceholder___XQP5z";
const editableCardWrapper$1 = "OnboardingSummary-module__editableCardWrapper___YcEBa";
const businessInfoWrapper = "OnboardingSummary-module__businessInfoWrapper___3W4fv";
const businessInfoRow = "OnboardingSummary-module__businessInfoRow___zIoM1";
const businessInfoCard = "OnboardingSummary-module__businessInfoCard___aJhGD";
const blurredButtonContainer = "OnboardingSummary-module__blurredButtonContainer___GbQNa";
const keywordInputContainer$1 = "OnboardingSummary-module__keywordInputContainer___bNYab";
const autocompleteContainer = "OnboardingSummary-module__autocompleteContainer___pFbLH";
const modalWrapper$1 = "OnboardingSummary-module__modalWrapper___YUELB";
const modalTextarea = "OnboardingSummary-module__modalTextarea___Uhq6v";
const empty$1 = "OnboardingSummary-module__empty___C-vJp";
const img$1 = "OnboardingSummary-module__img___s5s07";
const errorInput$1 = "OnboardingSummary-module__errorInput___hJSrU";
const errorText$1 = "OnboardingSummary-module__errorText___aGdIB";
const errorTextCategories = "OnboardingSummary-module__errorTextCategories___bDi75";
const businessNameErrorText = "OnboardingSummary-module__businessNameErrorText___kdJfP";
const categoryDropdown = "OnboardingSummary-module__categoryDropdown___cMU0n";
const virtualList = "OnboardingSummary-module__virtualList___iaahp";
const dropdownItem = "OnboardingSummary-module__dropdownItem___RINnR";
const dropdownMessage = "OnboardingSummary-module__dropdownMessage___LAKnA";
const dropdownLoadingMore = "OnboardingSummary-module__dropdownLoadingMore___1Na89";
const dropdownFooter = "OnboardingSummary-module__dropdownFooter___fYWvN";
const dropdownOverlay = "OnboardingSummary-module__dropdownOverlay___KTF8Q";
const bottomSpacer = "OnboardingSummary-module__bottomSpacer___1rgxq";
const styles$l = {
  editableCardsContainer,
  summaryTitle: summaryTitle$1,
  summaryTitlePlaceholder,
  cardPlaceholder,
  cardContentPlaceholder,
  inputWithButtonPlaceholder,
  tagsPlaceholder,
  finishButtonPlaceholder,
  editableCardWrapper: editableCardWrapper$1,
  businessInfoWrapper,
  businessInfoRow,
  businessInfoCard,
  blurredButtonContainer,
  keywordInputContainer: keywordInputContainer$1,
  autocompleteContainer,
  modalWrapper: modalWrapper$1,
  modalTextarea,
  empty: empty$1,
  img: img$1,
  errorInput: errorInput$1,
  errorText: errorText$1,
  errorTextCategories,
  businessNameErrorText,
  categoryDropdown,
  virtualList,
  dropdownItem,
  dropdownMessage,
  dropdownLoadingMore,
  dropdownFooter,
  dropdownOverlay,
  bottomSpacer
};
const emptyStateUfo = "data:image/svg+xml,%3csvg%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.5'%20d='M105.986%20144.515L77.35%20148.605C68.1125%20149.924%2058.7353%20149.932%2049.4955%20148.628L20.7998%20144.577L63.3959%2069.6L108.8%2080.9317L105.986%20144.515Z'%20fill='%23E6E9F0'/%3e%3cpath%20d='M77.8473%2098.003L57.0956%20107.68C56.3481%20108.028%2056.0247%20108.917%2056.3733%20109.664L66.05%20130.416C66.3985%20131.163%2067.287%20131.487%2068.0344%20131.138L88.7862%20121.462C89.5336%20121.113%2089.857%20120.224%2089.5085%20119.477L79.8318%2098.7253C79.4832%2097.9778%2078.5948%2097.6545%2077.8473%2098.003Z'%20stroke='%238698B6'%20stroke-width='2'%20stroke-miterlimit='16'%20stroke-linecap='square'%20stroke-linejoin='round'%20stroke-dasharray='8%208'/%3e%3cpath%20d='M67.5407%2035.7651C69.1737%2018.7061%2085.5089%207.09746%20102.046%2011.2435C118.583%2015.3895%20127.587%2033.3505%20121.064%2049.1834L113.312%2068L65.6001%2056.0381L67.5407%2035.7651Z'%20fill='%23E6E9F0'%20stroke='white'%20stroke-width='4'/%3e%3cpath%20d='M84.9802%2028.3597C83.5489%2020.3776%2090.8638%2013.5794%2098.7729%2015.5409L102.666%2016.5064C110.575%2018.4679%20113.825%2027.8861%20108.794%2034.2655L99.3012%2046.3021C97.7046%2048.3259%2095.0619%2049.2281%2092.5523%2048.6059C90.0431%2047.9837%2088.1352%2045.9529%2087.681%2043.4203L84.9802%2028.3597Z'%20fill='%23B6C1D3'/%3e%3cpath%20d='M84.6101%2033.772C82.5886%2030.3878%2085.9036%2026.4033%2089.9627%2027.3384C93.0985%2028.0608%2095.0068%2030.9951%2094.2247%2033.8924L93.3972%2036.959C93.1228%2037.9773%2092.0064%2038.5969%2090.9045%2038.3431C88.2691%2037.736%2086.0262%2036.1427%2084.7136%2033.9456L84.6101%2033.772Z'%20fill='%238698B6'%20stroke='%23B6C1D3'%20stroke-width='2'/%3e%3cpath%20d='M106.702%2039.2485C110.081%2037.1673%20109.211%2032.2814%20105.297%2031.3595C102.273%2030.6474%2099.2111%2032.3855%2098.4574%2035.2417L97.6596%2038.2648C97.3944%2039.2686%2098.0409%2040.2853%2099.1039%2040.5355C101.645%2041.134%20104.335%2040.7064%20106.528%2039.3552L106.702%2039.2485Z'%20fill='%238698B6'%20stroke='%23B6C1D3'%20stroke-width='2'/%3e%3cpath%20d='M63.2002%2056.8L115.2%2069.6322L108.573%2081.2079C107.836%2082.4942%20106.432%2083.2624%20104.94%2083.1961L86.4001%2082.3675C85.0791%2082.3086%2083.783%2081.9888%2082.5881%2081.427L65.8257%2073.5431C64.4764%2072.9086%2063.6012%2071.5781%2063.5611%2070.1002L63.2002%2056.8Z'%20fill='%23E6E9F0'/%3e%3cpath%20d='M139.2%2076.5166C138.11%2080.7929%20133.958%2083.6251%20129.479%2083.1476L124.717%2082.6399C98.5729%2079.8531%2072.9388%2073.6016%2048.5178%2064.0571L44.0697%2062.3187C39.8853%2060.6831%2037.5788%2056.2763%2038.6689%2052L139.2%2076.5166Z'%20fill='%23E6E9F0'/%3e%3cpath%20d='M38.3999%2051.6548C39.49%2047.2686%2043.6418%2044.3641%2048.1214%2044.8538L52.8833%2045.3744C79.0265%2048.2323%20104.661%2054.6441%20129.082%2064.4333L133.53%2066.2163C137.714%2067.8938%20140.021%2072.4136%20138.931%2076.8001L38.3999%2051.6548Z'%20fill='white'/%3e%3cpath%20d='M63.8414%2062.0884C65.9753%2062.6205%2068.1365%2061.3219%2068.6686%2059.188C69.2006%2057.0541%2067.902%2054.8929%2065.7681%2054.3608C63.6342%2053.8288%2061.473%2055.1273%2060.9409%2057.2613C60.4089%2059.3952%2061.7075%2061.5564%2063.8414%2062.0884Z'%20fill='%23B6C1D3'/%3e%3cpath%20d='M87.749%2069.0753C90.4164%2069.7403%2093.1179%2068.1171%2093.783%2065.4497C94.448%2062.7823%2092.8248%2060.0808%2090.1574%2059.4157C87.49%2058.7507%2084.7885%2060.3739%2084.1234%2063.0413C83.4584%2065.7087%2085.0816%2068.4102%2087.749%2069.0753Z'%20fill='%238698B6'/%3e%3cpath%20d='M112.139%2074.1303C114.273%2074.6623%20116.434%2073.3638%20116.966%2071.2298C117.498%2069.0959%20116.199%2066.9347%20114.065%2066.4027C111.932%2065.8706%20109.77%2067.1692%20109.238%2069.3031C108.706%2071.4371%20110.005%2073.5982%20112.139%2074.1303Z'%20fill='%23B6C1D3'/%3e%3cpath%20d='M63.5998%20150.4C87.2376%20150.4%20106.4%20147.714%20106.4%20144.4C106.4%20141.086%2087.2376%20138.4%2063.5998%20138.4C39.962%20138.4%2020.7998%20141.086%2020.7998%20144.4C20.7998%20147.714%2039.962%20150.4%2063.5998%20150.4Z'%20fill='%23E6E9F0'/%3e%3cpath%20opacity='0.2'%20d='M33.9477%20148.8L26.7225%20147.356C24.9594%20147.003%2023.3172%20146.189%2021.9578%20144.994C21.5844%20144.666%2021.4913%20144.115%2021.7356%20143.679L63.2185%2069.6L71.2001%2072.2223L33.9477%20148.8Z'%20fill='%23E6E9F0'/%3e%3cpath%20opacity='0.2'%20d='M92%20148.8L101.323%20146.941C102.943%20146.618%20104.455%20145.882%20105.714%20144.805C105.919%20144.629%20106.043%20144.375%20106.055%20144.104L108.8%2081.2073L101.798%2080L92%20148.8Z'%20fill='%23E6E9F0'/%3e%3c/svg%3e";
const WPRequirementObjectType = {
  BeyondSEO_Domain_Integrations_WordPress_Setup_Entities_Flows_Requirements_WPRequirement: "BeyondSEO\\Domain\\Integrations\\WordPress\\Setup\\Entities\\Flows\\Requirements\\WPRequirement"
};
const editableCardWrapper = "OnboardingSummaryKeyword-module__editableCardWrapper___BQPtL";
const keywordInputContainer = "OnboardingSummaryKeyword-module__keywordInputContainer___uvsWj";
const keywordInputWrapper = "OnboardingSummaryKeyword-module__keywordInputWrapper___rDDPl";
const keywordInput = "OnboardingSummaryKeyword-module__keywordInput___qaZhZ";
const errorInput = "OnboardingSummaryKeyword-module__errorInput___cV-TJ";
const errorText = "OnboardingSummaryKeyword-module__errorText___kVWo5";
const empty = "OnboardingSummaryKeyword-module__empty___-yxU5";
const img = "OnboardingSummaryKeyword-module__img___9cmJ-";
const styles$k = {
  editableCardWrapper,
  keywordInputContainer,
  keywordInputWrapper,
  keywordInput,
  errorInput,
  errorText,
  empty,
  img
};
const MAX_KEYWORDS = 50;
const OnboardingSummaryKeyword = ({ keywords, setKeywords, maxKeywords }) => {
  const [newKeyword, setNewKeyword] = reactExports.useState("");
  const [keywordError, setKeywordError] = reactExports.useState("");
  const dispatch = useAppDispatch();
  const updateSingleRequirement = (setupRequirementName, value) => {
    dispatch(
      OnboardingStore.postApiOnboardingRequirementsThunk({
        requestBody: {
          requirement: {
            setupRequirement: setupRequirementName,
            value,
            objectType: WPRequirementObjectType.BeyondSEO_Domain_Integrations_WordPress_Setup_Entities_Flows_Requirements_WPRequirement
          }
        },
        queryParams: {}
      })
    );
  };
  const handleKeywordDelete = (id) => {
    if (id !== void 0) {
      setKeywords((prevKeywords) => {
        const newKeywords = prevKeywords.filter((keyword) => keyword.id !== Number(id));
        updateSingleRequirement("businessKeywords", JSON.stringify(newKeywords.map((k) => k.text)));
        return newKeywords;
      });
    }
  };
  const handleKeywordInputChange = (e2) => {
    setNewKeyword(e2.target.value);
    if (keywordError) {
      setKeywordError("");
    }
  };
  const handleKeywordInputKeyDown = (e2) => {
    if (e2.key === "Enter" || e2.key === ",") {
      e2.preventDefault();
      processAndAddKeywords();
    }
  };
  const processAndAddKeywords = () => {
    if (newKeyword.includes(",")) {
      const keywordsList = newKeyword.split(",").map((k) => k.trim()).filter((k) => k);
      const processKeywords = async () => {
        for (const keyword of keywordsList) {
          if (keyword.length >= 3) {
            if (keyword.length > 80) {
              setKeywordError(__("A keyword can have max 80 characters", "beyondseo"));
              continue;
            }
            const effectiveMaxKeywords = maxKeywords || MAX_KEYWORDS;
            if (keywords.length >= effectiveMaxKeywords) {
              setKeywordError(__(`You have reached max number of keywords`, "beyondseo"));
              break;
            }
            const isDuplicate = keywords.some((k) => k.text.toLowerCase() === keyword.toLowerCase());
            if (isDuplicate) {
              continue;
            }
            setKeywords((prevKeywords) => {
              const newKeywords = [
                ...prevKeywords,
                { id: Math.max(...prevKeywords.map((k) => k.id), 0) + 1, text: keyword }
              ];
              updateSingleRequirement("businessKeywords", JSON.stringify(newKeywords.map((k) => k.text)));
              return newKeywords;
            });
            await new Promise((resolve) => setTimeout(resolve, 10));
          }
        }
        setNewKeyword("");
        setKeywordError("");
      };
      processKeywords();
    } else {
      handleAddKeyword();
    }
  };
  const handleAddKeyword = () => {
    const trimmedKeyword = newKeyword.trim();
    if (trimmedKeyword && trimmedKeyword.length >= 3) {
      if (trimmedKeyword.length > 80) {
        setKeywordError(__("A keyword can have max 80 characters", "beyondseo"));
        return;
      }
      const effectiveMaxKeywords = maxKeywords || MAX_KEYWORDS;
      if (keywords.length >= effectiveMaxKeywords) {
        setKeywordError(__(`You have reached max number of keywords`, "beyondseo"));
        return;
      }
      const isDuplicate = keywords.some((keyword) => keyword.text.toLowerCase() === trimmedKeyword.toLowerCase());
      if (isDuplicate) {
        setKeywordError(__("You have already added this keyword", "beyondseo"));
        return;
      }
      setKeywordError("");
      setKeywords((prevKeywords) => {
        const newKeywords = [
          ...prevKeywords,
          { id: Math.max(...prevKeywords.map((k) => k.id), 0) + 1, text: trimmedKeyword }
        ];
        updateSingleRequirement("businessKeywords", JSON.stringify(newKeywords.map((k) => k.text)));
        return newKeywords;
      });
      setNewKeyword("");
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$k.editableCardWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
    J8e,
    {
      className: "editableCard",
      title: __("Keywords to be used for SEO", "beyondseo"),
      editCallback: () => {
      },
      hideEditButton: true,
      padding: true,
      editButtonFloatRight: true,
      actionBtns: keywords.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NEe, { text: __("Generated by us", "beyondseo") }) : void 0,
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$k.keywordInputContainer, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$k.keywordInputWrapper, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              L8e,
              {
                required: true,
                label: __("Add new keyword", "beyondseo"),
                placeholder: __("Enter new keyword (minimum 3 characters)", "beyondseo"),
                className: Kt(styles$k.keywordInput, keywordError ? styles$k.errorInput : ""),
                inputClassName: Kt(styles$k.keywordInputField),
                value: newKeyword,
                onChange: handleKeywordInputChange,
                onKeyDown: handleKeywordInputKeyDown,
                infoText: __(`Minimum required keywords: 5.`, "beyondseo")
              }
            ),
            keywordError && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, className: styles$k.errorText, children: keywordError })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.primary,
              size: uf.large,
              onClick: processAndAddKeywords,
              disabled: !newKeyword.trim() || newKeyword.trim().length < 3,
              children: __("Add", "beyondseo")
            }
          )
        ] }),
        keywords.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          j8e,
          {
            tags: keywords.reduce((tags, element) => {
              tags.push({
                id: element.id,
                text: element.text,
                hasDeleteBtn: true,
                deleteBtnCallback: handleKeywordDelete
              });
              return tags;
            }, [])
          }
        ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$k.empty, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: Kt(styles$k.img), src: emptyStateUfo, alt: "empty keywords" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.bold, children: __("You don`t have any keywords at the moment", "beyondseo") })
        ] })
      ]
    }
  ) });
};
const OnboardingSummaryPlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$l.editableCardsContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "60%", height: "36px", className: styles$l.summaryTitlePlaceholder }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.editableCardWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardPlaceholder, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "24px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardContentPlaceholder, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "80%", height: "20px" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "70%", height: "20px" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90%", height: "20px" })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.editableCardWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardPlaceholder, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "220px", height: "24px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardContentPlaceholder, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "40%", height: "20px" })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.editableCardWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardPlaceholder, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "180px", height: "24px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardContentPlaceholder, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.inputWithButtonPlaceholder, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "48px" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "80px", height: "48px" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.tagsPlaceholder, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100px", height: "32px" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "32px" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90px", height: "32px" })
        ] })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.editableCardWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardPlaceholder, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "150px", height: "24px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardContentPlaceholder, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "48px" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.tagsPlaceholder, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "140px", height: "32px" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "110px", height: "32px" })
        ] })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.blurredButtonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.finishButtonPlaceholder, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100px", height: "40px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "180px", height: "40px" })
    ] }) })
  ] });
};
const businessAddressCard = "OnboardingSummaryAddress-module__businessAddressCard___bPEXX";
const iframeContainer = "OnboardingSummaryAddress-module__iframeContainer___6UlE1";
const businessAddressIframe = "OnboardingSummaryAddress-module__businessAddressIframe___eikui";
const errorWrapper = "OnboardingSummaryAddress-module__errorWrapper___-T--P";
const centeredContent = "OnboardingSummaryAddress-module__centeredContent___44ttR";
const addressStyles = {
  businessAddressCard,
  iframeContainer,
  businessAddressIframe,
  errorWrapper,
  centeredContent
};
const hasRooftopPrecision = (geoAddress) => {
  try {
    const geoData = typeof geoAddress === "string" ? JSON.parse(geoAddress) : geoAddress;
    return (geoData == null ? void 0 : geoData.precision) === "ROOFTOP";
  } catch {
    return false;
  }
};
const MOBILE_BREAKPOINT = 782;
const IFRAME_MAP_URL = ((_a = rcWindow.rankingCoachReactData) == null ? void 0 : _a.iframeMapUrl) || "";
const OnboardingSummaryAddress = ({
  businessAddress,
  businessGeoAddress,
  onAddressChange,
  prefillAddressRequirement = false
}) => {
  const [sidebarOpen, setSidebarOpen] = reactExports.useState(true);
  const [showBusinessAddressIframe, setShowBusinessAddressIframe] = reactExports.useState(false);
  const iframeRef = reactExports.useRef(null);
  const isMobile = useIsMobile();
  const iframeUrlWithParams = reactExports.useMemo(() => {
    var _a2, _b2, _c2, _d2;
    let lat = "";
    let lng = "";
    let cleanedAddress = businessAddress || "";
    if (businessGeoAddress) {
      try {
        const geoData = JSON.parse(businessGeoAddress);
        lat = ((_a2 = geoData.geoPoint) == null ? void 0 : _a2.lat) || "";
        lng = ((_b2 = geoData.geoPoint) == null ? void 0 : _b2.lng) || "";
        const countryName = (_c2 = geoData.country) == null ? void 0 : _c2.name;
        if (countryName && cleanedAddress.endsWith(countryName)) {
          cleanedAddress = cleanedAddress.slice(0, -countryName.length);
        }
        cleanedAddress = cleanedAddress.trim().replace(/,+$/, "");
      } catch (error2) {
      }
    }
    const countryShortCode = ((_d2 = rcWindow.rankingCoachReactData) == null ? void 0 : _d2.countryShortCode) || "";
    const outer = new URL(IFRAME_MAP_URL);
    const innerRaw = outer.searchParams.get("redirect_url");
    const inner = new URL(innerRaw);
    inner.searchParams.set("businessAddress", cleanedAddress);
    if (countryShortCode) {
      inner.searchParams.set("countryShortCode", countryShortCode);
    }
    if (lat && lng) {
      inner.searchParams.set("lat", lat);
      inner.searchParams.set("lng", lng);
    }
    outer.searchParams.set("redirect_url", inner.toString());
    const finalUrl = outer.toString();
    return finalUrl;
  }, [businessAddress, businessGeoAddress]);
  const iframeOrigin = reactExports.useMemo(() => new URL(IFRAME_MAP_URL).origin, [IFRAME_MAP_URL]);
  const handleIframeOpen = () => {
    setShowBusinessAddressIframe(true);
  };
  const handleIframeClose = (formattedAddress, geoAddress) => {
    if (!!formattedAddress && !!geoAddress) {
      onAddressChange(formattedAddress, geoAddress);
    }
    setShowBusinessAddressIframe(false);
  };
  const handleModalClick = (e2) => {
    const target = e2.target;
    const isModalWrapper = e2.target === e2.currentTarget;
    const isIframeContainer = target.classList.contains(addressStyles.iframeContainer);
    if (isModalWrapper || isIframeContainer) {
      handleIframeClose();
    }
  };
  reactExports.useEffect(() => {
    if (!showBusinessAddressIframe) return;
    const onMessage = (e2) => {
      var _a2, _b2;
      if (e2.origin !== iframeOrigin) return;
      if (((_a2 = e2.data) == null ? void 0 : _a2.type) === "BUSINESS_ADDRESS_UPDATED") {
        const updated = ((_b2 = e2.data) == null ? void 0 : _b2.payload) ?? "";
        handleIframeClose(updated.formattedAddress, updated.geoCodeRawResults);
      }
    };
    window.addEventListener("message", onMessage);
    return () => window.removeEventListener("message", onMessage);
  }, [showBusinessAddressIframe, iframeOrigin]);
  reactExports.useEffect(() => {
    const body = document.body;
    const updateFromBody = () => {
      setSidebarOpen(!body.classList.contains("folded"));
    };
    updateFromBody();
    const obs = new MutationObserver(updateFromBody);
    obs.observe(body, { attributes: true, attributeFilter: ["class"] });
    const btn = document.getElementById("collapse-button");
    const onClick = () => {
      const expanded2 = (btn == null ? void 0 : btn.getAttribute("aria-expanded")) !== "false";
      setSidebarOpen(expanded2);
    };
    btn == null ? void 0 : btn.addEventListener("click", onClick);
    return () => {
      obs.disconnect();
      btn == null ? void 0 : btn.removeEventListener("click", onClick);
    };
  }, []);
  const containerStyle = reactExports.useMemo(() => {
    const sidebar2 = isMobile ? 0 : sidebarOpen ? 160 : 36;
    return {
      paddingLeft: `${sidebar2}px`
    };
  }, [sidebarOpen, isMobile]);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$l.editableCardWrapper, addressStyles.businessAddressCard), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      J8e,
      {
        className: "editableCard",
        title: __("Business Address", "beyondseo"),
        editCallback: handleIframeOpen,
        hideEditButton: false,
        editButtonFloatRight: true,
        padding: true,
        children: [
          prefillAddressRequirement ? /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(addressStyles.centeredContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.medium,
              iconRight: Ln.arrowRight,
              onClick: handleIframeOpen,
              children: __("Update Address", "beyondseo")
            }
          ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(O8e, { icon: Ln.location, children: businessAddress }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(addressStyles.errorWrapper), children: !hasRooftopPrecision(businessGeoAddress ?? "") && /* @__PURE__ */ jsxRuntimeExports.jsx(
            O8e,
            {
              textColor: "--e500",
              icon: Ln.exclamation,
              iconColor: "--e500",
              iconHasCircle: true,
              textType: Er.textHelp,
              children: __("Address is not precise enough, please confirm your location on the map.", "beyondseo")
            }
          ) })
        ]
      }
    ) }),
    showBusinessAddressIframe && /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.modalWrapper, onClick: handleModalClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: addressStyles.iframeContainer, style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "iframe",
      {
        ref: iframeRef,
        src: iframeUrlWithParams,
        title: __("Edit business address", "beyondseo"),
        className: addressStyles.businessAddressIframe
      }
    ) }) })
  ] });
};
function useIsMobile() {
  const [isMobile, setIsMobile] = reactExports.useState(false);
  reactExports.useEffect(() => {
    var _a2, _b2;
    const mq = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);
    const update2 = () => setIsMobile(mq.matches);
    update2();
    (_a2 = mq.addEventListener) == null ? void 0 : _a2.call(mq, "change", update2);
    (_b2 = mq.addListener) == null ? void 0 : _b2.call(mq, update2);
    return () => {
      var _a3, _b3;
      (_a3 = mq.removeEventListener) == null ? void 0 : _a3.call(mq, "change", update2);
      (_b3 = mq.removeListener) == null ? void 0 : _b3.call(mq, update2);
    };
  }, []);
  return isMobile;
}
const CategorySearchSelect = ({
  searchText,
  onSearchChange,
  options,
  onSelection,
  value,
  isLoading,
  placeholder,
  onLoadMore,
  hasMore,
  totalCount
}) => {
  const [isOpen, setIsOpen] = reactExports.useState(false);
  const listRef = reactExports.useRef(null);
  reactExports.useEffect(() => {
    if (!isOpen) return;
    const onPointerDownCapture = (e2) => {
      const target = e2.target;
      if (!target) return;
      if (target.closest(".category-search-select-wrapper")) return;
      setIsOpen(false);
    };
    const onKeyDownCapture = (e2) => {
      if (e2.key === "Escape") {
        setIsOpen(false);
      }
    };
    document.addEventListener("pointerdown", onPointerDownCapture, true);
    document.addEventListener("keydown", onKeyDownCapture, true);
    return () => {
      document.removeEventListener("pointerdown", onPointerDownCapture, true);
      document.removeEventListener("keydown", onKeyDownCapture, true);
    };
  }, [isOpen]);
  const handleScroll = reactExports.useCallback(({ scrollOffset, scrollUpdateWasRequested }) => {
    if (scrollUpdateWasRequested || !listRef.current) return;
    const listHeight = 350;
    const itemHeight = 44;
    const totalHeight = options.length * itemHeight;
    const scrollThreshold = 100;
    if (totalHeight - scrollOffset - listHeight < scrollThreshold) {
      if (hasMore && !isLoading) {
        onLoadMore();
      }
    }
  }, [hasMore, isLoading, onLoadMore, options.length]);
  !searchText || searchText.length < 2;
  const Row = ({ index, style }) => {
    const option = options[index];
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        style,
        className: styles$l.dropdownItem,
        onClick: () => {
          onSelection(option.value);
          setIsOpen(false);
        },
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { children: option.title })
      }
    );
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt("category-search-select-wrapper"), children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      L8e,
      {
        value: searchText,
        onChange: (e2) => onSearchChange(e2.target.value),
        placeholder,
        label: false,
        onFocus: () => setIsOpen(true)
      }
    ),
    isOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
      Li,
      {
        className: styles$l.categoryDropdown,
        children: options.length === 0 && isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$l.dropdownMessage, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.large, className: "loader-spinner", children: Ln.save }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textCaption, children: __("Loading categories...", "beyondseo") })
        ] }) : searchText.length > 0 && searchText.length < 2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.dropdownMessage, children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textCaption, children: __("Type at least 2 characters to search categories", "beyondseo") }) }) : options.length === 0 && !isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.dropdownMessage, children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textCaption, children: __("No categories found for your search.", "beyondseo") }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            FixedSizeList,
            {
              ref: listRef,
              height: Math.min(350, options.length * 44),
              itemCount: options.length,
              itemSize: 44,
              width: "100%",
              onScroll: handleScroll,
              className: styles$l.virtualList,
              children: Row
            }
          ),
          isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$l.dropdownLoadingMore, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, className: "loader-spinner", children: Ln.save }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textCaption, children: __("Loading more...", "beyondseo") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.dropdownFooter, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.textCaption, children: [
            options.length,
            " ",
            __("of", "beyondseo"),
            " ",
            totalCount,
            " ",
            __("categories", "beyondseo")
          ] }) })
        ] })
      }
    ),
    isOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.dropdownOverlay, onClick: () => setIsOpen(false) })
  ] });
};
const WELCOME_TEXTS_STEP8 = "Here`s a summary of your website profile. Everything looks good?";
const IS_FORM_VALID_POPOVER_MESSAGE = __(
  "All fields are required. To finish onboarding, set your address on the map and add at least five keywords and one category.",
  "beyondseo"
);
const MAX_CATEGORIES = 10;
const MIN_KEYWORDS = 5;
const MIN_CATEGORIES = 1;
const NOT_ALLOWED_CHARACTERS_IN_BUSINESS_NAME_MESSAGE = __(
  "We cannot accept names with certain special characters, because these names must be published later uniformly in online directories, which partially reject these characters. This is in the best interest of your company, as publishing information in many online directories will significantly improve your local visibility and local rankings on Google",
  "beyondseo"
);
const OnboardingSummary = ({
  onFinish,
  onCancel,
  websiteDescription,
  onDescriptionChange
}) => {
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [isFinishing, setIsFinishing] = reactExports.useState(false);
  const [showDescriptionModal, setShowDescriptionModal] = reactExports.useState(false);
  const [showBusinessInfoModal, setShowBusinessInfoModal] = reactExports.useState(false);
  const [showErrorModal, setShowErrorModal] = reactExports.useState(false);
  const [errorMessage, setErrorMessage] = reactExports.useState("");
  const [errorDetails, setErrorDetails] = reactExports.useState(null);
  const [businessName, setBusinessName] = reactExports.useState("");
  const [websiteUrl, setWebsiteUrl] = reactExports.useState("");
  const [businessAddress, setBusinessAddress] = reactExports.useState("");
  const [businessGeoAddress, setBusinessGeoAddress] = reactExports.useState("");
  const [tempDescription, setTempDescription] = reactExports.useState(websiteDescription);
  const [descriptionError, setDescriptionError] = reactExports.useState("");
  const [tempBusinessName, setTempBusinessName] = reactExports.useState(businessName);
  const [businessNameError, setBusinessNameError] = reactExports.useState("");
  const [keywords, setKeywords] = reactExports.useState([]);
  const [categories, setCategories] = reactExports.useState([]);
  const [selectedCategoryId, setSelectedCategoryId] = reactExports.useState("");
  const [searchOptions, setSearchOptions] = reactExports.useState([]);
  const [categoryError, setCategoryError] = reactExports.useState("");
  const [isCategoryLoading, setIsCategoryLoading] = reactExports.useState(false);
  const [categorySearchText, setCategorySearchText] = reactExports.useState("");
  const [categoryOffset, setCategoryOffset] = reactExports.useState(0);
  const [categoryTotalCount, setCategoryTotalCount] = reactExports.useState(0);
  const [hasMoreCategories, setHasMoreCategories] = reactExports.useState(true);
  const [isAddressDisabled, setIsAddressDisabled] = reactExports.useState(false);
  const [prefillAddressRequirement, setPrefillAddressRequirement] = reactExports.useState(false);
  const dispatch = useAppDispatch();
  const { plugin } = useSelector((state) => state.app);
  reactExports.useEffect(() => {
    setIsLoading(true);
    dispatch(OnboardingStore.getApiOnboardingRequirementsThunk({})).unwrap().then((response) => {
      var _a2;
      const requirements = (_a2 = response == null ? void 0 : response.requirements) == null ? void 0 : _a2.elements;
      if (requirements) {
        const businessNameReq = requirements.find((req) => req.setupRequirement === "businessName");
        const websiteUrlReq = requirements.find((req) => req.setupRequirement === "businessWebsiteUrl");
        const descriptionReq = requirements.find((req) => req.setupRequirement === "businessDescription");
        const addressReq = requirements.find((req) => req.setupRequirement === "businessAddress");
        const keywordsReq = requirements.find((req) => req.setupRequirement === "businessKeywords");
        const categoriesReq = requirements.find((req) => req.setupRequirement === "businessCategories");
        const geoAddressReq = requirements.find((req) => req.setupRequirement === "businessGeoAddress");
        try {
          if (geoAddressReq == null ? void 0 : geoAddressReq.value) {
            const geoAddress = JSON.parse(geoAddressReq.value);
            setBusinessGeoAddress(geoAddressReq.value);
            setIsAddressDisabled(!!geoAddress);
            if (geoAddress.prefilledAddress === true) {
              setPrefillAddressRequirement(true);
            }
          }
        } catch (e2) {
          setIsAddressDisabled(false);
          setPrefillAddressRequirement(false);
        }
        if (businessNameReq == null ? void 0 : businessNameReq.value) {
          setBusinessName(businessNameReq.value);
          setTempBusinessName(businessNameReq.value);
        }
        if (websiteUrlReq == null ? void 0 : websiteUrlReq.value) {
          setWebsiteUrl(websiteUrlReq.value);
        }
        if (descriptionReq == null ? void 0 : descriptionReq.value) {
          onDescriptionChange(descriptionReq.value);
          setTempDescription(descriptionReq.value);
        }
        if (addressReq == null ? void 0 : addressReq.value) {
          setBusinessAddress(addressReq.value);
        }
        if (keywordsReq == null ? void 0 : keywordsReq.value) {
          try {
            const keywordArray = JSON.parse(keywordsReq.value).map((keyword, index) => ({
              id: index + 1,
              text: keyword.replace(/['"]+/g, "").trim()
            }));
            setKeywords(keywordArray);
          } catch (e2) {
            const keywordArray = keywordsReq.value.split(",").map((keyword, index) => ({
              id: index + 1,
              text: keyword.replace(/['"]+/g, "").trim()
            }));
            setKeywords(keywordArray);
          }
        }
        if (categoriesReq == null ? void 0 : categoriesReq.value) {
          try {
            const categoryArray = JSON.parse(categoriesReq.value).map((category, index) => ({
              id: index + 1,
              text: category.replace(/['"]+/g, "").trim()
            }));
            setCategories(categoryArray);
          } catch (e2) {
            const categoryArray = categoriesReq.value.split(",").map((category, index) => ({
              id: index + 1,
              text: category.replace(/['"]+/g, "").trim()
            }));
            setCategories(categoryArray);
          }
        }
      }
    }).finally(() => {
      setIsLoading(false);
    });
  }, [dispatch]);
  reactExports.useEffect(() => {
    setIsCategoryLoading(true);
    dispatch(
      OnboardingStore.getApiOnboardingCategoriesThunk({
        search: ""
      })
    ).unwrap().then((response) => {
      var _a2;
      if ((_a2 = response == null ? void 0 : response.categories) == null ? void 0 : _a2.elements) {
        const allCategories = response.categories.elements.map((category, index) => ({
          value: `category-${index}-${category.name}`,
          title: category.name || ""
        }));
        setSearchOptions(allCategories.slice(0, 300));
        setCategoryOffset(300);
        setCategoryTotalCount(allCategories.length);
        setHasMoreCategories(allCategories.length > 300);
        window.__allCategories = allCategories;
      }
    }).finally(() => {
      setIsCategoryLoading(false);
    });
  }, [dispatch]);
  const updateSingleRequirement = (setupRequirementName, value) => {
    dispatch(
      OnboardingStore.postApiOnboardingRequirementsThunk({
        requestBody: {
          requirement: {
            setupRequirement: setupRequirementName,
            value,
            objectType: WPRequirementObjectType.BeyondSEO_Domain_Integrations_WordPress_Setup_Entities_Flows_Requirements_WPRequirement
          }
        },
        queryParams: {}
      })
    );
  };
  const handleDescriptionEdit = () => {
    setTempDescription(websiteDescription);
    setShowDescriptionModal(true);
  };
  const handleDescriptionSave = () => {
    if (tempDescription.length > 750) {
      setDescriptionError(__("Website description can have maximum 750 characters.", "beyondseo"));
      return;
    }
    onDescriptionChange(tempDescription);
    setTempDescription(tempDescription);
    setShowDescriptionModal(false);
    updateSingleRequirement("businessDescription", tempDescription);
  };
  const handleBusinessInfoEdit = () => {
    setTempBusinessName(businessName);
    setShowBusinessInfoModal(true);
  };
  const handleBusinessInfoSave = () => {
    if (tempBusinessName.trim().length < 3) {
      setBusinessNameError(__("Please enter at least 3 characters.", "beyondseo"));
      return;
    }
    const forbiddenCharRegex = /[^\p{L}0-9()\[\]?:;\/!,・.\-%&_*§²`´·’"' +¡¿@“”\s]/u;
    if (forbiddenCharRegex.test(tempBusinessName)) {
      setBusinessNameError(__(NOT_ALLOWED_CHARACTERS_IN_BUSINESS_NAME_MESSAGE, "beyondseo"));
      return;
    }
    const punctuationCount = (tempBusinessName.match(/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g) || []).length;
    if (punctuationCount > 6) {
      setBusinessNameError(__("This field contains too many punctuations. The maximum allowed is 6.", "beyondseo"));
      return;
    }
    setBusinessNameError("");
    setBusinessName(tempBusinessName);
    setShowBusinessInfoModal(false);
    updateSingleRequirement("businessName", tempBusinessName);
  };
  const handleAddressChange = (address, geoAddress) => {
    setBusinessAddress(address);
    setBusinessGeoAddress(geoAddress);
    updateSingleRequirement("businessAddress", address);
    updateSingleRequirement("businessGeoAddress", geoAddress);
    setPrefillAddressRequirement(false);
  };
  const handleAddCategory = (categoryText) => {
    setCategoryError("");
    if (!categoryText.trim()) return;
    if (categories.some((cat) => cat.text === categoryText.trim())) {
      setCategoryError(__("You already have added this category", "beyondseo"));
      return;
    }
    if (categories.length >= MAX_CATEGORIES) {
      setCategoryError(__("You can not add more than 10 categories", "beyondseo"));
      return;
    }
    setCategories((prevCategories) => {
      const newCategories = [
        ...prevCategories,
        { id: Math.max(...prevCategories.map((c) => c.id), 0) + 1, text: categoryText.trim() }
      ];
      updateSingleRequirement("businessCategories", JSON.stringify(newCategories.map((c) => c.text)));
      return newCategories;
    });
    setSelectedCategoryId("");
  };
  const handleCategoryDelete = (id) => {
    if (id !== void 0) {
      setCategories((prevCategories) => {
        const newCategories = prevCategories.filter((category) => category.id !== Number(id));
        updateSingleRequirement("businessCategories", JSON.stringify(newCategories.map((c) => c.text)));
        return newCategories;
      });
    }
  };
  const handleCategorySelection = (categoryId) => {
    setSelectedCategoryId(categoryId);
    const selectedOption = searchOptions.find((opt) => opt.value === categoryId);
    if (selectedOption == null ? void 0 : selectedOption.title) {
      handleAddCategory(selectedOption.title);
      setCategorySearchText("");
      const allCategories = window.__allCategories || [];
      setSearchOptions(allCategories.slice(0, 300));
      setCategoryOffset(300);
      setHasMoreCategories(allCategories.length > 300);
    }
  };
  reactExports.useEffect(() => {
    if (!businessGeoAddress) return;
    try {
      const geo = JSON.parse(businessGeoAddress);
      if ((geo == null ? void 0 : geo.precision) === "ROOFTOP" && (geo == null ? void 0 : geo.formattedAddress) && geo.formattedAddress !== businessAddress) {
        setBusinessAddress(geo.formattedAddress);
        updateSingleRequirement("businessAddress", geo.formattedAddress);
      }
    } catch (e2) {
    }
  }, [businessGeoAddress]);
  const isFormValid = () => {
    return !!((websiteDescription == null ? void 0 : websiteDescription.trim()) && (businessName == null ? void 0 : businessName.trim()) && (businessAddress == null ? void 0 : businessAddress.trim()) && (businessGeoAddress == null ? void 0 : businessGeoAddress.trim()) && hasRooftopPrecision(businessGeoAddress) && keywords.length >= MIN_KEYWORDS && categories.length >= MIN_CATEGORIES);
  };
  const handleFinish = async () => {
    if (isFinishing) return;
    setIsFinishing(true);
    setErrorDetails(null);
    try {
      onFinish();
    } catch (error2) {
      setErrorMessage((error2 == null ? void 0 : error2.message) || __("An unexpected error occurred", "beyondseo"));
      setErrorDetails((error2 == null ? void 0 : error2.content) || error2);
      setShowErrorModal(true);
      setIsFinishing(false);
    }
  };
  const debouncedSearchRef = reactExports.useRef(
    debounce((searchValue) => {
      if (searchValue.length >= 2) {
        setIsCategoryLoading(true);
        setCategoryOffset(0);
        dispatch(
          OnboardingStore.getApiOnboardingCategoriesThunk({
            search: searchValue
          })
        ).unwrap().then((response) => {
          var _a2;
          if ((_a2 = response == null ? void 0 : response.categories) == null ? void 0 : _a2.elements) {
            const allResults = response.categories.elements.map((category, index) => ({
              value: `category-${index}-${category.name}`,
              title: category.name || ""
            }));
            setSearchOptions(allResults.slice(0, 100));
            setCategoryOffset(100);
            setCategoryTotalCount(allResults.length);
            setHasMoreCategories(allResults.length > 100);
            window.__searchCategories = allResults;
          }
        }).finally(() => {
          setIsCategoryLoading(false);
        });
      }
    }, 400)
  );
  const handleCategorySearchChange = reactExports.useCallback(
    (value) => {
      setCategorySearchText(value);
      if (value.length >= 2) {
        debouncedSearchRef.current(value);
      } else {
        const allCategories = window.__allCategories || [];
        setSearchOptions(allCategories.slice(0, 300));
        setCategoryOffset(300);
        setCategoryTotalCount(allCategories.length);
        setHasMoreCategories(allCategories.length > 300);
      }
    },
    [dispatch]
  );
  const handleLoadMoreCategories = reactExports.useCallback(() => {
    if (isCategoryLoading || !hasMoreCategories) return;
    setIsCategoryLoading(true);
    const limit = 100;
    setTimeout(() => {
      const allData = categorySearchText.length >= 2 ? window.__searchCategories || [] : window.__allCategories || [];
      const nextBatch = allData.slice(categoryOffset, categoryOffset + limit);
      setSearchOptions((prev) => [...prev, ...nextBatch]);
      setCategoryOffset((prev) => prev + limit);
      setHasMoreCategories(categoryOffset + limit < allData.length);
      setIsCategoryLoading(false);
    }, 300);
  }, [categoryOffset, categorySearchText, isCategoryLoading, hasMoreCategories]);
  if (isLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingSummaryPlaceholder, {});
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt(styles$l.editableCardsContainer), children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      nr,
      {
        className: Kt(styles$l.summaryTitle),
        type: Er.heading3,
        fontWeight: si.bold,
        textAlign: "center",
        children: __(WELCOME_TEXTS_STEP8, "beyondseo")
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$l.businessInfoRow, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$l.editableCardWrapper, styles$l.businessInfoCard), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        J8e,
        {
          className: "editableCard",
          title: __("Business Information", "beyondseo"),
          editCallback: handleBusinessInfoEdit,
          hideEditButton: false,
          editButtonFloatRight: true,
          padding: true,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt(styles$l.businessInfoWrapper), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(O8e, { icon: Ln.tag, children: businessName }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(O8e, { icon: Ln.browser, children: websiteUrl })
          ] })
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        OnboardingSummaryAddress,
        {
          businessAddress,
          businessGeoAddress,
          onAddressChange: handleAddressChange,
          isAddressDisabled,
          prefillAddressRequirement
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$l.editableCardWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      J8e,
      {
        className: "editableCard",
        title: __("Website Description", "beyondseo"),
        editCallback: handleDescriptionEdit,
        hideEditButton: false,
        editButtonFloatRight: true,
        padding: true,
        actionBtns: (websiteDescription == null ? void 0 : websiteDescription.trim()) ? /* @__PURE__ */ jsxRuntimeExports.jsx(NEe, { text: __("Generated by us", "beyondseo") }) : void 0,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: (websiteDescription == null ? void 0 : websiteDescription.trim()) ? /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, children: websiteDescription }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.empty, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: Kt(styles$l.img), src: emptyStateUfo, alt: __("loading...", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.bold, children: __("You don`t have any website description at the moment", "beyondseo") })
        ] }) })
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingSummaryKeyword, { keywords, setKeywords }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$l.editableCardWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      J8e,
      {
        className: "editableCard",
        title: __("Categories", "beyondseo"),
        editCallback: () => {
        },
        hideEditButton: true,
        padding: true,
        editButtonFloatRight: true,
        actionBtns: categories.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NEe, { text: __("Generated by us", "beyondseo") }) : void 0,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.keywordInputContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.autocompleteContainer, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CategorySearchSelect,
              {
                searchText: categorySearchText,
                onSearchChange: handleCategorySearchChange,
                options: searchOptions,
                onSelection: handleCategorySelection,
                value: selectedCategoryId,
                isLoading: isCategoryLoading,
                placeholder: __("Search category eg.: Computer repair shop", "beyondseo"),
                onLoadMore: handleLoadMoreCategories,
                hasMore: hasMoreCategories,
                totalCount: categoryTotalCount
              }
            ),
            categoryError && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, className: Kt(styles$l.errorTextCategories), children: categoryError })
          ] }) }),
          categories.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            j8e,
            {
              tags: categories.reduce((tags, element) => {
                tags.push({
                  id: element.id,
                  text: element.text,
                  hasDeleteBtn: true,
                  deleteBtnCallback: handleCategoryDelete
                });
                return tags;
              }, [])
            }
          ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.empty, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: Kt(styles$l.img), src: emptyStateUfo, alt: "empty categories" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.bold, children: __("You dont have any categories at the moment", "beyondseo") })
          ] })
        ]
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(styles$l.blurredButtonContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Li,
      {
        className: Kt(S8e.dFlex, S8e.justifyContentEnd, S8e.gap8),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(gh, { type: Vo.secondary, size: uf.medium, onClick: onCancel, disabled: isFinishing, children: __("Cancel", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            jp,
            {
              position: "right",
              message: isFormValid() ? void 0 : __(IS_FORM_VALID_POPOVER_MESSAGE, "beyondseo"),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                gh,
                {
                  type: Vo.primary,
                  size: uf.medium,
                  iconRight: Ln.arrowRight,
                  onClick: handleFinish,
                  disabled: !isFormValid() || isFinishing,
                  isLoading: isLoading || isFinishing,
                  children: __("Finish Onboarding", "beyondseo")
                }
              ) })
            }
          ) })
        ]
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$l.bottomSpacer }),
    showDescriptionModal && /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.modalWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      e9e,
      {
        title: __("Edit website description", "beyondseo"),
        close: () => setShowDescriptionModal(false),
        closeOnSave: true,
        savable: true,
        saveCallback: handleDescriptionSave,
        cancelCallback: () => setShowDescriptionModal(false),
        savingInProgress: false,
        width: "528px",
        positiveBtnText: __("Save", "beyondseo"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            D8e,
            {
              value: tempDescription,
              onChange: (e2) => {
                const value = e2.target.value;
                setTempDescription(value);
                if (value.length > 750) {
                  setDescriptionError(__("Website description can have maximum 750 characters.", "beyondseo"));
                } else {
                  setDescriptionError("");
                }
              },
              rows: 6,
              minRows: 2,
              placeholder: __("Enter website description", "beyondseo"),
              className: Kt(styles$l.modalTextarea, descriptionError ? styles$l.errorInput : ""),
              label: __("Website Description", "beyondseo"),
              required: true
            }
          ),
          descriptionError && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, className: styles$l.errorText, children: descriptionError })
        ]
      }
    ) }),
    showBusinessInfoModal && /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$l.modalWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      e9e,
      {
        title: __("Edit Business Information", "beyondseo"),
        close: () => setShowBusinessInfoModal(false),
        closeOnSave: true,
        savable: true,
        saveCallback: handleBusinessInfoSave,
        cancelCallback: () => setShowBusinessInfoModal(false),
        savingInProgress: false,
        width: "528px",
        positiveBtnText: __("Save", "beyondseo"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(N8e, { className: styles$l.businessInfoForm, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: __("Business Name", "beyondseo"),
              required: true,
              value: tempBusinessName,
              onChange: (e2) => {
                setTempBusinessName(e2.target.value);
                setBusinessNameError("");
              },
              placeholder: __("Enter business name", "beyondseo"),
              className: Kt(businessNameError ? styles$l.errorInput : "")
            }
          ),
          businessNameError && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, className: styles$l.businessNameErrorText, children: businessNameError }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: __("Website URL", "beyondseo"),
              required: true,
              value: websiteUrl,
              disabled: true,
              placeholder: __("Enter website URL", "beyondseo")
            }
          )
        ] })
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ErrorModal,
      {
        isOpen: showErrorModal,
        onClose: () => setShowErrorModal(false),
        errorMessage: errorMessage || __("Something went wrong from our side, please try again!", "beyondseo"),
        errorDetails,
        isLoading: isFinishing
      }
    )
  ] });
};
const fullscreen = "AIOrb-module__fullscreen___ZGZVj";
const aiOrb = "AIOrb-module__ai-orb___Q-jqZ";
const orbsContainer = "AIOrb-module__orbs-container___fDTKN";
const orbs = "AIOrb-module__orbs___H-W3u";
const orbsLarge = "AIOrb-module__orbs-large___KjRMH";
const styles$j = {
  fullscreen,
  aiOrb,
  orbsContainer,
  orbs,
  orbsLarge
};
let updateQueue = makeQueue();
const raf = (fn) => schedule(fn, updateQueue);
let writeQueue = makeQueue();
raf.write = (fn) => schedule(fn, writeQueue);
let onStartQueue = makeQueue();
raf.onStart = (fn) => schedule(fn, onStartQueue);
let onFrameQueue = makeQueue();
raf.onFrame = (fn) => schedule(fn, onFrameQueue);
let onFinishQueue = makeQueue();
raf.onFinish = (fn) => schedule(fn, onFinishQueue);
let timeouts = [];
raf.setTimeout = (handler, ms) => {
  let time = raf.now() + ms;
  let cancel = () => {
    let i = timeouts.findIndex((t) => t.cancel == cancel);
    if (~i) timeouts.splice(i, 1);
    pendingCount -= ~i ? 1 : 0;
  };
  let timeout = {
    time,
    handler,
    cancel
  };
  timeouts.splice(findTimeout(time), 0, timeout);
  pendingCount += 1;
  start();
  return timeout;
};
let findTimeout = (time) => ~(~timeouts.findIndex((t) => t.time > time) || ~timeouts.length);
raf.cancel = (fn) => {
  onStartQueue.delete(fn);
  onFrameQueue.delete(fn);
  updateQueue.delete(fn);
  writeQueue.delete(fn);
  onFinishQueue.delete(fn);
};
raf.sync = (fn) => {
  sync = true;
  raf.batchedUpdates(fn);
  sync = false;
};
raf.throttle = (fn) => {
  let lastArgs;
  function queuedFn() {
    try {
      fn(...lastArgs);
    } finally {
      lastArgs = null;
    }
  }
  function throttled(...args) {
    lastArgs = args;
    raf.onStart(queuedFn);
  }
  throttled.handler = fn;
  throttled.cancel = () => {
    onStartQueue.delete(queuedFn);
    lastArgs = null;
  };
  return throttled;
};
let nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : () => {
};
raf.use = (impl) => nativeRaf = impl;
raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now;
raf.batchedUpdates = (fn) => fn();
raf.catch = console.error;
raf.frameLoop = "always";
raf.advance = () => {
  if (raf.frameLoop !== "demand") {
    console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand");
  } else {
    update();
  }
};
let ts = -1;
let pendingCount = 0;
let sync = false;
function schedule(fn, queue) {
  if (sync) {
    queue.delete(fn);
    fn(0);
  } else {
    queue.add(fn);
    start();
  }
}
function start() {
  if (ts < 0) {
    ts = 0;
    if (raf.frameLoop !== "demand") {
      nativeRaf(loop);
    }
  }
}
function stop() {
  ts = -1;
}
function loop() {
  if (~ts) {
    nativeRaf(loop);
    raf.batchedUpdates(update);
  }
}
function update() {
  let prevTs = ts;
  ts = raf.now();
  let count = findTimeout(ts);
  if (count) {
    eachSafely(timeouts.splice(0, count), (t) => t.handler());
    pendingCount -= count;
  }
  onStartQueue.flush();
  updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
  onFrameQueue.flush();
  writeQueue.flush();
  onFinishQueue.flush();
  if (!pendingCount) {
    stop();
  }
}
function makeQueue() {
  let next = /* @__PURE__ */ new Set();
  let current = next;
  return {
    add(fn) {
      pendingCount += current == next && !next.has(fn) ? 1 : 0;
      next.add(fn);
    },
    delete(fn) {
      pendingCount -= current == next && next.has(fn) ? 1 : 0;
      return next.delete(fn);
    },
    flush(arg) {
      if (current.size) {
        next = /* @__PURE__ */ new Set();
        pendingCount -= current.size;
        eachSafely(current, (fn) => fn(arg) && next.add(fn));
        pendingCount += next.size;
        current = next;
      }
    }
  };
}
function eachSafely(values, each2) {
  values.forEach((value) => {
    try {
      each2(value);
    } catch (e2) {
      raf.catch(e2);
    }
  });
}
function noop() {
}
const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, {
  value,
  writable: true,
  configurable: true
});
const is = {
  arr: Array.isArray,
  obj: (a) => !!a && a.constructor.name === "Object",
  fun: (a) => typeof a === "function",
  str: (a) => typeof a === "string",
  num: (a) => typeof a === "number",
  und: (a) => a === void 0
};
function isEqual(a, b) {
  if (is.arr(a)) {
    if (!is.arr(b) || a.length !== b.length) return false;
    for (let i = 0; i < a.length; i++) {
      if (a[i] !== b[i]) return false;
    }
    return true;
  }
  return a === b;
}
const each = (obj, fn) => obj.forEach(fn);
function eachProp(obj, fn, ctx2) {
  if (is.arr(obj)) {
    for (let i = 0; i < obj.length; i++) {
      fn.call(ctx2, obj[i], `${i}`);
    }
    return;
  }
  for (const key in obj) {
    if (obj.hasOwnProperty(key)) {
      fn.call(ctx2, obj[key], key);
    }
  }
}
const toArray = (a) => is.und(a) ? [] : is.arr(a) ? a : [a];
function flush(queue, iterator) {
  if (queue.size) {
    const items = Array.from(queue);
    queue.clear();
    each(items, iterator);
  }
}
const flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args));
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
let createStringInterpolator$1;
let to;
let colors$1 = null;
let skipAnimation = false;
let willAdvance = noop;
const assign = (globals2) => {
  if (globals2.to) to = globals2.to;
  if (globals2.now) raf.now = globals2.now;
  if (globals2.colors !== void 0) colors$1 = globals2.colors;
  if (globals2.skipAnimation != null) skipAnimation = globals2.skipAnimation;
  if (globals2.createStringInterpolator) createStringInterpolator$1 = globals2.createStringInterpolator;
  if (globals2.requestAnimationFrame) raf.use(globals2.requestAnimationFrame);
  if (globals2.batchedUpdates) raf.batchedUpdates = globals2.batchedUpdates;
  if (globals2.willAdvance) willAdvance = globals2.willAdvance;
  if (globals2.frameLoop) raf.frameLoop = globals2.frameLoop;
};
var globals = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  get createStringInterpolator() {
    return createStringInterpolator$1;
  },
  get to() {
    return to;
  },
  get colors() {
    return colors$1;
  },
  get skipAnimation() {
    return skipAnimation;
  },
  get willAdvance() {
    return willAdvance;
  },
  assign
});
const startQueue = /* @__PURE__ */ new Set();
let currentFrame = [];
let prevFrame = [];
let priority = 0;
const frameLoop = {
  get idle() {
    return !startQueue.size && !currentFrame.length;
  },
  start(animation) {
    if (priority > animation.priority) {
      startQueue.add(animation);
      raf.onStart(flushStartQueue);
    } else {
      startSafely(animation);
      raf(advance);
    }
  },
  advance,
  sort(animation) {
    if (priority) {
      raf.onFrame(() => frameLoop.sort(animation));
    } else {
      const prevIndex = currentFrame.indexOf(animation);
      if (~prevIndex) {
        currentFrame.splice(prevIndex, 1);
        startUnsafely(animation);
      }
    }
  },
  clear() {
    currentFrame = [];
    startQueue.clear();
  }
};
function flushStartQueue() {
  startQueue.forEach(startSafely);
  startQueue.clear();
  raf(advance);
}
function startSafely(animation) {
  if (!currentFrame.includes(animation)) startUnsafely(animation);
}
function startUnsafely(animation) {
  currentFrame.splice(findIndex(currentFrame, (other) => other.priority > animation.priority), 0, animation);
}
function advance(dt) {
  const nextFrame = prevFrame;
  for (let i = 0; i < currentFrame.length; i++) {
    const animation = currentFrame[i];
    priority = animation.priority;
    if (!animation.idle) {
      willAdvance(animation);
      animation.advance(dt);
      if (!animation.idle) {
        nextFrame.push(animation);
      }
    }
  }
  priority = 0;
  prevFrame = currentFrame;
  prevFrame.length = 0;
  currentFrame = nextFrame;
  return currentFrame.length > 0;
}
function findIndex(arr, test) {
  const index = arr.findIndex(test);
  return index < 0 ? arr.length : index;
}
const colors = {
  transparent: 0,
  aliceblue: 4042850303,
  antiquewhite: 4209760255,
  aqua: 16777215,
  aquamarine: 2147472639,
  azure: 4043309055,
  beige: 4126530815,
  bisque: 4293182719,
  black: 255,
  blanchedalmond: 4293643775,
  blue: 65535,
  blueviolet: 2318131967,
  brown: 2771004159,
  burlywood: 3736635391,
  burntsienna: 3934150143,
  cadetblue: 1604231423,
  chartreuse: 2147418367,
  chocolate: 3530104575,
  coral: 4286533887,
  cornflowerblue: 1687547391,
  cornsilk: 4294499583,
  crimson: 3692313855,
  cyan: 16777215,
  darkblue: 35839,
  darkcyan: 9145343,
  darkgoldenrod: 3095792639,
  darkgray: 2846468607,
  darkgreen: 6553855,
  darkgrey: 2846468607,
  darkkhaki: 3182914559,
  darkmagenta: 2332068863,
  darkolivegreen: 1433087999,
  darkorange: 4287365375,
  darkorchid: 2570243327,
  darkred: 2332033279,
  darksalmon: 3918953215,
  darkseagreen: 2411499519,
  darkslateblue: 1211993087,
  darkslategray: 793726975,
  darkslategrey: 793726975,
  darkturquoise: 13554175,
  darkviolet: 2483082239,
  deeppink: 4279538687,
  deepskyblue: 12582911,
  dimgray: 1768516095,
  dimgrey: 1768516095,
  dodgerblue: 512819199,
  firebrick: 2988581631,
  floralwhite: 4294635775,
  forestgreen: 579543807,
  fuchsia: 4278255615,
  gainsboro: 3705462015,
  ghostwhite: 4177068031,
  gold: 4292280575,
  goldenrod: 3668254975,
  gray: 2155905279,
  green: 8388863,
  greenyellow: 2919182335,
  grey: 2155905279,
  honeydew: 4043305215,
  hotpink: 4285117695,
  indianred: 3445382399,
  indigo: 1258324735,
  ivory: 4294963455,
  khaki: 4041641215,
  lavender: 3873897215,
  lavenderblush: 4293981695,
  lawngreen: 2096890111,
  lemonchiffon: 4294626815,
  lightblue: 2916673279,
  lightcoral: 4034953471,
  lightcyan: 3774873599,
  lightgoldenrodyellow: 4210742015,
  lightgray: 3553874943,
  lightgreen: 2431553791,
  lightgrey: 3553874943,
  lightpink: 4290167295,
  lightsalmon: 4288707327,
  lightseagreen: 548580095,
  lightskyblue: 2278488831,
  lightslategray: 2005441023,
  lightslategrey: 2005441023,
  lightsteelblue: 2965692159,
  lightyellow: 4294959359,
  lime: 16711935,
  limegreen: 852308735,
  linen: 4210091775,
  magenta: 4278255615,
  maroon: 2147483903,
  mediumaquamarine: 1724754687,
  mediumblue: 52735,
  mediumorchid: 3126187007,
  mediumpurple: 2473647103,
  mediumseagreen: 1018393087,
  mediumslateblue: 2070474495,
  mediumspringgreen: 16423679,
  mediumturquoise: 1221709055,
  mediumvioletred: 3340076543,
  midnightblue: 421097727,
  mintcream: 4127193855,
  mistyrose: 4293190143,
  moccasin: 4293178879,
  navajowhite: 4292783615,
  navy: 33023,
  oldlace: 4260751103,
  olive: 2155872511,
  olivedrab: 1804477439,
  orange: 4289003775,
  orangered: 4282712319,
  orchid: 3664828159,
  palegoldenrod: 4008225535,
  palegreen: 2566625535,
  paleturquoise: 2951671551,
  palevioletred: 3681588223,
  papayawhip: 4293907967,
  peachpuff: 4292524543,
  peru: 3448061951,
  pink: 4290825215,
  plum: 3718307327,
  powderblue: 2967529215,
  purple: 2147516671,
  rebeccapurple: 1714657791,
  red: 4278190335,
  rosybrown: 3163525119,
  royalblue: 1097458175,
  saddlebrown: 2336560127,
  salmon: 4202722047,
  sandybrown: 4104413439,
  seagreen: 780883967,
  seashell: 4294307583,
  sienna: 2689740287,
  silver: 3233857791,
  skyblue: 2278484991,
  slateblue: 1784335871,
  slategray: 1887473919,
  slategrey: 1887473919,
  snow: 4294638335,
  springgreen: 16744447,
  steelblue: 1182971135,
  tan: 3535047935,
  teal: 8421631,
  thistle: 3636451583,
  tomato: 4284696575,
  turquoise: 1088475391,
  violet: 4001558271,
  wheat: 4125012991,
  white: 4294967295,
  whitesmoke: 4126537215,
  yellow: 4294902015,
  yellowgreen: 2597139199
};
const NUMBER = "[-+]?\\d*\\.?\\d+";
const PERCENTAGE = NUMBER + "%";
function call(...parts) {
  return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)";
}
const rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
const rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
const hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
const hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
const hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
const hex6 = /^#([0-9a-fA-F]{6})$/;
const hex8 = /^#([0-9a-fA-F]{8})$/;
function normalizeColor$1(color) {
  let match;
  if (typeof color === "number") {
    return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
  }
  if (match = hex6.exec(color)) return parseInt(match[1] + "ff", 16) >>> 0;
  if (colors$1 && colors$1[color] !== void 0) {
    return colors$1[color];
  }
  if (match = rgb.exec(color)) {
    return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 255) >>> 0;
  }
  if (match = rgba.exec(color)) {
    return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0;
  }
  if (match = hex3.exec(color)) {
    return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + "ff", 16) >>> 0;
  }
  if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
  if (match = hex4.exec(color)) {
    return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0;
  }
  if (match = hsl.exec(color)) {
    return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 255) >>> 0;
  }
  if (match = hsla.exec(color)) {
    return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
  }
  return null;
}
function hue2rgb(p, q, t) {
  if (t < 0) t += 1;
  if (t > 1) t -= 1;
  if (t < 1 / 6) return p + (q - p) * 6 * t;
  if (t < 1 / 2) return q;
  if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  return p;
}
function hslToRgb(h2, s, l) {
  const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  const p = 2 * l - q;
  const r = hue2rgb(p, q, h2 + 1 / 3);
  const g = hue2rgb(p, q, h2);
  const b = hue2rgb(p, q, h2 - 1 / 3);
  return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
function parse255(str) {
  const int = parseInt(str, 10);
  if (int < 0) return 0;
  if (int > 255) return 255;
  return int;
}
function parse360(str) {
  const int = parseFloat(str);
  return (int % 360 + 360) % 360 / 360;
}
function parse1(str) {
  const num = parseFloat(str);
  if (num < 0) return 0;
  if (num > 1) return 255;
  return Math.round(num * 255);
}
function parsePercentage(str) {
  const int = parseFloat(str);
  if (int < 0) return 0;
  if (int > 100) return 1;
  return int / 100;
}
function colorToRgba(input) {
  let int32Color = normalizeColor$1(input);
  if (int32Color === null) return input;
  int32Color = int32Color || 0;
  let r = (int32Color & 4278190080) >>> 24;
  let g = (int32Color & 16711680) >>> 16;
  let b = (int32Color & 65280) >>> 8;
  let a = (int32Color & 255) / 255;
  return `rgba(${r}, ${g}, ${b}, ${a})`;
}
const createInterpolator = (range, output, extrapolate) => {
  if (is.fun(range)) {
    return range;
  }
  if (is.arr(range)) {
    return createInterpolator({
      range,
      output,
      extrapolate
    });
  }
  if (is.str(range.output[0])) {
    return createStringInterpolator$1(range);
  }
  const config2 = range;
  const outputRange = config2.output;
  const inputRange = config2.range || [0, 1];
  const extrapolateLeft = config2.extrapolateLeft || config2.extrapolate || "extend";
  const extrapolateRight = config2.extrapolateRight || config2.extrapolate || "extend";
  const easing = config2.easing || ((t) => t);
  return (input) => {
    const range2 = findRange(input, inputRange);
    return interpolate(input, inputRange[range2], inputRange[range2 + 1], outputRange[range2], outputRange[range2 + 1], easing, extrapolateLeft, extrapolateRight, config2.map);
  };
};
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
  let result = map ? map(input) : input;
  if (result < inputMin) {
    if (extrapolateLeft === "identity") return result;
    else if (extrapolateLeft === "clamp") result = inputMin;
  }
  if (result > inputMax) {
    if (extrapolateRight === "identity") return result;
    else if (extrapolateRight === "clamp") result = inputMax;
  }
  if (outputMin === outputMax) return outputMin;
  if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax;
  if (inputMin === -Infinity) result = -result;
  else if (inputMax === Infinity) result = result - inputMin;
  else result = (result - inputMin) / (inputMax - inputMin);
  result = easing(result);
  if (outputMin === -Infinity) result = -result;
  else if (outputMax === Infinity) result = result + outputMin;
  else result = result * (outputMax - outputMin) + outputMin;
  return result;
}
function findRange(input, inputRange) {
  for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break;
  return i - 1;
}
function _extends$2() {
  _extends$2 = Object.assign || function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends$2.apply(this, arguments);
}
const $get = Symbol.for("FluidValue.get");
const $observers = Symbol.for("FluidValue.observers");
const hasFluidValue = (arg) => Boolean(arg && arg[$get]);
const getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg;
const getFluidObservers = (target) => target[$observers] || null;
function callFluidObserver(observer, event) {
  if (observer.eventObserved) {
    observer.eventObserved(event);
  } else {
    observer(event);
  }
}
function callFluidObservers(target, event) {
  let observers = target[$observers];
  if (observers) {
    observers.forEach((observer) => {
      callFluidObserver(observer, event);
    });
  }
}
class FluidValue {
  constructor(get) {
    this[$get] = void 0;
    this[$observers] = void 0;
    if (!get && !(get = this.get)) {
      throw Error("Unknown getter");
    }
    setFluidGetter(this, get);
  }
}
const setFluidGetter = (target, get) => setHidden(target, $get, get);
function addFluidObserver(target, observer) {
  if (target[$get]) {
    let observers = target[$observers];
    if (!observers) {
      setHidden(target, $observers, observers = /* @__PURE__ */ new Set());
    }
    if (!observers.has(observer)) {
      observers.add(observer);
      if (target.observerAdded) {
        target.observerAdded(observers.size, observer);
      }
    }
  }
  return observer;
}
function removeFluidObserver(target, observer) {
  let observers = target[$observers];
  if (observers && observers.has(observer)) {
    const count = observers.size - 1;
    if (count) {
      observers.delete(observer);
    } else {
      target[$observers] = null;
    }
    if (target.observerRemoved) {
      target.observerRemoved(count, observer);
    }
  }
}
const setHidden = (target, key, value) => Object.defineProperty(target, key, {
  value,
  writable: true,
  configurable: true
});
const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i");
const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
const variableToRgba = (input) => {
  const [token, fallback] = parseCSSVariable(input);
  if (!token || isSSR()) {
    return input;
  }
  const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
  if (value) {
    return value.trim();
  } else if (fallback && fallback.startsWith("--")) {
    const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
    if (_value) {
      return _value;
    } else {
      return input;
    }
  } else if (fallback && cssVariableRegex.test(fallback)) {
    return variableToRgba(fallback);
  } else if (fallback) {
    return fallback;
  }
  return input;
};
const parseCSSVariable = (current) => {
  const match = cssVariableRegex.exec(current);
  if (!match) return [,];
  const [, token, fallback] = match;
  return [token, fallback];
};
let namedColorRegex;
const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
const createStringInterpolator = (config2) => {
  if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`, "g") : /^\b$/;
  const output = config2.output.map((value) => {
    return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
  });
  const keyframes = output.map((value) => value.match(numberRegex).map(Number));
  const outputRanges = keyframes[0].map((_, i) => keyframes.map((values) => {
    if (!(i in values)) {
      throw Error('The arity of each "output" value must be equal');
    }
    return values[i];
  }));
  const interpolators = outputRanges.map((output2) => createInterpolator(_extends$2({}, config2, {
    output: output2
  })));
  return (input) => {
    var _output$find;
    const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find((value) => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, ""));
    let i = 0;
    return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ""}`).replace(rgbaRegex, rgbaRound);
  };
};
const prefix$1 = "react-spring: ";
const once = (fn) => {
  const func = fn;
  let called = false;
  if (typeof func != "function") {
    throw new TypeError(`${prefix$1}once requires a function parameter`);
  }
  return (...args) => {
    if (!called) {
      func(...args);
      called = true;
    }
  };
};
const warnInterpolate = once(console.warn);
function deprecateInterpolate() {
  warnInterpolate(`${prefix$1}The "interpolate" function is deprecated in v9 (use "to" instead)`);
}
const warnDirectCall = once(console.warn);
function deprecateDirectCall() {
  warnDirectCall(`${prefix$1}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);
}
function isAnimatedString(value) {
  return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
}
const useLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? reactExports.useLayoutEffect : reactExports.useEffect;
const useIsMounted = () => {
  const isMounted = reactExports.useRef(false);
  useLayoutEffect(() => {
    isMounted.current = true;
    return () => {
      isMounted.current = false;
    };
  }, []);
  return isMounted;
};
function useForceUpdate() {
  const update2 = reactExports.useState()[1];
  const isMounted = useIsMounted();
  return () => {
    if (isMounted.current) {
      update2(Math.random());
    }
  };
}
function useMemoOne(getResult, inputs) {
  const [initial] = reactExports.useState(() => ({
    inputs,
    result: getResult()
  }));
  const committed = reactExports.useRef();
  const prevCache = committed.current;
  let cache = prevCache;
  if (cache) {
    const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs));
    if (!useCache) {
      cache = {
        inputs,
        result: getResult()
      };
    }
  } else {
    cache = initial;
  }
  reactExports.useEffect(() => {
    committed.current = cache;
    if (prevCache == initial) {
      initial.inputs = initial.result = void 0;
    }
  }, [cache]);
  return cache.result;
}
function areInputsEqual(next, prev) {
  if (next.length !== prev.length) {
    return false;
  }
  for (let i = 0; i < next.length; i++) {
    if (next[i] !== prev[i]) {
      return false;
    }
  }
  return true;
}
const useOnce = (effect) => reactExports.useEffect(effect, emptyDeps);
const emptyDeps = [];
function usePrev(value) {
  const prevRef = reactExports.useRef();
  reactExports.useEffect(() => {
    prevRef.current = value;
  });
  return prevRef.current;
}
const $node = Symbol.for("Animated:node");
const isAnimated = (value) => !!value && value[$node] === value;
const getAnimated = (owner) => owner && owner[$node];
const setAnimated = (owner, node) => defineHidden(owner, $node, node);
const getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload();
class Animated {
  constructor() {
    this.payload = void 0;
    setAnimated(this, this);
  }
  getPayload() {
    return this.payload || [];
  }
}
class AnimatedValue extends Animated {
  constructor(_value) {
    super();
    this.done = true;
    this.elapsedTime = void 0;
    this.lastPosition = void 0;
    this.lastVelocity = void 0;
    this.v0 = void 0;
    this.durationProgress = 0;
    this._value = _value;
    if (is.num(this._value)) {
      this.lastPosition = this._value;
    }
  }
  static create(value) {
    return new AnimatedValue(value);
  }
  getPayload() {
    return [this];
  }
  getValue() {
    return this._value;
  }
  setValue(value, step) {
    if (is.num(value)) {
      this.lastPosition = value;
      if (step) {
        value = Math.round(value / step) * step;
        if (this.done) {
          this.lastPosition = value;
        }
      }
    }
    if (this._value === value) {
      return false;
    }
    this._value = value;
    return true;
  }
  reset() {
    const {
      done
    } = this;
    this.done = false;
    if (is.num(this._value)) {
      this.elapsedTime = 0;
      this.durationProgress = 0;
      this.lastPosition = this._value;
      if (done) this.lastVelocity = null;
      this.v0 = null;
    }
  }
}
class AnimatedString extends AnimatedValue {
  constructor(value) {
    super(0);
    this._string = null;
    this._toString = void 0;
    this._toString = createInterpolator({
      output: [value, value]
    });
  }
  static create(value) {
    return new AnimatedString(value);
  }
  getValue() {
    let value = this._string;
    return value == null ? this._string = this._toString(this._value) : value;
  }
  setValue(value) {
    if (is.str(value)) {
      if (value == this._string) {
        return false;
      }
      this._string = value;
      this._value = 1;
    } else if (super.setValue(value)) {
      this._string = null;
    } else {
      return false;
    }
    return true;
  }
  reset(goal) {
    if (goal) {
      this._toString = createInterpolator({
        output: [this.getValue(), goal]
      });
    }
    this._value = 0;
    super.reset();
  }
}
const TreeContext = {
  dependencies: null
};
class AnimatedObject extends Animated {
  constructor(source) {
    super();
    this.source = source;
    this.setValue(source);
  }
  getValue(animated) {
    const values = {};
    eachProp(this.source, (source, key) => {
      if (isAnimated(source)) {
        values[key] = source.getValue(animated);
      } else if (hasFluidValue(source)) {
        values[key] = getFluidValue(source);
      } else if (!animated) {
        values[key] = source;
      }
    });
    return values;
  }
  setValue(source) {
    this.source = source;
    this.payload = this._makePayload(source);
  }
  reset() {
    if (this.payload) {
      each(this.payload, (node) => node.reset());
    }
  }
  _makePayload(source) {
    if (source) {
      const payload = /* @__PURE__ */ new Set();
      eachProp(source, this._addToPayload, payload);
      return Array.from(payload);
    }
  }
  _addToPayload(source) {
    if (TreeContext.dependencies && hasFluidValue(source)) {
      TreeContext.dependencies.add(source);
    }
    const payload = getPayload(source);
    if (payload) {
      each(payload, (node) => this.add(node));
    }
  }
}
class AnimatedArray extends AnimatedObject {
  constructor(source) {
    super(source);
  }
  static create(source) {
    return new AnimatedArray(source);
  }
  getValue() {
    return this.source.map((node) => node.getValue());
  }
  setValue(source) {
    const payload = this.getPayload();
    if (source.length == payload.length) {
      return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
    }
    super.setValue(source.map(makeAnimated));
    return true;
  }
}
function makeAnimated(value) {
  const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue;
  return nodeType.create(value);
}
function getAnimatedType(value) {
  const parentNode = getAnimated(value);
  return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue;
}
function _extends$1() {
  _extends$1 = Object.assign || function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends$1.apply(this, arguments);
}
const withAnimated = (Component, host) => {
  const hasInstance = !is.fun(Component) || Component.prototype && Component.prototype.isReactComponent;
  return reactExports.forwardRef((givenProps, givenRef) => {
    const instanceRef = reactExports.useRef(null);
    const ref = hasInstance && reactExports.useCallback((value) => {
      instanceRef.current = updateRef(givenRef, value);
    }, [givenRef]);
    const [props, deps] = getAnimatedState(givenProps, host);
    const forceUpdate = useForceUpdate();
    const callback = () => {
      const instance = instanceRef.current;
      if (hasInstance && !instance) {
        return;
      }
      const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
      if (didUpdate === false) {
        forceUpdate();
      }
    };
    const observer = new PropsObserver(callback, deps);
    const observerRef = reactExports.useRef();
    useLayoutEffect(() => {
      observerRef.current = observer;
      each(deps, (dep) => addFluidObserver(dep, observer));
      return () => {
        if (observerRef.current) {
          each(observerRef.current.deps, (dep) => removeFluidObserver(dep, observerRef.current));
          raf.cancel(observerRef.current.update);
        }
      };
    });
    reactExports.useEffect(callback, []);
    useOnce(() => () => {
      const observer2 = observerRef.current;
      each(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
    });
    const usedProps = host.getComponentProps(props.getValue());
    return reactExports.createElement(Component, _extends$1({}, usedProps, {
      ref
    }));
  });
};
class PropsObserver {
  constructor(update2, deps) {
    this.update = update2;
    this.deps = deps;
  }
  eventObserved(event) {
    if (event.type == "change") {
      raf.write(this.update);
    }
  }
}
function getAnimatedState(props, host) {
  const dependencies = /* @__PURE__ */ new Set();
  TreeContext.dependencies = dependencies;
  if (props.style) props = _extends$1({}, props, {
    style: host.createAnimatedStyle(props.style)
  });
  props = new AnimatedObject(props);
  TreeContext.dependencies = null;
  return [props, dependencies];
}
function updateRef(ref, value) {
  if (ref) {
    if (is.fun(ref)) ref(value);
    else ref.current = value;
  }
  return value;
}
const cacheKey = Symbol.for("AnimatedComponent");
const createHost = (components, {
  applyAnimatedValues: _applyAnimatedValues = () => false,
  createAnimatedStyle: _createAnimatedStyle = (style) => new AnimatedObject(style),
  getComponentProps: _getComponentProps = (props) => props
} = {}) => {
  const hostConfig = {
    applyAnimatedValues: _applyAnimatedValues,
    createAnimatedStyle: _createAnimatedStyle,
    getComponentProps: _getComponentProps
  };
  const animated = (Component) => {
    const displayName = getDisplayName(Component) || "Anonymous";
    if (is.str(Component)) {
      Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig));
    } else {
      Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig));
    }
    Component.displayName = `Animated(${displayName})`;
    return Component;
  };
  eachProp(components, (Component, key) => {
    if (is.arr(components)) {
      key = getDisplayName(Component);
    }
    animated[key] = animated(Component);
  });
  return {
    animated
  };
};
const getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null;
function _extends() {
  _extends = Object.assign || function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
function callProp(value, ...args) {
  return is.fun(value) ? value(...args) : value;
}
const matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key)));
const resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop;
const getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : void 0;
const noopTransform = (value) => value;
const getDefaultProps = (props, transform = noopTransform) => {
  let keys = DEFAULT_PROPS;
  if (props.default && props.default !== true) {
    props = props.default;
    keys = Object.keys(props);
  }
  const defaults2 = {};
  for (const key of keys) {
    const value = transform(props[key], key);
    if (!is.und(value)) {
      defaults2[key] = value;
    }
  }
  return defaults2;
};
const DEFAULT_PROPS = ["config", "onProps", "onStart", "onChange", "onPause", "onResume", "onRest"];
const RESERVED_PROPS = {
  config: 1,
  from: 1,
  to: 1,
  ref: 1,
  loop: 1,
  reset: 1,
  pause: 1,
  cancel: 1,
  reverse: 1,
  immediate: 1,
  default: 1,
  delay: 1,
  onProps: 1,
  onStart: 1,
  onChange: 1,
  onPause: 1,
  onResume: 1,
  onRest: 1,
  onResolve: 1,
  items: 1,
  trail: 1,
  sort: 1,
  expires: 1,
  initial: 1,
  enter: 1,
  update: 1,
  leave: 1,
  children: 1,
  onDestroyed: 1,
  keys: 1,
  callId: 1,
  parentId: 1
};
function getForwardProps(props) {
  const forward = {};
  let count = 0;
  eachProp(props, (value, prop) => {
    if (!RESERVED_PROPS[prop]) {
      forward[prop] = value;
      count++;
    }
  });
  if (count) {
    return forward;
  }
}
function inferTo(props) {
  const to2 = getForwardProps(props);
  if (to2) {
    const out = {
      to: to2
    };
    eachProp(props, (val, key) => key in to2 || (out[key] = val));
    return out;
  }
  return _extends({}, props);
}
function computeGoal(value) {
  value = getFluidValue(value);
  return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? globals.createStringInterpolator({
    range: [0, 1],
    output: [value, value]
  })(1) : value;
}
function hasProps(props) {
  for (const _ in props) return true;
  return false;
}
function isAsyncTo(to2) {
  return is.fun(to2) || is.arr(to2) && is.obj(to2[0]);
}
function detachRefs(ctrl, ref) {
  var _ctrl$ref;
  (_ctrl$ref = ctrl.ref) == null ? void 0 : _ctrl$ref.delete(ctrl);
  ref == null ? void 0 : ref.delete(ctrl);
}
function replaceRef(ctrl, ref) {
  if (ref && ctrl.ref !== ref) {
    var _ctrl$ref2;
    (_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl);
    ref.add(ctrl);
    ctrl.ref = ref;
  }
}
const config = {
  default: {
    tension: 170,
    friction: 26
  }
};
const easings = {
  linear: (x) => x
};
const defaults = _extends({}, config.default, {
  mass: 1,
  damping: 1,
  easing: easings.linear,
  clamp: false
});
class AnimationConfig {
  constructor() {
    this.tension = void 0;
    this.friction = void 0;
    this.frequency = void 0;
    this.damping = void 0;
    this.mass = void 0;
    this.velocity = 0;
    this.restVelocity = void 0;
    this.precision = void 0;
    this.progress = void 0;
    this.duration = void 0;
    this.easing = void 0;
    this.clamp = void 0;
    this.bounce = void 0;
    this.decay = void 0;
    this.round = void 0;
    Object.assign(this, defaults);
  }
}
function mergeConfig(config2, newConfig, defaultConfig) {
  if (defaultConfig) {
    defaultConfig = _extends({}, defaultConfig);
    sanitizeConfig(defaultConfig, newConfig);
    newConfig = _extends({}, defaultConfig, newConfig);
  }
  sanitizeConfig(config2, newConfig);
  Object.assign(config2, newConfig);
  for (const key in defaults) {
    if (config2[key] == null) {
      config2[key] = defaults[key];
    }
  }
  let {
    mass,
    frequency,
    damping
  } = config2;
  if (!is.und(frequency)) {
    if (frequency < 0.01) frequency = 0.01;
    if (damping < 0) damping = 0;
    config2.tension = Math.pow(2 * Math.PI / frequency, 2) * mass;
    config2.friction = 4 * Math.PI * damping * mass / frequency;
  }
  return config2;
}
function sanitizeConfig(config2, props) {
  if (!is.und(props.decay)) {
    config2.duration = void 0;
  } else {
    const isTensionConfig = !is.und(props.tension) || !is.und(props.friction);
    if (isTensionConfig || !is.und(props.frequency) || !is.und(props.damping) || !is.und(props.mass)) {
      config2.duration = void 0;
      config2.decay = void 0;
    }
    if (isTensionConfig) {
      config2.frequency = void 0;
    }
  }
}
const emptyArray = [];
class Animation {
  constructor() {
    this.changed = false;
    this.values = emptyArray;
    this.toValues = null;
    this.fromValues = emptyArray;
    this.to = void 0;
    this.from = void 0;
    this.config = new AnimationConfig();
    this.immediate = false;
  }
}
function scheduleProps(callId, {
  key,
  props,
  defaultProps,
  state,
  actions
}) {
  return new Promise((resolve, reject) => {
    var _props$cancel;
    let delay;
    let timeout;
    let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key);
    if (cancel) {
      onStart();
    } else {
      if (!is.und(props.pause)) {
        state.paused = matchProp(props.pause, key);
      }
      let pause = defaultProps == null ? void 0 : defaultProps.pause;
      if (pause !== true) {
        pause = state.paused || matchProp(pause, key);
      }
      delay = callProp(props.delay || 0, key);
      if (pause) {
        state.resumeQueue.add(onResume);
        actions.pause();
      } else {
        actions.resume();
        onResume();
      }
    }
    function onPause() {
      state.resumeQueue.add(onResume);
      state.timeouts.delete(timeout);
      timeout.cancel();
      delay = timeout.time - raf.now();
    }
    function onResume() {
      if (delay > 0 && !globals.skipAnimation) {
        state.delayed = true;
        timeout = raf.setTimeout(onStart, delay);
        state.pauseQueue.add(onPause);
        state.timeouts.add(timeout);
      } else {
        onStart();
      }
    }
    function onStart() {
      if (state.delayed) {
        state.delayed = false;
      }
      state.pauseQueue.delete(onPause);
      state.timeouts.delete(timeout);
      if (callId <= (state.cancelId || 0)) {
        cancel = true;
      }
      try {
        actions.start(_extends({}, props, {
          callId,
          cancel
        }), resolve);
      } catch (err) {
        reject(err);
      }
    }
  });
}
const getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some((result) => result.cancelled) ? getCancelledResult(target.get()) : results.every((result) => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every((result) => result.finished));
const getNoopResult = (value) => ({
  value,
  noop: true,
  finished: true,
  cancelled: false
});
const getFinishedResult = (value, finished, cancelled = false) => ({
  value,
  finished,
  cancelled
});
const getCancelledResult = (value) => ({
  value,
  cancelled: true,
  finished: false
});
function runAsync(to2, props, state, target) {
  const {
    callId,
    parentId,
    onRest
  } = props;
  const {
    asyncTo: prevTo,
    promise: prevPromise
  } = state;
  if (!parentId && to2 === prevTo && !props.reset) {
    return prevPromise;
  }
  return state.promise = (async () => {
    state.asyncId = callId;
    state.asyncTo = to2;
    const defaultProps = getDefaultProps(props, (value, key) => key === "onRest" ? void 0 : value);
    let preventBail;
    let bail;
    const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject));
    const bailIfEnded = (bailSignal) => {
      const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false);
      if (bailResult) {
        bailSignal.result = bailResult;
        bail(bailSignal);
        throw bailSignal;
      }
    };
    const animate = (arg1, arg2) => {
      const bailSignal = new BailSignal();
      const skipAnimationSignal = new SkipAniamtionSignal();
      return (async () => {
        if (globals.skipAnimation) {
          stopAsync(state);
          skipAnimationSignal.result = getFinishedResult(target, false);
          bail(skipAnimationSignal);
          throw skipAnimationSignal;
        }
        bailIfEnded(bailSignal);
        const props2 = is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, {
          to: arg1
        });
        props2.parentId = callId;
        eachProp(defaultProps, (value, key) => {
          if (is.und(props2[key])) {
            props2[key] = value;
          }
        });
        const result2 = await target.start(props2);
        bailIfEnded(bailSignal);
        if (state.paused) {
          await new Promise((resume) => {
            state.resumeQueue.add(resume);
          });
        }
        return result2;
      })();
    };
    let result;
    if (globals.skipAnimation) {
      stopAsync(state);
      return getFinishedResult(target, false);
    }
    try {
      let animating;
      if (is.arr(to2)) {
        animating = (async (queue) => {
          for (const props2 of queue) {
            await animate(props2);
          }
        })(to2);
      } else {
        animating = Promise.resolve(to2(animate, target.stop.bind(target)));
      }
      await Promise.all([animating.then(preventBail), bailPromise]);
      result = getFinishedResult(target.get(), true, false);
    } catch (err) {
      if (err instanceof BailSignal) {
        result = err.result;
      } else if (err instanceof SkipAniamtionSignal) {
        result = err.result;
      } else {
        throw err;
      }
    } finally {
      if (callId == state.asyncId) {
        state.asyncId = parentId;
        state.asyncTo = parentId ? prevTo : void 0;
        state.promise = parentId ? prevPromise : void 0;
      }
    }
    if (is.fun(onRest)) {
      raf.batchedUpdates(() => {
        onRest(result, target, target.item);
      });
    }
    return result;
  })();
}
function stopAsync(state, cancelId) {
  flush(state.timeouts, (t) => t.cancel());
  state.pauseQueue.clear();
  state.resumeQueue.clear();
  state.asyncId = state.asyncTo = state.promise = void 0;
  if (cancelId) state.cancelId = cancelId;
}
class BailSignal extends Error {
  constructor() {
    super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.");
    this.result = void 0;
  }
}
class SkipAniamtionSignal extends Error {
  constructor() {
    super("SkipAnimationSignal");
    this.result = void 0;
  }
}
const isFrameValue = (value) => value instanceof FrameValue;
let nextId$1 = 1;
class FrameValue extends FluidValue {
  constructor(...args) {
    super(...args);
    this.id = nextId$1++;
    this.key = void 0;
    this._priority = 0;
  }
  get priority() {
    return this._priority;
  }
  set priority(priority2) {
    if (this._priority != priority2) {
      this._priority = priority2;
      this._onPriorityChange(priority2);
    }
  }
  get() {
    const node = getAnimated(this);
    return node && node.getValue();
  }
  to(...args) {
    return globals.to(this, args);
  }
  interpolate(...args) {
    deprecateInterpolate();
    return globals.to(this, args);
  }
  toJSON() {
    return this.get();
  }
  observerAdded(count) {
    if (count == 1) this._attach();
  }
  observerRemoved(count) {
    if (count == 0) this._detach();
  }
  _attach() {
  }
  _detach() {
  }
  _onChange(value, idle = false) {
    callFluidObservers(this, {
      type: "change",
      parent: this,
      value,
      idle
    });
  }
  _onPriorityChange(priority2) {
    if (!this.idle) {
      frameLoop.sort(this);
    }
    callFluidObservers(this, {
      type: "priority",
      parent: this,
      priority: priority2
    });
  }
}
const $P = Symbol.for("SpringPhase");
const HAS_ANIMATED = 1;
const IS_ANIMATING = 2;
const IS_PAUSED = 4;
const hasAnimated = (target) => (target[$P] & HAS_ANIMATED) > 0;
const isAnimating = (target) => (target[$P] & IS_ANIMATING) > 0;
const isPaused = (target) => (target[$P] & IS_PAUSED) > 0;
const setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING;
const setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED;
class SpringValue extends FrameValue {
  constructor(arg1, arg2) {
    super();
    this.key = void 0;
    this.animation = new Animation();
    this.queue = void 0;
    this.defaultProps = {};
    this._state = {
      paused: false,
      delayed: false,
      pauseQueue: /* @__PURE__ */ new Set(),
      resumeQueue: /* @__PURE__ */ new Set(),
      timeouts: /* @__PURE__ */ new Set()
    };
    this._pendingCalls = /* @__PURE__ */ new Set();
    this._lastCallId = 0;
    this._lastToId = 0;
    this._memoizedDuration = 0;
    if (!is.und(arg1) || !is.und(arg2)) {
      const props = is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, {
        from: arg1
      });
      if (is.und(props.default)) {
        props.default = true;
      }
      this.start(props);
    }
  }
  get idle() {
    return !(isAnimating(this) || this._state.asyncTo) || isPaused(this);
  }
  get goal() {
    return getFluidValue(this.animation.to);
  }
  get velocity() {
    const node = getAnimated(this);
    return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map((node2) => node2.lastVelocity || 0);
  }
  get hasAnimated() {
    return hasAnimated(this);
  }
  get isAnimating() {
    return isAnimating(this);
  }
  get isPaused() {
    return isPaused(this);
  }
  get isDelayed() {
    return this._state.delayed;
  }
  advance(dt) {
    let idle = true;
    let changed = false;
    const anim = this.animation;
    let {
      config: config2,
      toValues
    } = anim;
    const payload = getPayload(anim.to);
    if (!payload && hasFluidValue(anim.to)) {
      toValues = toArray(getFluidValue(anim.to));
    }
    anim.values.forEach((node2, i) => {
      if (node2.done) return;
      const to2 = node2.constructor == AnimatedString ? 1 : payload ? payload[i].lastPosition : toValues[i];
      let finished = anim.immediate;
      let position = to2;
      if (!finished) {
        position = node2.lastPosition;
        if (config2.tension <= 0) {
          node2.done = true;
          return;
        }
        let elapsed = node2.elapsedTime += dt;
        const from = anim.fromValues[i];
        const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i] : config2.velocity;
        let velocity;
        if (!is.und(config2.duration)) {
          let p = 1;
          if (config2.duration > 0) {
            if (this._memoizedDuration !== config2.duration) {
              this._memoizedDuration = config2.duration;
              if (node2.durationProgress > 0) {
                node2.elapsedTime = config2.duration * node2.durationProgress;
                elapsed = node2.elapsedTime += dt;
              }
            }
            p = (config2.progress || 0) + elapsed / this._memoizedDuration;
            p = p > 1 ? 1 : p < 0 ? 0 : p;
            node2.durationProgress = p;
          }
          position = from + config2.easing(p) * (to2 - from);
          velocity = (position - node2.lastPosition) / dt;
          finished = p == 1;
        } else if (config2.decay) {
          const decay = config2.decay === true ? 0.998 : config2.decay;
          const e2 = Math.exp(-(1 - decay) * elapsed);
          position = from + v0 / (1 - decay) * (1 - e2);
          finished = Math.abs(node2.lastPosition - position) < 0.1;
          velocity = v0 * e2;
        } else {
          velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity;
          const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
          const restVelocity = config2.restVelocity || precision / 10;
          const bounceFactor = config2.clamp ? 0 : config2.bounce;
          const canBounce = !is.und(bounceFactor);
          const isGrowing = from == to2 ? node2.v0 > 0 : from < to2;
          let isMoving;
          let isBouncing = false;
          const step = 1;
          const numSteps = Math.ceil(dt / step);
          for (let n = 0; n < numSteps; ++n) {
            isMoving = Math.abs(velocity) > restVelocity;
            if (!isMoving) {
              finished = Math.abs(to2 - position) <= precision;
              if (finished) {
                break;
              }
            }
            if (canBounce) {
              isBouncing = position == to2 || position > to2 == isGrowing;
              if (isBouncing) {
                velocity = -velocity * bounceFactor;
                position = to2;
              }
            }
            const springForce = -config2.tension * 1e-6 * (position - to2);
            const dampingForce = -config2.friction * 1e-3 * velocity;
            const acceleration = (springForce + dampingForce) / config2.mass;
            velocity = velocity + acceleration * step;
            position = position + velocity * step;
          }
        }
        node2.lastVelocity = velocity;
        if (Number.isNaN(position)) {
          console.warn(`Got NaN while animating:`, this);
          finished = true;
        }
      }
      if (payload && !payload[i].done) {
        finished = false;
      }
      if (finished) {
        node2.done = true;
      } else {
        idle = false;
      }
      if (node2.setValue(position, config2.round)) {
        changed = true;
      }
    });
    const node = getAnimated(this);
    const currVal = node.getValue();
    if (idle) {
      const finalVal = getFluidValue(anim.to);
      if ((currVal !== finalVal || changed) && !config2.decay) {
        node.setValue(finalVal);
        this._onChange(finalVal);
      } else if (changed && config2.decay) {
        this._onChange(currVal);
      }
      this._stop();
    } else if (changed) {
      this._onChange(currVal);
    }
  }
  set(value) {
    raf.batchedUpdates(() => {
      this._stop();
      this._focus(value);
      this._set(value);
    });
    return this;
  }
  pause() {
    this._update({
      pause: true
    });
  }
  resume() {
    this._update({
      pause: false
    });
  }
  finish() {
    if (isAnimating(this)) {
      const {
        to: to2,
        config: config2
      } = this.animation;
      raf.batchedUpdates(() => {
        this._onStart();
        if (!config2.decay) {
          this._set(to2, false);
        }
        this._stop();
      });
    }
    return this;
  }
  update(props) {
    const queue = this.queue || (this.queue = []);
    queue.push(props);
    return this;
  }
  start(to2, arg2) {
    let queue;
    if (!is.und(to2)) {
      queue = [is.obj(to2) ? to2 : _extends({}, arg2, {
        to: to2
      })];
    } else {
      queue = this.queue || [];
      this.queue = [];
    }
    return Promise.all(queue.map((props) => {
      const up = this._update(props);
      return up;
    })).then((results) => getCombinedResult(this, results));
  }
  stop(cancel) {
    const {
      to: to2
    } = this.animation;
    this._focus(this.get());
    stopAsync(this._state, cancel && this._lastCallId);
    raf.batchedUpdates(() => this._stop(to2, cancel));
    return this;
  }
  reset() {
    this._update({
      reset: true
    });
  }
  eventObserved(event) {
    if (event.type == "change") {
      this._start();
    } else if (event.type == "priority") {
      this.priority = event.priority + 1;
    }
  }
  _prepareNode(props) {
    const key = this.key || "";
    let {
      to: to2,
      from
    } = props;
    to2 = is.obj(to2) ? to2[key] : to2;
    if (to2 == null || isAsyncTo(to2)) {
      to2 = void 0;
    }
    from = is.obj(from) ? from[key] : from;
    if (from == null) {
      from = void 0;
    }
    const range = {
      to: to2,
      from
    };
    if (!hasAnimated(this)) {
      if (props.reverse) [to2, from] = [from, to2];
      from = getFluidValue(from);
      if (!is.und(from)) {
        this._set(from);
      } else if (!getAnimated(this)) {
        this._set(to2);
      }
    }
    return range;
  }
  _update(_ref, isLoop) {
    let props = _extends({}, _ref);
    const {
      key,
      defaultProps
    } = this;
    if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value));
    mergeActiveFn(this, props, "onProps");
    sendEvent(this, "onProps", props, this);
    const range = this._prepareNode(props);
    if (Object.isFrozen(this)) {
      throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");
    }
    const state = this._state;
    return scheduleProps(++this._lastCallId, {
      key,
      props,
      defaultProps,
      state,
      actions: {
        pause: () => {
          if (!isPaused(this)) {
            setPausedBit(this, true);
            flushCalls(state.pauseQueue);
            sendEvent(this, "onPause", getFinishedResult(this, checkFinished(this, this.animation.to)), this);
          }
        },
        resume: () => {
          if (isPaused(this)) {
            setPausedBit(this, false);
            if (isAnimating(this)) {
              this._resume();
            }
            flushCalls(state.resumeQueue);
            sendEvent(this, "onResume", getFinishedResult(this, checkFinished(this, this.animation.to)), this);
          }
        },
        start: this._merge.bind(this, range)
      }
    }).then((result) => {
      if (props.loop && result.finished && !(isLoop && result.noop)) {
        const nextProps = createLoopUpdate(props);
        if (nextProps) {
          return this._update(nextProps, true);
        }
      }
      return result;
    });
  }
  _merge(range, props, resolve) {
    if (props.cancel) {
      this.stop(true);
      return resolve(getCancelledResult(this));
    }
    const hasToProp = !is.und(range.to);
    const hasFromProp = !is.und(range.from);
    if (hasToProp || hasFromProp) {
      if (props.callId > this._lastToId) {
        this._lastToId = props.callId;
      } else {
        return resolve(getCancelledResult(this));
      }
    }
    const {
      key,
      defaultProps,
      animation: anim
    } = this;
    const {
      to: prevTo,
      from: prevFrom
    } = anim;
    let {
      to: to2 = prevTo,
      from = prevFrom
    } = range;
    if (hasFromProp && !hasToProp && (!props.default || is.und(to2))) {
      to2 = from;
    }
    if (props.reverse) [to2, from] = [from, to2];
    const hasFromChanged = !isEqual(from, prevFrom);
    if (hasFromChanged) {
      anim.from = from;
    }
    from = getFluidValue(from);
    const hasToChanged = !isEqual(to2, prevTo);
    if (hasToChanged) {
      this._focus(to2);
    }
    const hasAsyncTo = isAsyncTo(props.to);
    const {
      config: config2
    } = anim;
    const {
      decay,
      velocity
    } = config2;
    if (hasToProp || hasFromProp) {
      config2.velocity = 0;
    }
    if (props.config && !hasAsyncTo) {
      mergeConfig(config2, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0);
    }
    let node = getAnimated(this);
    if (!node || is.und(to2)) {
      return resolve(getFinishedResult(this, true));
    }
    const reset = is.und(props.reset) ? hasFromProp && !props.default : !is.und(from) && matchProp(props.reset, key);
    const value = reset ? from : this.get();
    const goal = computeGoal(to2);
    const isAnimatable = is.num(goal) || is.arr(goal) || isAnimatedString(goal);
    const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key));
    if (hasToChanged) {
      const nodeType = getAnimatedType(to2);
      if (nodeType !== node.constructor) {
        if (immediate) {
          node = this._set(goal);
        } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`);
      }
    }
    const goalType = node.constructor;
    let started = hasFluidValue(to2);
    let finished = false;
    if (!started) {
      const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged;
      if (hasToChanged || hasValueChanged) {
        finished = isEqual(computeGoal(value), goal);
        started = !finished;
      }
      if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config2.decay, decay) || !isEqual(config2.velocity, velocity)) {
        started = true;
      }
    }
    if (finished && isAnimating(this)) {
      if (anim.changed && !reset) {
        started = true;
      } else if (!started) {
        this._stop(prevTo);
      }
    }
    if (!hasAsyncTo) {
      if (started || hasFluidValue(prevTo)) {
        anim.values = node.getPayload();
        anim.toValues = hasFluidValue(to2) ? null : goalType == AnimatedString ? [1] : toArray(goal);
      }
      if (anim.immediate != immediate) {
        anim.immediate = immediate;
        if (!immediate && !reset) {
          this._set(prevTo);
        }
      }
      if (started) {
        const {
          onRest
        } = anim;
        each(ACTIVE_EVENTS, (type) => mergeActiveFn(this, props, type));
        const result = getFinishedResult(this, checkFinished(this, prevTo));
        flushCalls(this._pendingCalls, result);
        this._pendingCalls.add(resolve);
        if (anim.changed) raf.batchedUpdates(() => {
          anim.changed = !reset;
          onRest == null ? void 0 : onRest(result, this);
          if (reset) {
            callProp(defaultProps.onRest, result);
          } else {
            anim.onStart == null ? void 0 : anim.onStart(result, this);
          }
        });
      }
    }
    if (reset) {
      this._set(value);
    }
    if (hasAsyncTo) {
      resolve(runAsync(props.to, props, this._state, this));
    } else if (started) {
      this._start();
    } else if (isAnimating(this) && !hasToChanged) {
      this._pendingCalls.add(resolve);
    } else {
      resolve(getNoopResult(value));
    }
  }
  _focus(value) {
    const anim = this.animation;
    if (value !== anim.to) {
      if (getFluidObservers(this)) {
        this._detach();
      }
      anim.to = value;
      if (getFluidObservers(this)) {
        this._attach();
      }
    }
  }
  _attach() {
    let priority2 = 0;
    const {
      to: to2
    } = this.animation;
    if (hasFluidValue(to2)) {
      addFluidObserver(to2, this);
      if (isFrameValue(to2)) {
        priority2 = to2.priority + 1;
      }
    }
    this.priority = priority2;
  }
  _detach() {
    const {
      to: to2
    } = this.animation;
    if (hasFluidValue(to2)) {
      removeFluidObserver(to2, this);
    }
  }
  _set(arg, idle = true) {
    const value = getFluidValue(arg);
    if (!is.und(value)) {
      const oldNode = getAnimated(this);
      if (!oldNode || !isEqual(value, oldNode.getValue())) {
        const nodeType = getAnimatedType(value);
        if (!oldNode || oldNode.constructor != nodeType) {
          setAnimated(this, nodeType.create(value));
        } else {
          oldNode.setValue(value);
        }
        if (oldNode) {
          raf.batchedUpdates(() => {
            this._onChange(value, idle);
          });
        }
      }
    }
    return getAnimated(this);
  }
  _onStart() {
    const anim = this.animation;
    if (!anim.changed) {
      anim.changed = true;
      sendEvent(this, "onStart", getFinishedResult(this, checkFinished(this, anim.to)), this);
    }
  }
  _onChange(value, idle) {
    if (!idle) {
      this._onStart();
      callProp(this.animation.onChange, value, this);
    }
    callProp(this.defaultProps.onChange, value, this);
    super._onChange(value, idle);
  }
  _start() {
    const anim = this.animation;
    getAnimated(this).reset(getFluidValue(anim.to));
    if (!anim.immediate) {
      anim.fromValues = anim.values.map((node) => node.lastPosition);
    }
    if (!isAnimating(this)) {
      setActiveBit(this, true);
      if (!isPaused(this)) {
        this._resume();
      }
    }
  }
  _resume() {
    if (globals.skipAnimation) {
      this.finish();
    } else {
      frameLoop.start(this);
    }
  }
  _stop(goal, cancel) {
    if (isAnimating(this)) {
      setActiveBit(this, false);
      const anim = this.animation;
      each(anim.values, (node) => {
        node.done = true;
      });
      if (anim.toValues) {
        anim.onChange = anim.onPause = anim.onResume = void 0;
      }
      callFluidObservers(this, {
        type: "idle",
        parent: this
      });
      const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to));
      flushCalls(this._pendingCalls, result);
      if (anim.changed) {
        anim.changed = false;
        sendEvent(this, "onRest", result, this);
      }
    }
  }
}
function checkFinished(target, to2) {
  const goal = computeGoal(to2);
  const value = computeGoal(target.get());
  return isEqual(value, goal);
}
function createLoopUpdate(props, loop2 = props.loop, to2 = props.to) {
  let loopRet = callProp(loop2);
  if (loopRet) {
    const overrides = loopRet !== true && inferTo(loopRet);
    const reverse = (overrides || props).reverse;
    const reset = !overrides || overrides.reset;
    return createUpdate(_extends({}, props, {
      loop: loop2,
      default: false,
      pause: void 0,
      to: !reverse || isAsyncTo(to2) ? to2 : void 0,
      from: reset ? props.from : void 0,
      reset
    }, overrides));
  }
}
function createUpdate(props) {
  const {
    to: to2,
    from
  } = props = inferTo(props);
  const keys = /* @__PURE__ */ new Set();
  if (is.obj(to2)) findDefined(to2, keys);
  if (is.obj(from)) findDefined(from, keys);
  props.keys = keys.size ? Array.from(keys) : null;
  return props;
}
function declareUpdate(props) {
  const update2 = createUpdate(props);
  if (is.und(update2.default)) {
    update2.default = getDefaultProps(update2);
  }
  return update2;
}
function findDefined(values, keys) {
  eachProp(values, (value, key) => value != null && keys.add(key));
}
const ACTIVE_EVENTS = ["onStart", "onRest", "onChange", "onPause", "onResume"];
function mergeActiveFn(target, props, type) {
  target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : void 0;
}
function sendEvent(target, type, ...args) {
  var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps;
  (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args);
  (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args);
}
const BATCHED_EVENTS = ["onStart", "onChange", "onRest"];
let nextId = 1;
class Controller {
  constructor(props, flush2) {
    this.id = nextId++;
    this.springs = {};
    this.queue = [];
    this.ref = void 0;
    this._flush = void 0;
    this._initialProps = void 0;
    this._lastAsyncId = 0;
    this._active = /* @__PURE__ */ new Set();
    this._changed = /* @__PURE__ */ new Set();
    this._started = false;
    this._item = void 0;
    this._state = {
      paused: false,
      pauseQueue: /* @__PURE__ */ new Set(),
      resumeQueue: /* @__PURE__ */ new Set(),
      timeouts: /* @__PURE__ */ new Set()
    };
    this._events = {
      onStart: /* @__PURE__ */ new Map(),
      onChange: /* @__PURE__ */ new Map(),
      onRest: /* @__PURE__ */ new Map()
    };
    this._onFrame = this._onFrame.bind(this);
    if (flush2) {
      this._flush = flush2;
    }
    if (props) {
      this.start(_extends({
        default: true
      }, props));
    }
  }
  get idle() {
    return !this._state.asyncTo && Object.values(this.springs).every((spring) => {
      return spring.idle && !spring.isDelayed && !spring.isPaused;
    });
  }
  get item() {
    return this._item;
  }
  set item(item) {
    this._item = item;
  }
  get() {
    const values = {};
    this.each((spring, key) => values[key] = spring.get());
    return values;
  }
  set(values) {
    for (const key in values) {
      const value = values[key];
      if (!is.und(value)) {
        this.springs[key].set(value);
      }
    }
  }
  update(props) {
    if (props) {
      this.queue.push(createUpdate(props));
    }
    return this;
  }
  start(props) {
    let {
      queue
    } = this;
    if (props) {
      queue = toArray(props).map(createUpdate);
    } else {
      this.queue = [];
    }
    if (this._flush) {
      return this._flush(this, queue);
    }
    prepareKeys(this, queue);
    return flushUpdateQueue(this, queue);
  }
  stop(arg, keys) {
    if (arg !== !!arg) {
      keys = arg;
    }
    if (keys) {
      const springs = this.springs;
      each(toArray(keys), (key) => springs[key].stop(!!arg));
    } else {
      stopAsync(this._state, this._lastAsyncId);
      this.each((spring) => spring.stop(!!arg));
    }
    return this;
  }
  pause(keys) {
    if (is.und(keys)) {
      this.start({
        pause: true
      });
    } else {
      const springs = this.springs;
      each(toArray(keys), (key) => springs[key].pause());
    }
    return this;
  }
  resume(keys) {
    if (is.und(keys)) {
      this.start({
        pause: false
      });
    } else {
      const springs = this.springs;
      each(toArray(keys), (key) => springs[key].resume());
    }
    return this;
  }
  each(iterator) {
    eachProp(this.springs, iterator);
  }
  _onFrame() {
    const {
      onStart,
      onChange,
      onRest
    } = this._events;
    const active = this._active.size > 0;
    const changed = this._changed.size > 0;
    if (active && !this._started || changed && !this._started) {
      this._started = true;
      flush(onStart, ([onStart2, result]) => {
        result.value = this.get();
        onStart2(result, this, this._item);
      });
    }
    const idle = !active && this._started;
    const values = changed || idle && onRest.size ? this.get() : null;
    if (changed && onChange.size) {
      flush(onChange, ([onChange2, result]) => {
        result.value = values;
        onChange2(result, this, this._item);
      });
    }
    if (idle) {
      this._started = false;
      flush(onRest, ([onRest2, result]) => {
        result.value = values;
        onRest2(result, this, this._item);
      });
    }
  }
  eventObserved(event) {
    if (event.type == "change") {
      this._changed.add(event.parent);
      if (!event.idle) {
        this._active.add(event.parent);
      }
    } else if (event.type == "idle") {
      this._active.delete(event.parent);
    } else return;
    raf.onFrame(this._onFrame);
  }
}
function flushUpdateQueue(ctrl, queue) {
  return Promise.all(queue.map((props) => flushUpdate(ctrl, props))).then((results) => getCombinedResult(ctrl, results));
}
async function flushUpdate(ctrl, props, isLoop) {
  const {
    keys,
    to: to2,
    from,
    loop: loop2,
    onRest,
    onResolve
  } = props;
  const defaults2 = is.obj(props.default) && props.default;
  if (loop2) {
    props.loop = false;
  }
  if (to2 === false) props.to = null;
  if (from === false) props.from = null;
  const asyncTo = is.arr(to2) || is.fun(to2) ? to2 : void 0;
  if (asyncTo) {
    props.to = void 0;
    props.onRest = void 0;
    if (defaults2) {
      defaults2.onRest = void 0;
    }
  } else {
    each(BATCHED_EVENTS, (key) => {
      const handler = props[key];
      if (is.fun(handler)) {
        const queue = ctrl["_events"][key];
        props[key] = ({
          finished,
          cancelled
        }) => {
          const result2 = queue.get(handler);
          if (result2) {
            if (!finished) result2.finished = false;
            if (cancelled) result2.cancelled = true;
          } else {
            queue.set(handler, {
              value: null,
              finished: finished || false,
              cancelled: cancelled || false
            });
          }
        };
        if (defaults2) {
          defaults2[key] = props[key];
        }
      }
    });
  }
  const state = ctrl["_state"];
  if (props.pause === !state.paused) {
    state.paused = props.pause;
    flushCalls(props.pause ? state.pauseQueue : state.resumeQueue);
  } else if (state.paused) {
    props.pause = true;
  }
  const promises = (keys || Object.keys(ctrl.springs)).map((key) => ctrl.springs[key].start(props));
  const cancel = props.cancel === true || getDefaultProp(props, "cancel") === true;
  if (asyncTo || cancel && state.asyncId) {
    promises.push(scheduleProps(++ctrl["_lastAsyncId"], {
      props,
      state,
      actions: {
        pause: noop,
        resume: noop,
        start(props2, resolve) {
          if (cancel) {
            stopAsync(state, ctrl["_lastAsyncId"]);
            resolve(getCancelledResult(ctrl));
          } else {
            props2.onRest = onRest;
            resolve(runAsync(asyncTo, props2, state, ctrl));
          }
        }
      }
    }));
  }
  if (state.paused) {
    await new Promise((resume) => {
      state.resumeQueue.add(resume);
    });
  }
  const result = getCombinedResult(ctrl, await Promise.all(promises));
  if (loop2 && result.finished && !(isLoop && result.noop)) {
    const nextProps = createLoopUpdate(props, loop2, to2);
    if (nextProps) {
      prepareKeys(ctrl, [nextProps]);
      return flushUpdate(ctrl, nextProps, true);
    }
  }
  if (onResolve) {
    raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item));
  }
  return result;
}
function getSprings(ctrl, props) {
  const springs = _extends({}, ctrl.springs);
  if (props) {
    each(toArray(props), (props2) => {
      if (is.und(props2.keys)) {
        props2 = createUpdate(props2);
      }
      if (!is.obj(props2.to)) {
        props2 = _extends({}, props2, {
          to: void 0
        });
      }
      prepareSprings(springs, props2, (key) => {
        return createSpring(key);
      });
    });
  }
  setSprings(ctrl, springs);
  return springs;
}
function setSprings(ctrl, springs) {
  eachProp(springs, (spring, key) => {
    if (!ctrl.springs[key]) {
      ctrl.springs[key] = spring;
      addFluidObserver(spring, ctrl);
    }
  });
}
function createSpring(key, observer) {
  const spring = new SpringValue();
  spring.key = key;
  if (observer) {
    addFluidObserver(spring, observer);
  }
  return spring;
}
function prepareSprings(springs, props, create) {
  if (props.keys) {
    each(props.keys, (key) => {
      const spring = springs[key] || (springs[key] = create(key));
      spring["_prepareNode"](props);
    });
  }
}
function prepareKeys(ctrl, queue) {
  each(queue, (props) => {
    prepareSprings(ctrl.springs, props, (key) => {
      return createSpring(key, ctrl);
    });
  });
}
function _objectWithoutPropertiesLoose$1(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}
const _excluded$3 = ["children"];
const SpringContext = (_ref) => {
  let {
    children
  } = _ref, props = _objectWithoutPropertiesLoose$1(_ref, _excluded$3);
  const inherited = reactExports.useContext(ctx);
  const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
  props = useMemoOne(() => ({
    pause,
    immediate
  }), [pause, immediate]);
  const {
    Provider: Provider2
  } = ctx;
  return reactExports.createElement(Provider2, {
    value: props
  }, children);
};
const ctx = makeContext(SpringContext, {});
SpringContext.Provider = ctx.Provider;
SpringContext.Consumer = ctx.Consumer;
function makeContext(target, init) {
  Object.assign(target, reactExports.createContext(init));
  target.Provider._context = target;
  target.Consumer._context = target;
  return target;
}
const SpringRef = () => {
  const current = [];
  const SpringRef2 = function SpringRef3(props) {
    deprecateDirectCall();
    const results = [];
    each(current, (ctrl, i) => {
      if (is.und(props)) {
        results.push(ctrl.start());
      } else {
        const update2 = _getProps(props, ctrl, i);
        if (update2) {
          results.push(ctrl.start(update2));
        }
      }
    });
    return results;
  };
  SpringRef2.current = current;
  SpringRef2.add = function(ctrl) {
    if (!current.includes(ctrl)) {
      current.push(ctrl);
    }
  };
  SpringRef2.delete = function(ctrl) {
    const i = current.indexOf(ctrl);
    if (~i) current.splice(i, 1);
  };
  SpringRef2.pause = function() {
    each(current, (ctrl) => ctrl.pause(...arguments));
    return this;
  };
  SpringRef2.resume = function() {
    each(current, (ctrl) => ctrl.resume(...arguments));
    return this;
  };
  SpringRef2.set = function(values) {
    each(current, (ctrl) => ctrl.set(values));
  };
  SpringRef2.start = function(props) {
    const results = [];
    each(current, (ctrl, i) => {
      if (is.und(props)) {
        results.push(ctrl.start());
      } else {
        const update2 = this._getProps(props, ctrl, i);
        if (update2) {
          results.push(ctrl.start(update2));
        }
      }
    });
    return results;
  };
  SpringRef2.stop = function() {
    each(current, (ctrl) => ctrl.stop(...arguments));
    return this;
  };
  SpringRef2.update = function(props) {
    each(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i)));
    return this;
  };
  const _getProps = function _getProps2(arg, ctrl, index) {
    return is.fun(arg) ? arg(index, ctrl) : arg;
  };
  SpringRef2._getProps = _getProps;
  return SpringRef2;
};
function useSprings(length, props, deps) {
  const propsFn = is.fun(props) && props;
  if (propsFn && !deps) deps = [];
  const ref = reactExports.useMemo(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []);
  const layoutId = reactExports.useRef(0);
  const forceUpdate = useForceUpdate();
  const state = reactExports.useMemo(() => ({
    ctrls: [],
    queue: [],
    flush(ctrl, updates2) {
      const springs2 = getSprings(ctrl, updates2);
      const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs2).some((key) => !ctrl.springs[key]);
      return canFlushSync ? flushUpdateQueue(ctrl, updates2) : new Promise((resolve) => {
        setSprings(ctrl, springs2);
        state.queue.push(() => {
          resolve(flushUpdateQueue(ctrl, updates2));
        });
        forceUpdate();
      });
    }
  }), []);
  const ctrls = reactExports.useRef([...state.ctrls]);
  const updates = [];
  const prevLength = usePrev(length) || 0;
  reactExports.useMemo(() => {
    each(ctrls.current.slice(length, prevLength), (ctrl) => {
      detachRefs(ctrl, ref);
      ctrl.stop(true);
    });
    ctrls.current.length = length;
    declareUpdates(prevLength, length);
  }, [length]);
  reactExports.useMemo(() => {
    declareUpdates(0, Math.min(prevLength, length));
  }, deps);
  function declareUpdates(startIndex, endIndex) {
    for (let i = startIndex; i < endIndex; i++) {
      const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush));
      const update2 = propsFn ? propsFn(i, ctrl) : props[i];
      if (update2) {
        updates[i] = declareUpdate(update2);
      }
    }
  }
  const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i]));
  const context = reactExports.useContext(SpringContext);
  const prevContext = usePrev(context);
  const hasContext = context !== prevContext && hasProps(context);
  useLayoutEffect(() => {
    layoutId.current++;
    state.ctrls = ctrls.current;
    const {
      queue
    } = state;
    if (queue.length) {
      state.queue = [];
      each(queue, (cb) => cb());
    }
    each(ctrls.current, (ctrl, i) => {
      ref == null ? void 0 : ref.add(ctrl);
      if (hasContext) {
        ctrl.start({
          default: context
        });
      }
      const update2 = updates[i];
      if (update2) {
        replaceRef(ctrl, update2.ref);
        if (ctrl.ref) {
          ctrl.queue.push(update2);
        } else {
          ctrl.start(update2);
        }
      }
    });
  });
  useOnce(() => () => {
    each(state.ctrls, (ctrl) => ctrl.stop(true));
  });
  const values = springs.map((x) => _extends({}, x));
  return ref ? [values, ref] : values;
}
function useSpring(props, deps) {
  const isFn = is.fun(props);
  const [[values], ref] = useSprings(1, isFn ? props : [props], isFn ? [] : deps);
  return isFn || arguments.length == 2 ? [values, ref] : values;
}
let TransitionPhase;
(function(TransitionPhase2) {
  TransitionPhase2["MOUNT"] = "mount";
  TransitionPhase2["ENTER"] = "enter";
  TransitionPhase2["UPDATE"] = "update";
  TransitionPhase2["LEAVE"] = "leave";
})(TransitionPhase || (TransitionPhase = {}));
class Interpolation extends FrameValue {
  constructor(source, args) {
    super();
    this.key = void 0;
    this.idle = true;
    this.calc = void 0;
    this._active = /* @__PURE__ */ new Set();
    this.source = source;
    this.calc = createInterpolator(...args);
    const value = this._get();
    const nodeType = getAnimatedType(value);
    setAnimated(this, nodeType.create(value));
  }
  advance(_dt) {
    const value = this._get();
    const oldValue = this.get();
    if (!isEqual(value, oldValue)) {
      getAnimated(this).setValue(value);
      this._onChange(value, this.idle);
    }
    if (!this.idle && checkIdle(this._active)) {
      becomeIdle(this);
    }
  }
  _get() {
    const inputs = is.arr(this.source) ? this.source.map(getFluidValue) : toArray(getFluidValue(this.source));
    return this.calc(...inputs);
  }
  _start() {
    if (this.idle && !checkIdle(this._active)) {
      this.idle = false;
      each(getPayload(this), (node) => {
        node.done = false;
      });
      if (globals.skipAnimation) {
        raf.batchedUpdates(() => this.advance());
        becomeIdle(this);
      } else {
        frameLoop.start(this);
      }
    }
  }
  _attach() {
    let priority2 = 1;
    each(toArray(this.source), (source) => {
      if (hasFluidValue(source)) {
        addFluidObserver(source, this);
      }
      if (isFrameValue(source)) {
        if (!source.idle) {
          this._active.add(source);
        }
        priority2 = Math.max(priority2, source.priority + 1);
      }
    });
    this.priority = priority2;
    this._start();
  }
  _detach() {
    each(toArray(this.source), (source) => {
      if (hasFluidValue(source)) {
        removeFluidObserver(source, this);
      }
    });
    this._active.clear();
    becomeIdle(this);
  }
  eventObserved(event) {
    if (event.type == "change") {
      if (event.idle) {
        this.advance();
      } else {
        this._active.add(event.parent);
        this._start();
      }
    } else if (event.type == "idle") {
      this._active.delete(event.parent);
    } else if (event.type == "priority") {
      this.priority = toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0);
    }
  }
}
function isIdle(source) {
  return source.idle !== false;
}
function checkIdle(active) {
  return !active.size || Array.from(active).every(isIdle);
}
function becomeIdle(self2) {
  if (!self2.idle) {
    self2.idle = true;
    each(getPayload(self2), (node) => {
      node.done = true;
    });
    callFluidObservers(self2, {
      type: "idle",
      parent: self2
    });
  }
}
globals.assign({
  createStringInterpolator,
  to: (source, args) => new Interpolation(source, args)
});
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}
const _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"];
const isCustomPropRE = /^--/;
function dangerousStyleValue(name, value) {
  if (value == null || typeof value === "boolean" || value === "") return "";
  if (typeof value === "number" && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + "px";
  return ("" + value).trim();
}
const attributeCache = {};
function applyAnimatedValues(instance, props) {
  if (!instance.nodeType || !instance.setAttribute) {
    return false;
  }
  const isFilterElement = instance.nodeName === "filter" || instance.parentNode && instance.parentNode.nodeName === "filter";
  const _ref = props, {
    style,
    children,
    scrollTop,
    scrollLeft
  } = _ref, attributes = _objectWithoutPropertiesLoose(_ref, _excluded$2);
  const values = Object.values(attributes);
  const names = Object.keys(attributes).map((name) => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, (n) => "-" + n.toLowerCase())));
  if (children !== void 0) {
    instance.textContent = children;
  }
  for (let name in style) {
    if (style.hasOwnProperty(name)) {
      const value = dangerousStyleValue(name, style[name]);
      if (isCustomPropRE.test(name)) {
        instance.style.setProperty(name, value);
      } else {
        instance.style[name] = value;
      }
    }
  }
  names.forEach((name, i) => {
    instance.setAttribute(name, values[i]);
  });
  if (scrollTop !== void 0) {
    instance.scrollTop = scrollTop;
  }
  if (scrollLeft !== void 0) {
    instance.scrollLeft = scrollLeft;
  }
}
let isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};
const prefixKey = (prefix2, key) => prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
const prefixes = ["Webkit", "Ms", "Moz", "O"];
isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => {
  prefixes.forEach((prefix2) => acc[prefixKey(prefix2, prop)] = acc[prop]);
  return acc;
}, isUnitlessNumber);
const _excluded$1 = ["x", "y", "z"];
const domTransforms = /^(matrix|translate|scale|rotate|skew)/;
const pxTransforms = /^(translate)/;
const degTransforms = /^(rotate|skew)/;
const addUnit = (value, unit) => is.num(value) && value !== 0 ? value + unit : value;
const isValueIdentity = (value, id) => is.arr(value) ? value.every((v2) => isValueIdentity(v2, id)) : is.num(value) ? value === id : parseFloat(value) === id;
class AnimatedStyle extends AnimatedObject {
  constructor(_ref) {
    let {
      x,
      y,
      z
    } = _ref, style = _objectWithoutPropertiesLoose(_ref, _excluded$1);
    const inputs = [];
    const transforms = [];
    if (x || y || z) {
      inputs.push([x || 0, y || 0, z || 0]);
      transforms.push((xyz) => [`translate3d(${xyz.map((v2) => addUnit(v2, "px")).join(",")})`, isValueIdentity(xyz, 0)]);
    }
    eachProp(style, (value, key) => {
      if (key === "transform") {
        inputs.push([value || ""]);
        transforms.push((transform) => [transform, transform === ""]);
      } else if (domTransforms.test(key)) {
        delete style[key];
        if (is.und(value)) return;
        const unit = pxTransforms.test(key) ? "px" : degTransforms.test(key) ? "deg" : "";
        inputs.push(toArray(value));
        transforms.push(key === "rotate3d" ? ([x2, y2, z2, deg]) => [`rotate3d(${x2},${y2},${z2},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : (input) => [`${key}(${input.map((v2) => addUnit(v2, unit)).join(",")})`, isValueIdentity(input, key.startsWith("scale") ? 1 : 0)]);
      }
    });
    if (inputs.length) {
      style.transform = new FluidTransform(inputs, transforms);
    }
    super(style);
  }
}
class FluidTransform extends FluidValue {
  constructor(inputs, transforms) {
    super();
    this._value = null;
    this.inputs = inputs;
    this.transforms = transforms;
  }
  get() {
    return this._value || (this._value = this._get());
  }
  _get() {
    let transform = "";
    let identity = true;
    each(this.inputs, (input, i) => {
      const arg1 = getFluidValue(input[0]);
      const [t, id] = this.transforms[i](is.arr(arg1) ? arg1 : input.map(getFluidValue));
      transform += " " + t;
      identity = identity && id;
    });
    return identity ? "none" : transform;
  }
  observerAdded(count) {
    if (count == 1) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && addFluidObserver(value, this)));
  }
  observerRemoved(count) {
    if (count == 0) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && removeFluidObserver(value, this)));
  }
  eventObserved(event) {
    if (event.type == "change") {
      this._value = null;
    }
    callFluidObservers(this, event);
  }
}
const primitives = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"];
const _excluded = ["scrollTop", "scrollLeft"];
globals.assign({
  batchedUpdates: reactDomExports.unstable_batchedUpdates,
  createStringInterpolator,
  colors
});
createHost(primitives, {
  applyAnimatedValues,
  createAnimatedStyle: (style) => new AnimatedStyle(style),
  getComponentProps: (_ref) => {
    let props = _objectWithoutPropertiesLoose(_ref, _excluded);
    return props;
  }
});
var AIOrbStatus = /* @__PURE__ */ ((AIOrbStatus2) => {
  AIOrbStatus2["Waiting"] = "waiting";
  AIOrbStatus2["Thinking"] = "thinking";
  AIOrbStatus2["Error"] = "error";
  AIOrbStatus2["Warning"] = "warning";
  AIOrbStatus2["Disconnected"] = "disconnected";
  return AIOrbStatus2;
})(AIOrbStatus || {});
var AIOrbSize = /* @__PURE__ */ ((AIOrbSize2) => {
  AIOrbSize2[AIOrbSize2["Small"] = 40] = "Small";
  AIOrbSize2[AIOrbSize2["Medium"] = 72] = "Medium";
  AIOrbSize2[AIOrbSize2["Large"] = 140] = "Large";
  AIOrbSize2[AIOrbSize2["FullScreen"] = 2e3] = "FullScreen";
  return AIOrbSize2;
})(AIOrbSize || {});
const AIOrb = (props) => {
  const { state = "waiting", size: size2 = 72, className } = props;
  useSpring({
    config: { tension: 200, friction: 20 },
    containerSize: size2 === 2e3 ? "1500px" : `${size2}px`,
    onChange: (props2) => {
      document.documentElement.style.setProperty("--container-size", props2.value.containerSize);
    }
  });
  reactExports.useEffect(() => {
    const root = document.documentElement;
    const style = getOrbStyle();
    Object.keys(style).forEach((key) => {
      root.style.setProperty(key, style[key]);
    });
  }, [state]);
  const getOrbStyle = () => {
    let animationDurationRotation = 8;
    let animationDurationScale = 6;
    let baseColor = "var(--p500)";
    let color1 = "hsl(from var(--ai-orb-base-color) calc(h + 123) s calc(l + 6))";
    let color2 = "hsl(from var(--ai-orb-base-color) calc(h - 35) 62 62)";
    let color3 = "hsl(from var(--ai-orb-base-color) h s 98)";
    switch (state) {
      case "thinking":
        animationDurationRotation = 3;
        animationDurationScale = 1.5;
        baseColor = "hsla(217, 100%, 50%, 1)";
        break;
      case "error":
        animationDurationRotation = 5;
        animationDurationScale = 10;
        baseColor = "hsla(15, 100%, 50%, 1)";
        color1 = "hsla(15, 100%, 56%, 1)";
        color2 = "hsla(25, 62%, 62%, 1)";
        color3 = "hsla(0, 100%, 80%, 1)";
        break;
      case "disconnected":
        animationDurationRotation = 20;
        animationDurationScale = 25;
        baseColor = "hsla(217, 20%, 50%, 0.5)";
        color1 = "hsla(217, 20%, 56%, 0.5)";
        color2 = "hsla(250, 20%, 62%, 0.5)";
        color3 = "hsla(217, 20%, 95%, 0.75)";
        break;
      case "warning":
        animationDurationRotation = 5;
        animationDurationScale = 8;
        baseColor = "hsla(40, 100%, 50%, 1)";
        color1 = "hsla(35, 100%, 56%, 1)";
        color2 = "hsla(45, 100%, 62%, 1)";
        color3 = "hsla(35, 100%, 45%, 1)";
        break;
    }
    if (size2 === 2e3) {
      animationDurationRotation = 20;
      animationDurationScale = 25;
      color3 = "hsl(from var(--ai-orb-base-color) calc(h + 45) s calc(l - 10))";
    }
    return {
      "--animation-duration-rotation": `${animationDurationRotation}s`,
      "--animation-duration-scale": `${animationDurationScale}s`,
      "--ai-orb-base-color": baseColor,
      "--color1": color1,
      "--color2": color2,
      "--color3": color3
    };
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(className, size2 === 2e3 ? styles$j.fullscreen : void 0), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$j.aiOrb), style: getOrbStyle(), children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbsContainer) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$j.orbsContainer), children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$j.orbsContainer), children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsSmall) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsSmall) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsSmall) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsSmall) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$j.orbsContainer), children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$j.orbs, styles$j.orbsLarge) })
    ] })
  ] }) });
};
function normalizeColor(hexCode) {
  return [(hexCode >> 16 & 255) / 255, (hexCode >> 8 & 255) / 255, (255 & hexCode) / 255];
}
["SCREEN", "LINEAR_LIGHT"].reduce((hexCode, t, n) => Object.assign(hexCode, {
  [t]: n
}), {});
class MiniGl {
  constructor(canvas, width, height, debug = false) {
    const _miniGl = this, debug_output = -1 !== document.location.search.toLowerCase().indexOf("debug=webgl");
    _miniGl.canvas = canvas, _miniGl.gl = _miniGl.canvas.getContext("webgl", {
      antialias: true
    }), _miniGl.meshes = [];
    const context = _miniGl.gl;
    width && height && this.setSize(width, height), _miniGl.lastDebugMsg, _miniGl.debug = debug && debug_output ? function(e2) {
      const t = /* @__PURE__ */ new Date();
      t - _miniGl.lastDebugMsg > 1e3, _miniGl.lastDebugMsg = t;
    } : () => {
    }, Object.defineProperties(_miniGl, {
      Material: {
        enumerable: false,
        value: class {
          constructor(vertexShaders, fragments, uniforms = {}) {
            const material = this;
            function getShaderByType(type, source) {
              const shader = context.createShader(type);
              return context.shaderSource(shader, source), context.compileShader(shader), context.getShaderParameter(shader, context.COMPILE_STATUS), _miniGl.debug("Material.compileShaderSource", {
                source
              }), shader;
            }
            function getUniformVariableDeclarations(uniforms2, type) {
              return Object.entries(uniforms2).map(([uniform, value]) => value.getDeclaration(uniform, type)).join("\n");
            }
            material.uniforms = uniforms, material.uniformInstances = [];
            const prefix2 = "\n              precision highp float;\n            ";
            material.vertexSource = `
              ${prefix2}
              attribute vec4 position;
              attribute vec2 uv;
              attribute vec2 uvNorm;
              ${getUniformVariableDeclarations(_miniGl.commonUniforms, "vertex")}
              ${getUniformVariableDeclarations(uniforms, "vertex")}
              ${vertexShaders}
            `, material.Source = `
              ${prefix2}
              ${getUniformVariableDeclarations(_miniGl.commonUniforms, "fragment")}
              ${getUniformVariableDeclarations(uniforms, "fragment")}
              ${fragments}
            `, material.vertexShader = getShaderByType(context.VERTEX_SHADER, material.vertexSource), material.fragmentShader = getShaderByType(context.FRAGMENT_SHADER, material.Source), material.program = context.createProgram(), context.attachShader(material.program, material.vertexShader), context.attachShader(material.program, material.fragmentShader), context.linkProgram(material.program), context.getProgramParameter(material.program, context.LINK_STATUS), context.useProgram(material.program), material.attachUniforms(void 0, _miniGl.commonUniforms), material.attachUniforms(void 0, material.uniforms);
          }
          //t = uniform
          attachUniforms(name, uniforms) {
            const material = this;
            void 0 === name ? Object.entries(uniforms).forEach(([name2, uniform]) => {
              material.attachUniforms(name2, uniform);
            }) : "array" == uniforms.type ? uniforms.value.forEach((uniform, i) => material.attachUniforms(`${name}[${i}]`, uniform)) : "struct" == uniforms.type ? Object.entries(uniforms.value).forEach(([uniform, i]) => material.attachUniforms(`${name}.${uniform}`, i)) : (_miniGl.debug("Material.attachUniforms", {
              name,
              uniform: uniforms
            }), material.uniformInstances.push({
              uniform: uniforms,
              location: context.getUniformLocation(material.program, name)
            }));
          }
        }
      },
      Uniform: {
        enumerable: false,
        value: class {
          constructor(e2) {
            this.type = "float", Object.assign(this, e2);
            this.typeFn = {
              float: "1f",
              int: "1i",
              vec2: "2fv",
              vec3: "3fv",
              vec4: "4fv",
              mat4: "Matrix4fv"
            }[this.type] || "1f", this.update();
          }
          update(value) {
            void 0 !== this.value && context[`uniform${this.typeFn}`](value, 0 === this.typeFn.indexOf("Matrix") ? this.transpose : this.value, 0 === this.typeFn.indexOf("Matrix") ? this.value : null);
          }
          //e - name
          //t - type
          //n - length
          getDeclaration(name, type, length) {
            const uniform = this;
            if (uniform.excludeFrom !== type) {
              if ("array" === uniform.type) return uniform.value[0].getDeclaration(name, type, uniform.value.length) + `
const int ${name}_length = ${uniform.value.length};`;
              if ("struct" === uniform.type) {
                let name_no_prefix = name.replace("u_", "");
                return name_no_prefix = name_no_prefix.charAt(0).toUpperCase() + name_no_prefix.slice(1), `uniform struct ${name_no_prefix}
                                  {
` + Object.entries(uniform.value).map(([name2, uniform2]) => uniform2.getDeclaration(name2, type).replace(/^uniform/, "")).join("") + `
} ${name}${length > 0 ? `[${length}]` : ""};`;
              }
              return `uniform ${uniform.type} ${name}${length > 0 ? `[${length}]` : ""};`;
            }
          }
        }
      },
      PlaneGeometry: {
        enumerable: false,
        value: class {
          constructor(width2, height2, n, i, orientation) {
            context.createBuffer(), this.attributes = {
              position: new _miniGl.Attribute({
                target: context.ARRAY_BUFFER,
                size: 3
              }),
              uv: new _miniGl.Attribute({
                target: context.ARRAY_BUFFER,
                size: 2
              }),
              uvNorm: new _miniGl.Attribute({
                target: context.ARRAY_BUFFER,
                size: 2
              }),
              index: new _miniGl.Attribute({
                target: context.ELEMENT_ARRAY_BUFFER,
                size: 3,
                type: context.UNSIGNED_SHORT
              })
            }, this.setTopology(n, i), this.setSize(width2, height2, orientation);
          }
          setTopology(e2 = 1, t = 1) {
            const n = this;
            n.xSegCount = e2, n.ySegCount = t, n.vertexCount = (n.xSegCount + 1) * (n.ySegCount + 1), n.quadCount = n.xSegCount * n.ySegCount * 2, n.attributes.uv.values = new Float32Array(2 * n.vertexCount), n.attributes.uvNorm.values = new Float32Array(2 * n.vertexCount), n.attributes.index.values = new Uint16Array(3 * n.quadCount);
            for (let e3 = 0; e3 <= n.ySegCount; e3++)
              for (let t2 = 0; t2 <= n.xSegCount; t2++) {
                const i = e3 * (n.xSegCount + 1) + t2;
                if (n.attributes.uv.values[2 * i] = t2 / n.xSegCount, n.attributes.uv.values[2 * i + 1] = 1 - e3 / n.ySegCount, n.attributes.uvNorm.values[2 * i] = t2 / n.xSegCount * 2 - 1, n.attributes.uvNorm.values[2 * i + 1] = 1 - e3 / n.ySegCount * 2, t2 < n.xSegCount && e3 < n.ySegCount) {
                  const s = e3 * n.xSegCount + t2;
                  n.attributes.index.values[6 * s] = i, n.attributes.index.values[6 * s + 1] = i + 1 + n.xSegCount, n.attributes.index.values[6 * s + 2] = i + 1, n.attributes.index.values[6 * s + 3] = i + 1, n.attributes.index.values[6 * s + 4] = i + 1 + n.xSegCount, n.attributes.index.values[6 * s + 5] = i + 2 + n.xSegCount;
                }
              }
            n.attributes.uv.update(), n.attributes.uvNorm.update(), n.attributes.index.update(), _miniGl.debug("Geometry.setTopology", {
              uv: n.attributes.uv,
              uvNorm: n.attributes.uvNorm,
              index: n.attributes.index
            });
          }
          setSize(width2 = 1, height2 = 1, orientation = "xz") {
            const geometry = this;
            geometry.width = width2, geometry.height = height2, geometry.orientation = orientation, geometry.attributes.position.values && geometry.attributes.position.values.length === 3 * geometry.vertexCount || (geometry.attributes.position.values = new Float32Array(3 * geometry.vertexCount));
            const o = width2 / -2, r = height2 / -2, segment_width = width2 / geometry.xSegCount, segment_height = height2 / geometry.ySegCount;
            for (let yIndex = 0; yIndex <= geometry.ySegCount; yIndex++) {
              const t = r + yIndex * segment_height;
              for (let xIndex = 0; xIndex <= geometry.xSegCount; xIndex++) {
                const r2 = o + xIndex * segment_width, l = yIndex * (geometry.xSegCount + 1) + xIndex;
                geometry.attributes.position.values[3 * l + "xyz".indexOf(orientation[0])] = r2, geometry.attributes.position.values[3 * l + "xyz".indexOf(orientation[1])] = -t;
              }
            }
            geometry.attributes.position.update(), _miniGl.debug("Geometry.setSize", {
              position: geometry.attributes.position
            });
          }
        }
      },
      Mesh: {
        enumerable: false,
        value: class {
          constructor(geometry, material) {
            const mesh = this;
            mesh.geometry = geometry, mesh.material = material, mesh.wireframe = false, mesh.attributeInstances = [], Object.entries(mesh.geometry.attributes).forEach(([e2, attribute]) => {
              mesh.attributeInstances.push({
                attribute,
                location: attribute.attach(e2, mesh.material.program)
              });
            }), _miniGl.meshes.push(mesh), _miniGl.debug("Mesh.constructor", {
              mesh
            });
          }
          draw() {
            context.useProgram(this.material.program), this.material.uniformInstances.forEach(({
              uniform: e2,
              location: t
            }) => e2.update(t)), this.attributeInstances.forEach(({
              attribute: e2,
              location: t
            }) => e2.use(t)), context.drawElements(this.wireframe ? context.LINES : context.TRIANGLES, this.geometry.attributes.index.values.length, context.UNSIGNED_SHORT, 0);
          }
          remove() {
            _miniGl.meshes = _miniGl.meshes.filter((e2) => e2 != this);
          }
        }
      },
      Attribute: {
        enumerable: false,
        value: class {
          constructor(e2) {
            this.type = context.FLOAT, this.normalized = false, this.buffer = context.createBuffer(), Object.assign(this, e2), this.update();
          }
          update() {
            void 0 !== this.values && (context.bindBuffer(this.target, this.buffer), context.bufferData(this.target, this.values, context.STATIC_DRAW));
          }
          attach(e2, t) {
            const n = context.getAttribLocation(t, e2);
            return this.target === context.ARRAY_BUFFER && (context.enableVertexAttribArray(n), context.vertexAttribPointer(n, this.size, this.type, this.normalized, 0, 0)), n;
          }
          use(e2) {
            context.bindBuffer(this.target, this.buffer), this.target === context.ARRAY_BUFFER && (context.enableVertexAttribArray(e2), context.vertexAttribPointer(e2, this.size, this.type, this.normalized, 0, 0));
          }
        }
      }
    });
    const a = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
    _miniGl.commonUniforms = {
      projectionMatrix: new _miniGl.Uniform({
        type: "mat4",
        value: a
      }),
      modelViewMatrix: new _miniGl.Uniform({
        type: "mat4",
        value: a
      }),
      resolution: new _miniGl.Uniform({
        type: "vec2",
        value: [1, 1]
      }),
      aspectRatio: new _miniGl.Uniform({
        type: "float",
        value: 1
      })
    };
  }
  setSize(e2 = 640, t = 480) {
    this.width = e2, this.height = t, this.canvas.width = e2, this.canvas.height = t, this.gl.viewport(0, 0, e2, t), this.commonUniforms.resolution.value = [e2, t], this.commonUniforms.aspectRatio.value = e2 / t, this.debug("MiniGL.setSize", {
      width: e2,
      height: t
    });
  }
  //left, right, top, bottom, near, far
  setOrthographicCamera(e2 = 0, t = 0, n = 0, i = -2e3, s = 2e3) {
    this.commonUniforms.projectionMatrix.value = [2 / this.width, 0, 0, 0, 0, 2 / this.height, 0, 0, 0, 0, 2 / (i - s), 0, e2, t, n, 1], this.debug("setOrthographicCamera", this.commonUniforms.projectionMatrix.value);
  }
  render() {
    this.gl.clearColor(0, 0, 0, 0), this.gl.clearDepth(1), this.meshes.forEach((e2) => e2.draw());
  }
}
function e(object, propertyName, val) {
  return propertyName in object ? Object.defineProperty(object, propertyName, {
    value: val,
    enumerable: true,
    configurable: true,
    writable: true
  }) : object[propertyName] = val, object;
}
class Gradient {
  constructor(...t) {
    e(this, "el", void 0), e(this, "cssVarRetries", 0), e(this, "maxCssVarRetries", 200), e(this, "angle", 0), e(this, "isLoadedClass", false), e(this, "isScrolling", false), /*e(this, "isStatic", o.disableAmbientAnimations()),*/
    e(this, "scrollingTimeout", void 0), e(this, "scrollingRefreshDelay", 200), e(this, "isIntersecting", false), e(this, "shaderFiles", void 0), e(this, "vertexShader", void 0), e(this, "sectionColors", void 0), e(this, "computedCanvasStyle", void 0), e(this, "conf", void 0), e(this, "uniforms", void 0), e(this, "t", 1253106), e(this, "last", 0), e(this, "width", void 0), e(this, "minWidth", 1111), e(this, "height", 600), e(this, "xSegCount", void 0), e(this, "ySegCount", void 0), e(this, "mesh", void 0), e(this, "material", void 0), e(this, "geometry", void 0), e(this, "minigl", void 0), e(this, "scrollObserver", void 0), e(this, "amp", 320), e(this, "seed", 5), e(this, "freqX", 14e-5), e(this, "freqY", 29e-5), e(this, "freqDelta", 1e-5), e(this, "activeColors", [1, 1, 1, 1]), e(this, "isMetaKey", false), e(this, "isGradientLegendVisible", false), e(this, "isMouseDown", false), e(this, "handleScroll", () => {
      clearTimeout(this.scrollingTimeout), this.scrollingTimeout = setTimeout(this.handleScrollEnd, this.scrollingRefreshDelay), this.isGradientLegendVisible && this.hideGradientLegend(), this.conf.playing && (this.isScrolling = true, this.pause());
    }), e(this, "handleScrollEnd", () => {
      this.isScrolling = false, this.isIntersecting && this.play();
    }), e(this, "resize", () => {
      this.width = window.innerWidth, this.minigl.setSize(this.width, this.height), this.minigl.setOrthographicCamera(), this.xSegCount = Math.ceil(this.width * this.conf.density[0]), this.ySegCount = Math.ceil(this.height * this.conf.density[1]), this.mesh.geometry.setTopology(this.xSegCount, this.ySegCount), this.mesh.geometry.setSize(this.width, this.height), this.mesh.material.uniforms.u_shadow_power.value = this.width < 600 ? 5 : 6;
    }), e(this, "handleMouseDown", (e2) => {
      this.isGradientLegendVisible && (this.isMetaKey = e2.metaKey, this.isMouseDown = true, false === this.conf.playing && requestAnimationFrame(this.animate));
    }), e(this, "handleMouseUp", () => {
      this.isMouseDown = false;
    }), e(this, "animate", (e2) => {
      if (!this.shouldSkipFrame(e2) || this.isMouseDown) {
        if (this.t += Math.min(e2 - this.last, 1e3 / 15), this.last = e2, this.isMouseDown) {
          let e3 = 160;
          this.isMetaKey && (e3 = -160), this.t += e3;
        }
        this.mesh.material.uniforms.u_time.value = this.t, this.minigl.render();
      }
      if (0 !== this.last && this.isStatic) return this.minigl.render(), void this.disconnect();
      /*this.isIntersecting && */
      (this.conf.playing || this.isMouseDown) && requestAnimationFrame(this.animate);
    }), e(this, "addIsLoadedClass", () => {
      !this.isLoadedClass && (this.isLoadedClass = true, this.el.classList.add("isLoaded"), setTimeout(() => {
        this.el.parentElement.classList.add("isLoaded");
      }, 3e3));
    }), e(this, "pause", () => {
      this.conf.playing = false;
    }), e(this, "play", () => {
      requestAnimationFrame(this.animate), this.conf.playing = true;
    }), e(this, "initGradient", (selector) => {
      this.el = document.querySelector(selector);
      this.connect();
      return this;
    });
  }
  async connect() {
    this.shaderFiles = {
      vertex: "varying vec3 v_color;\n\nvoid main() {\n  float time = u_time * u_global.noiseSpeed;\n\n  vec2 noiseCoord = resolution * uvNorm * u_global.noiseFreq;\n\n  vec2 st = 1. - uvNorm.xy;\n\n  //\n  // Tilting the plane\n  //\n\n  // Front-to-back tilt\n  float tilt = resolution.y / 2.0 * uvNorm.y;\n\n  // Left-to-right angle\n  float incline = resolution.x * uvNorm.x / 2.0 * u_vertDeform.incline;\n\n  // Up-down shift to offset incline\n  float offset = resolution.x / 2.0 * u_vertDeform.incline * mix(u_vertDeform.offsetBottom, u_vertDeform.offsetTop, uv.y);\n\n  //\n  // Vertex noise\n  //\n\n  float noise = snoise(vec3(\n    noiseCoord.x * u_vertDeform.noiseFreq.x + time * u_vertDeform.noiseFlow,\n    noiseCoord.y * u_vertDeform.noiseFreq.y,\n    time * u_vertDeform.noiseSpeed + u_vertDeform.noiseSeed\n  )) * u_vertDeform.noiseAmp;\n\n  // Fade noise to zero at edges\n  noise *= 1.0 - pow(abs(uvNorm.y), 2.0);\n\n  // Clamp to 0\n  noise = max(0.0, noise);\n\n  vec3 pos = vec3(\n    position.x,\n    position.y + tilt + incline + noise - offset,\n    position.z\n  );\n\n  //\n  // Vertex color, to be passed to fragment shader\n  //\n\n  if (u_active_colors[0] == 1.) {\n    v_color = u_baseColor;\n  }\n\n  for (int i = 0; i < u_waveLayers_length; i++) {\n    if (u_active_colors[i + 1] == 1.) {\n      WaveLayers layer = u_waveLayers[i];\n\n      float noise = smoothstep(\n        layer.noiseFloor,\n        layer.noiseCeil,\n        snoise(vec3(\n          noiseCoord.x * layer.noiseFreq.x + time * layer.noiseFlow,\n          noiseCoord.y * layer.noiseFreq.y,\n          time * layer.noiseSpeed + layer.noiseSeed\n        )) / 2.0 + 0.5\n      );\n\n      v_color = blendNormal(v_color, layer.color, pow(noise, 4.));\n    }\n  }\n\n  //\n  // Finish\n  //\n\n  gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}",
      noise: "//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n//               noise functions.\n//      Author : Ian McEwan, Ashima Arts.\n//  Maintainer : stegu\n//     Lastmod : 20110822 (ijm)\n//     License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n//               Distributed under the MIT License. See LICENSE file.\n//               https://github.com/ashima/webgl-noise\n//               https://github.com/stegu/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n    return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n  return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n{\n  const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\n  const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n  vec3 i  = floor(v + dot(v, C.yyy) );\n  vec3 x0 =   v - i + dot(i, C.xxx) ;\n\n// Other corners\n  vec3 g = step(x0.yzx, x0.xyz);\n  vec3 l = 1.0 - g;\n  vec3 i1 = min( g.xyz, l.zxy );\n  vec3 i2 = max( g.xyz, l.zxy );\n\n  //   x0 = x0 - 0.0 + 0.0 * C.xxx;\n  //   x1 = x0 - i1  + 1.0 * C.xxx;\n  //   x2 = x0 - i2  + 2.0 * C.xxx;\n  //   x3 = x0 - 1.0 + 3.0 * C.xxx;\n  vec3 x1 = x0 - i1 + C.xxx;\n  vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n  vec3 x3 = x0 - D.yyy;      // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n  i = mod289(i);\n  vec4 p = permute( permute( permute(\n            i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n          + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n          + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n  float n_ = 0.142857142857; // 1.0/7.0\n  vec3  ns = n_ * D.wyz - D.xzx;\n\n  vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  //  mod(p,7*7)\n\n  vec4 x_ = floor(j * ns.z);\n  vec4 y_ = floor(j - 7.0 * x_ );    // mod(j,N)\n\n  vec4 x = x_ *ns.x + ns.yyyy;\n  vec4 y = y_ *ns.x + ns.yyyy;\n  vec4 h = 1.0 - abs(x) - abs(y);\n\n  vec4 b0 = vec4( x.xy, y.xy );\n  vec4 b1 = vec4( x.zw, y.zw );\n\n  //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n  //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n  vec4 s0 = floor(b0)*2.0 + 1.0;\n  vec4 s1 = floor(b1)*2.0 + 1.0;\n  vec4 sh = -step(h, vec4(0.0));\n\n  vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n  vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n  vec3 p0 = vec3(a0.xy,h.x);\n  vec3 p1 = vec3(a0.zw,h.y);\n  vec3 p2 = vec3(a1.xy,h.z);\n  vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n  vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n  p0 *= norm.x;\n  p1 *= norm.y;\n  p2 *= norm.z;\n  p3 *= norm.w;\n\n// Mix final noise value\n  vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n  m = m * m;\n  return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n                                dot(p2,x2), dot(p3,x3) ) );\n}",
      blend: "//\n// https://github.com/jamieowen/glsl-blend\n//\n\n// Normal\n\nvec3 blendNormal(vec3 base, vec3 blend) {\n	return blend;\n}\n\nvec3 blendNormal(vec3 base, vec3 blend, float opacity) {\n	return (blendNormal(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Screen\n\nfloat blendScreen(float base, float blend) {\n	return 1.0-((1.0-base)*(1.0-blend));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend) {\n	return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend, float opacity) {\n	return (blendScreen(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Multiply\n\nvec3 blendMultiply(vec3 base, vec3 blend) {\n	return base*blend;\n}\n\nvec3 blendMultiply(vec3 base, vec3 blend, float opacity) {\n	return (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Overlay\n\nfloat blendOverlay(float base, float blend) {\n	return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend) {\n	return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend, float opacity) {\n	return (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Hard light\n\nvec3 blendHardLight(vec3 base, vec3 blend) {\n	return blendOverlay(blend,base);\n}\n\nvec3 blendHardLight(vec3 base, vec3 blend, float opacity) {\n	return (blendHardLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Soft light\n\nfloat blendSoftLight(float base, float blend) {\n	return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend) {\n	return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {\n	return (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color dodge\n\nfloat blendColorDodge(float base, float blend) {\n	return (blend==1.0)?blend:min(base/(1.0-blend),1.0);\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend) {\n	return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {\n	return (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color burn\n\nfloat blendColorBurn(float base, float blend) {\n	return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend) {\n	return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {\n	return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Vivid Light\n\nfloat blendVividLight(float base, float blend) {\n	return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend) {\n	return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend, float opacity) {\n	return (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Lighten\n\nfloat blendLighten(float base, float blend) {\n	return max(blend,base);\n}\n\nvec3 blendLighten(vec3 base, vec3 blend) {\n	return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));\n}\n\nvec3 blendLighten(vec3 base, vec3 blend, float opacity) {\n	return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear burn\n\nfloat blendLinearBurn(float base, float blend) {\n	// Note : Same implementation as BlendSubtractf\n	return max(base+blend-1.0,0.0);\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend) {\n	// Note : Same implementation as BlendSubtract\n	return max(base+blend-vec3(1.0),vec3(0.0));\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) {\n	return (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear dodge\n\nfloat blendLinearDodge(float base, float blend) {\n	// Note : Same implementation as BlendAddf\n	return min(base+blend,1.0);\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend) {\n	// Note : Same implementation as BlendAdd\n	return min(base+blend,vec3(1.0));\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n	return (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear light\n\nfloat blendLinearLight(float base, float blend) {\n	return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend) {\n	return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n	return (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity));\n}",
      fragment: "varying vec3 v_color;\n\nvoid main() {\n  vec3 color = v_color;\n  if (u_darken_top == 1.0) {\n    vec2 st = gl_FragCoord.xy/resolution.xy;\n    color.g -= pow(st.y + sin(-12.0) * st.x, u_shadow_power) * 0.4;\n  }\n  gl_FragColor = vec4(color, 1.0);\n}"
    }, this.conf = {
      presetName: "",
      wireframe: false,
      density: [0.06, 0.16],
      zoom: 1,
      rotation: 0,
      playing: true
    }, document.querySelectorAll("canvas").length < 1 ? console.error("DID NOT LOAD HERO STRIPE CANVAS") : (this.minigl = new MiniGl(this.el, null, null, true), requestAnimationFrame(() => {
      if (this.el) {
        this.computedCanvasStyle = getComputedStyle(this.el);
        this.waitForCssVars();
      }
    }));
  }
  disconnect() {
    this.scrollObserver && (window.removeEventListener("scroll", this.handleScroll), window.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mouseup", this.handleMouseUp), window.removeEventListener("keydown", this.handleKeyDown), this.scrollObserver.disconnect()), window.removeEventListener("resize", this.resize);
  }
  initMaterial() {
    this.uniforms = {
      u_time: new this.minigl.Uniform({
        value: 0
      }),
      u_shadow_power: new this.minigl.Uniform({
        value: 10
      }),
      u_darken_top: new this.minigl.Uniform({
        value: "" === this.el.dataset.jsDarkenTop ? 1 : 0
      }),
      u_active_colors: new this.minigl.Uniform({
        value: this.activeColors,
        type: "vec4"
      }),
      u_global: new this.minigl.Uniform({
        value: {
          noiseFreq: new this.minigl.Uniform({
            value: [this.freqX, this.freqY],
            type: "vec2"
          }),
          noiseSpeed: new this.minigl.Uniform({
            value: 5e-6
          })
        },
        type: "struct"
      }),
      u_vertDeform: new this.minigl.Uniform({
        value: {
          incline: new this.minigl.Uniform({
            value: Math.sin(this.angle) / Math.cos(this.angle)
          }),
          offsetTop: new this.minigl.Uniform({
            value: -0.5
          }),
          offsetBottom: new this.minigl.Uniform({
            value: -0.5
          }),
          noiseFreq: new this.minigl.Uniform({
            value: [3, 4],
            type: "vec2"
          }),
          noiseAmp: new this.minigl.Uniform({
            value: this.amp
          }),
          noiseSpeed: new this.minigl.Uniform({
            value: 10
          }),
          noiseFlow: new this.minigl.Uniform({
            value: 3
          }),
          noiseSeed: new this.minigl.Uniform({
            value: this.seed
          })
        },
        type: "struct",
        excludeFrom: "fragment"
      }),
      u_baseColor: new this.minigl.Uniform({
        value: this.sectionColors[0],
        type: "vec3",
        excludeFrom: "fragment"
      }),
      u_waveLayers: new this.minigl.Uniform({
        value: [],
        excludeFrom: "fragment",
        type: "array"
      })
    };
    for (let e2 = 1; e2 < this.sectionColors.length; e2 += 1) this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({
      value: {
        color: new this.minigl.Uniform({
          value: this.sectionColors[e2],
          type: "vec3"
        }),
        noiseFreq: new this.minigl.Uniform({
          value: [2 + e2 / this.sectionColors.length, 3 + e2 / this.sectionColors.length],
          type: "vec2"
        }),
        noiseSpeed: new this.minigl.Uniform({
          value: 11 + 0.3 * e2
        }),
        noiseFlow: new this.minigl.Uniform({
          value: 6.5 + 0.3 * e2
        }),
        noiseSeed: new this.minigl.Uniform({
          value: this.seed + 10 * e2
        }),
        noiseFloor: new this.minigl.Uniform({
          value: 0.1
        }),
        noiseCeil: new this.minigl.Uniform({
          value: 0.63 + 0.07 * e2
        })
      },
      type: "struct"
    }));
    return this.vertexShader = [this.shaderFiles.noise, this.shaderFiles.blend, this.shaderFiles.vertex].join("\n\n"), new this.minigl.Material(this.vertexShader, this.shaderFiles.fragment, this.uniforms);
  }
  initMesh() {
    this.material = this.initMaterial(), this.geometry = new this.minigl.PlaneGeometry(), this.mesh = new this.minigl.Mesh(this.geometry, this.material);
  }
  shouldSkipFrame(e2) {
    return !!window.document.hidden || (!this.conf.playing || (parseInt(e2, 10) % 2 == 0 || void 0));
  }
  updateFrequency(e2) {
    this.freqX += e2, this.freqY += e2;
  }
  toggleColor(index) {
    this.activeColors[index] = 0 === this.activeColors[index] ? 1 : 0;
  }
  showGradientLegend() {
    this.width > this.minWidth && (this.isGradientLegendVisible = true, document.body.classList.add("isGradientLegendVisible"));
  }
  hideGradientLegend() {
    this.isGradientLegendVisible = false, document.body.classList.remove("isGradientLegendVisible");
  }
  init() {
    this.initGradientColors();
    this.initMesh();
    this.resize();
    requestAnimationFrame(this.animate);
    window.addEventListener("resize", this.resize);
  }
  /*
  * Waiting for the css variables to become available, usually on page load before we can continue.
  * Using default colors assigned below if no variables have been found after maxCssVarRetries
  */
  waitForCssVars() {
    if (this.computedCanvasStyle && -1 !== this.computedCanvasStyle.getPropertyValue("--gradient-color-1").indexOf("#")) this.init(), this.addIsLoadedClass();
    else {
      if (this.cssVarRetries += 1, this.cssVarRetries > this.maxCssVarRetries) {
        return this.sectionColors = [16711680, 16711680, 16711935, 65280, 255], void this.init();
      }
      requestAnimationFrame(() => this.waitForCssVars());
    }
  }
  /*
  * Initializes the four section colors by retrieving them from css variables.
  */
  initGradientColors() {
    this.sectionColors = ["--gradient-color-1", "--gradient-color-2", "--gradient-color-3", "--gradient-color-4"].map((cssPropertyName) => {
      let hex = this.computedCanvasStyle.getPropertyValue(cssPropertyName).trim();
      if (4 === hex.length) {
        const hexTemp = hex.substr(1).split("").map((hexTemp2) => hexTemp2 + hexTemp2).join("");
        hex = `#${hexTemp}`;
      }
      return hex && `0x${hex.substr(1)}`;
    }).filter(Boolean).map(normalizeColor);
  }
}
const container$1 = "StripeGradientBackgroundAnimation-module__container___rHt79";
const styles$i = {
  container: container$1
};
const StripeGradientBackgroundAnimation = () => {
  const canvasRef = reactExports.useRef(null);
  const gradientRef = reactExports.useRef(null);
  reactExports.useEffect(() => {
    if (canvasRef.current) {
      try {
        gradientRef.current = new Gradient();
        gradientRef.current.initGradient("#gradient-canvas");
        const handleResize = () => {
          if (gradientRef.current) {
            gradientRef.current.resize();
          }
        };
        window.addEventListener("resize", handleResize);
        return () => window.removeEventListener("resize", handleResize);
      } catch (error2) {
      }
    }
  }, []);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$i.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
    "canvas",
    {
      ref: canvasRef,
      id: "gradient-canvas",
      "data-js-darken-top": true,
      "aria-hidden": "true",
      style: {
        "--gradient-color-1": "#f03a7f",
        "--gradient-color-2": "#8fd8d4",
        "--gradient-color-3": "#146CFF",
        "--gradient-color-4": "#146CFF"
      }
    }
  ) });
};
const whiteLoadingAnimation = "" + new URL("assets/white-loading-animation-A8p_6tAl.gif", import.meta.url).href;
const ANIMATION_SPEED_MODIFIER = 1;
const WELCOME_TEXTS = [
  __("Hey there, I`m your assistant.", "beyondseo"),
  __("I`m here to make SEO simple and effective for your website.", "beyondseo"),
  __("Ready to dive in?", "beyondseo")
];
const TEXT_FADE_ANIMATION_DURATION = 150 * ANIMATION_SPEED_MODIFIER;
const TEXT_WELCOME_ANIMATION_WAIT_BETWEEN_COMPONENTS = 4e3 * ANIMATION_SPEED_MODIFIER;
const TEXT_WELCOME_ANIMATION_ANIMATION_DURATION = 250 * ANIMATION_SPEED_MODIFIER;
const TEXT_THANK_YOU_ANIMATION_WAIT_BETWEEN_COMPONENTS = 500 * ANIMATION_SPEED_MODIFIER;
const TEXT_THANK_YOU_ANIMATION_DURATION = 250 * ANIMATION_SPEED_MODIFIER;
const THANK_YOU_TEXTS = [__("Please wait, I’m setting this up now. We’ll continue in just a few minutes.", "beyondseo")];
[
  __("After I`ll open Wordpress, and we can continue on optimising your website and content from there.", "beyondseo")
];
const MIN_THANK_YOU_DISPLAY_TIME = 8e3;
const THANK_YOU_LOADING_TEXTS = [
  __("Connecting WordPress integration", "beyondseo"),
  __("Adding project name", "beyondseo"),
  __("Saving project contact details", "beyondseo"),
  __("Setting project type", "beyondseo"),
  __("Adding project address", "beyondseo"),
  __("Connecting project website", "beyondseo"),
  __("Defining local service areas", "beyondseo"),
  __("Adding weekday hours", "beyondseo"),
  __("Adding weekend hours", "beyondseo"),
  __("Setting primary category", "beyondseo"),
  __("Adding secondary categories", "beyondseo"),
  __("Adding primary keywords", "beyondseo"),
  __("Adding additional keywords", "beyondseo"),
  __("Adding competitors", "beyondseo"),
  __("Setting up main goal", "beyondseo"),
  __("Setting up secondary goal", "beyondseo"),
  __("Adding short description", "beyondseo"),
  __("Adding long description", "beyondseo"),
  __("Searching listings", "beyondseo"),
  __("Getting status of listings", "beyondseo"),
  __("Checking connections", "beyondseo"),
  __("Finalising project fine tuning", "beyondseo")
];
const LOADING_TEXTS = {
  1: [__("Analyzing details", "beyondseo"), __("Processing input", "beyondseo")],
  2: [__("Checking name", "beyondseo"), __("Verifying availability", "beyondseo")],
  3: [__("Reviewing details", "beyondseo"), __("Understanding scope", "beyondseo")],
  4: [__("Locating business", "beyondseo"), __("Validating area", "beyondseo")],
  5: [__("Determining focus", "beyondseo"), __("Mapping region", "beyondseo")],
  6: [__("Highlighting features", "beyondseo"), __("Finding uniqueness", "beyondseo")]
};
const getLoadingTextsForStep = (stepId) => {
  let defaultText = __("Processing your input", "beyondseo");
  if (!stepId || typeof stepId !== "number") {
    return [defaultText];
  }
  let stepText = LOADING_TEXTS[stepId];
  return stepText.map((txt) => __(txt, "beyondseo")) || [defaultText];
};
const OnboardingWelcome = ({ isCompleted, currentStep, skipWelcomeScreen }) => {
  const { onboardingSteps, isGeneratingOnboardingSteps } = useSelector((state) => state.app);
  const dispatch = useAppDispatch();
  const [step, setStep] = reactExports.useState(isCompleted ? 8 : 1);
  const [showLoadingBadge, setShowLoadingBadge] = reactExports.useState(false);
  const [isOnboardingStarted, setIsOnboardingStarted] = reactExports.useState(!!isCompleted || !!skipWelcomeScreen);
  const [showOnboardingStep, setShowOnboardingStep] = reactExports.useState(!!isCompleted);
  const [currentStepContent, setCurrentStepContent] = reactExports.useState({
    texts: [__("Let`s get started!", "beyondseo")],
    loadingTexts: [""]
  });
  const [currentIncompleteStep, setCurrentIncompleteStep] = reactExports.useState(null);
  const [websiteDescription, setWebsiteDescription] = reactExports.useState("");
  const [showThankYouScreen, setShowThankYouScreen] = reactExports.useState(false);
  const [showErrorModal, setShowErrorModal] = reactExports.useState(false);
  const [errorMessage, setErrorMessage] = reactExports.useState("");
  const [errorDetails, setErrorDetails] = reactExports.useState(null);
  const [thankYouTextRendered, setThankYouTextRendered] = reactExports.useState(false);
  const thankYouStartTimeRef = reactExports.useRef(null);
  const currentStepIndex = step - 2;
  const isFinalStep = step === 8;
  reactExports.useEffect(() => {
    var _a2, _b2, _c2, _d2;
    if (currentStep) {
      const stepLoadingTexts = getLoadingTextsForStep(currentStep.id || 1);
      setCurrentIncompleteStep(currentStep);
      setCurrentStepContent({
        texts: [
          ((_c2 = (_b2 = (_a2 = currentStep.questions) == null ? void 0 : _a2.elements) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.question) || __("Provide details to continue", "beyondseo"),
          ((_d2 = currentStep.currentQuestion) == null ? void 0 : _d2.question) || __("Provide details to continue", "beyondseo")
        ],
        loadingTexts: stepLoadingTexts
      });
    }
  }, [currentStep]);
  reactExports.useEffect(() => {
    if (isCompleted) {
      setStep(8);
      setShowOnboardingStep(true);
      setIsOnboardingStarted(true);
    } else if (skipWelcomeScreen) {
      setIsOnboardingStarted(true);
      if (!onboardingSteps) {
        const queryParams = { noCache: true, debug: true };
        if (skipWelcomeScreen) {
          queryParams.skipWelcomeScreen = 1;
        }
        dispatch(
          OnboardingStore.postApiOnboardingGenerateStepsThunk({
            requestBody: null,
            queryParams
          })
        ).unwrap().catch((error2) => {
          setErrorMessage((error2 == null ? void 0 : error2.message) || __("Something went wrong from our side, please try again!", "beyondseo"));
          setErrorDetails(error2);
          setShowErrorModal(true);
        });
      } else {
        processOnboardingSteps(onboardingSteps);
      }
    } else {
      if (!isOnboardingStarted && !onboardingSteps) {
        dispatch(
          OnboardingStore.postApiOnboardingGenerateStepsThunk({
            requestBody: null,
            queryParams: { noCache: true, debug: true }
          })
        ).unwrap().catch((error2) => {
          setErrorMessage((error2 == null ? void 0 : error2.message) || __("Something went wrong from our side, please try again!", "beyondseo"));
          setErrorDetails(error2);
          setShowErrorModal(true);
        });
      }
    }
  }, [dispatch, isCompleted, isOnboardingStarted, onboardingSteps, skipWelcomeScreen]);
  const handleStartClick = () => {
    setIsOnboardingStarted(true);
    if (!onboardingSteps) {
      dispatch(
        OnboardingStore.postApiOnboardingGenerateStepsThunk({
          requestBody: null,
          queryParams: { noCache: true, debug: true }
        })
      ).unwrap().catch((error2) => {
        setIsOnboardingStarted(false);
        setErrorMessage((error2 == null ? void 0 : error2.message) || __("Something went wrong from our side, please try again!", "beyondseo"));
        setErrorDetails(error2);
        setShowErrorModal(true);
      });
    } else {
      processOnboardingSteps(onboardingSteps);
    }
  };
  const processOnboardingSteps = (steps) => {
    var _a2, _b2, _c2, _d2, _e;
    if ((_a2 = steps == null ? void 0 : steps.steps) == null ? void 0 : _a2.elements) {
      const finalStep2 = steps.steps.elements.find(
        (element) => element.isFinalStep === true && element.completed === true
      );
      if (finalStep2) {
        setStep(8);
        setShowOnboardingStep(true);
      } else {
        const firstIncompleteStep = steps.steps.elements.find((element) => element.completed === false);
        if (firstIncompleteStep) {
          const stepLoadingTexts = getLoadingTextsForStep(firstIncompleteStep.id || 1);
          setCurrentIncompleteStep(firstIncompleteStep);
          setCurrentStepContent({
            texts: [
              ((_d2 = (_c2 = (_b2 = firstIncompleteStep.questions) == null ? void 0 : _b2.elements) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.question) || __("Provide details to continue", "beyondseo"),
              ((_e = firstIncompleteStep.currentQuestion) == null ? void 0 : _e.question) || __("Provide details to continue", "beyondseo")
            ],
            loadingTexts: stepLoadingTexts
          });
          setShowOnboardingStep(true);
          setStep(2);
        }
      }
    }
  };
  reactExports.useEffect(() => {
    if (onboardingSteps && isOnboardingStarted) {
      processOnboardingSteps(onboardingSteps);
    }
  }, [onboardingSteps, isOnboardingStarted]);
  const handleStepSubmit = async (value) => {
    var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k;
    setShowLoadingBadge(true);
    const stepLoadingTexts = getLoadingTextsForStep((currentIncompleteStep == null ? void 0 : currentIncompleteStep.id) || 1);
    setCurrentStepContent((prev) => ({
      ...prev,
      loadingTexts: stepLoadingTexts
    }));
    try {
      const response = await dispatch(
        OnboardingStore.postApiOnboardingSubmitStepAnswerThunk({
          requestBody: {
            completion: {
              stepId: currentIncompleteStep == null ? void 0 : currentIncompleteStep.id,
              questionId: (_a2 = currentIncompleteStep == null ? void 0 : currentIncompleteStep.currentQuestion) == null ? void 0 : _a2.id,
              answer: value,
              objectType: WPFlowDataCompletionObjectType.BeyondSEO_Domain_Integrations_WordPress_Setup_Entities_Flows_Completions_WPFlowDataCompletion
            }
          },
          queryParams: { noCache: true }
        })
      ).unwrap();
      setShowLoadingBadge(false);
      if (response == null ? void 0 : response.allStepsCompleted) {
        setStep(8);
        return;
      }
      if ((_b2 = response.step) == null ? void 0 : _b2.isFinalStep) {
        setStep(8);
        return;
      }
      if (response.nextStep) {
        const nextStepLoadingTexts = getLoadingTextsForStep(response.nextStep.id || 1);
        const elementQuestion = (_e = (_d2 = (_c2 = response.nextStep.questions) == null ? void 0 : _c2.elements) == null ? void 0 : _d2[0]) == null ? void 0 : _e.question;
        const currentQuestion = (_f = response.nextStep.currentQuestion) == null ? void 0 : _f.question;
        const texts = [];
        if (elementQuestion) texts.push(__(elementQuestion, "beyondseo"));
        if (currentQuestion) texts.push(__(currentQuestion, "beyondseo"));
        setStep((prev) => prev + 1);
        setCurrentIncompleteStep(response.nextStep);
        setCurrentStepContent({
          texts: texts.length > 0 ? texts : [__("Please proceed with the next step", "beyondseo")],
          loadingTexts: nextStepLoadingTexts
        });
      } else if (response.step) {
        if ((_g = response.step) == null ? void 0 : _g.isFinalStep) {
          setStep(8);
          return;
        }
        const currentStepLoadingTexts = getLoadingTextsForStep(response.step.id || 1);
        setCurrentIncompleteStep(response.step);
        const elementQuestion = (_j = (_i = (_h = response.step.questions) == null ? void 0 : _h.elements) == null ? void 0 : _i[0]) == null ? void 0 : _j.question;
        const currentQuestion = (_k = response.step.currentQuestion) == null ? void 0 : _k.question;
        const texts = [];
        if (elementQuestion) texts.push(__(elementQuestion, "beyondseo"));
        if (currentQuestion && currentQuestion !== elementQuestion) texts.push(__(currentQuestion, "beyondseo"));
        setCurrentStepContent({
          texts: texts.length > 0 ? texts : ["Please provide your input"],
          loadingTexts: currentStepLoadingTexts
        });
      }
    } catch (error2) {
      setShowLoadingBadge(false);
      throw error2;
    }
  };
  const handleFinish = async () => {
    var _a2;
    try {
      setShowOnboardingStep(false);
      setShowThankYouScreen(true);
      thankYouStartTimeRef.current = Date.now();
      const response = await dispatch(
        OnboardingStore.postApiOnboardingSubmitOnboardingThunk({
          requestBody: null,
          // @ts-ignore
          queryParams: { noCache: true, debug: 1 }
        })
      ).unwrap();
      const timeElapsed = Date.now() - (thankYouStartTimeRef.current || 0);
      const remainingTime = Math.max(0, MIN_THANK_YOU_DISPLAY_TIME - timeElapsed);
      if (remainingTime > 0) {
        await new Promise((resolve) => setTimeout(resolve, remainingTime));
      }
      window.location.href = `${((_a2 = window.rankingCoachReactData) == null ? void 0 : _a2.adminurl) || "admin.php"}?page=rankingcoach-main`;
    } catch (error2) {
      setShowThankYouScreen(false);
      setShowOnboardingStep(true);
      setStep(8);
      setErrorMessage((error2 == null ? void 0 : error2.message) || __("An unexpected error occurred", "beyondseo"));
      setErrorDetails((error2 == null ? void 0 : error2.content) || error2);
      setShowErrorModal(true);
    }
  };
  const handleCancel = () => {
    var _a2, _b2;
    window.location.href = ((_b2 = (_a2 = window.rankingCoachReactData) == null ? void 0 : _a2.adminurl) == null ? void 0 : _b2.replace("admin.php", "")) || "index.php";
  };
  const containerClass = Kt(
    welcomeStyles.onboardingWelcomeContainer,
    showOnboardingStep || showThankYouScreen ? welcomeStyles.step2 : "",
    isFinalStep && !showThankYouScreen ? welcomeStyles.finalStep : ""
  );
  reactExports.useEffect(() => {
    if (showThankYouScreen) {
      const totalTextAnimationTime = TEXT_THANK_YOU_ANIMATION_WAIT_BETWEEN_COMPONENTS + TEXT_THANK_YOU_ANIMATION_DURATION * THANK_YOU_TEXTS.length + 1e3;
      const timer = setTimeout(() => {
        setThankYouTextRendered(true);
      }, totalTextAnimationTime);
      return () => clearTimeout(timer);
    }
  }, [showThankYouScreen]);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: containerClass, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: isOnboardingStarted || showThankYouScreen, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StripeGradientBackgroundAnimation, {}) }),
    !showThankYouScreen && step !== 1 && !isFinalStep && /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { color: "white", className: welcomeStyles.topRightLink, onClick: () => setStep(8), children: __("Skip to manual input", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      AIOrb,
      {
        state: AIOrbStatus.Waiting,
        fullScreen: false,
        size: AIOrbSize.Small,
        className: Kt(!isOnboardingStarted ? welcomeStyles.loaderComponent : welcomeStyles.hidden)
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(Va, { if: !isOnboardingStarted && !showThankYouScreen, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        q8e,
        {
          waitBetweenComponents: TEXT_WELCOME_ANIMATION_WAIT_BETWEEN_COMPONENTS,
          duration: TEXT_WELCOME_ANIMATION_ANIMATION_DURATION,
          children: WELCOME_TEXTS.map((txt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            nr,
            {
              className: welcomeStyles.sliderTextStep1,
              type: Er.heading2,
              fontWeight: si.bold,
              textAlign: "center",
              animateWords: {
                animation: "fade-up",
                duration: TEXT_FADE_ANIMATION_DURATION,
                delay: 30
              },
              children: __(txt, "beyondseo")
            },
            __(txt, "beyondseo")
          ))
        },
        "step1"
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(welcomeStyles.buttonComponent, welcomeStyles.fadeInButton), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.large,
          iconRight: Ln.arrowRight,
          onClick: handleStartClick,
          children: __("Start", "beyondseo")
        }
      ) })
    ] }),
    showOnboardingStep && !isFinalStep && currentStepIndex >= 0 && !showThankYouScreen && /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingStep, { ...currentStepContent, onSubmit: handleStepSubmit, showLoadingBadge }),
    isFinalStep && !showThankYouScreen && /* @__PURE__ */ jsxRuntimeExports.jsx(
      OnboardingSummary,
      {
        onFinish: handleFinish,
        onCancel: handleCancel,
        websiteDescription,
        onDescriptionChange: setWebsiteDescription
      }
    ),
    showThankYouScreen && /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt(welcomeStyles.sliderComponent, welcomeStyles.thankYouContainer), children: [
      thankYouTextRendered && /* @__PURE__ */ jsxRuntimeExports.jsx(
        "img",
        {
          src: whiteLoadingAnimation,
          alt: __("Loading...", "beyondseo"),
          className: Kt(welcomeStyles.loadingAnimation, welcomeStyles.fadeIn)
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        q8e,
        {
          waitBetweenComponents: TEXT_THANK_YOU_ANIMATION_WAIT_BETWEEN_COMPONENTS,
          duration: TEXT_THANK_YOU_ANIMATION_DURATION,
          children: THANK_YOU_TEXTS.map((txt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            nr,
            {
              className: welcomeStyles.sliderTextStep2,
              type: Er.heading2,
              fontWeight: si.bold,
              textAlign: "center",
              color: "white",
              animateWords: {
                animation: "fade-up",
                duration: TEXT_FADE_ANIMATION_DURATION,
                delay: 30
              },
              children: __(txt, "beyondseo")
            },
            __(txt, "beyondseo")
          ))
        },
        "thank-you"
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: welcomeStyles.loadingStatusWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        LoadingStatusBadge,
        {
          loading: true,
          texts: THANK_YOU_LOADING_TEXTS.map((text2) => __(text2, "beyondseo")),
          intervalDuration: 1e4
        }
      ) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: Kt(welcomeStyles.cancelComponent), children: step === 1 && !showThankYouScreen && /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { color: "black", className: welcomeStyles.cancelLink, onClick: () => window.location.href = "/wp-admin", children: __("Cancel", "beyondseo") }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ErrorModal,
      {
        isOpen: showErrorModal,
        onClose: () => setShowErrorModal(false),
        errorMessage: errorMessage || __("Something went wrong from our side, please try again!", "beyondseo"),
        errorDetails
      }
    )
  ] });
};
const OnboardingPlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$p.onboardingContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: welcomeStyles.onboardingWelcomeContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: welcomeStyles.loaderComponent, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "120px", borderRadius: "50%" }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: welcomeStyles.sliderComponent, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "50%", height: "48px", className: welcomeStyles.sliderTextPlaceholder }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Z8e,
        {
          width: "70%",
          height: "48px",
          className: welcomeStyles.sliderTextPlaceholder,
          style: { marginTop: "16px" }
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Z8e,
        {
          width: "40%",
          height: "48px",
          className: welcomeStyles.sliderTextPlaceholder,
          style: { marginTop: "16px" }
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: welcomeStyles.buttonComponent, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "160px", height: "48px", borderRadius: "24px" }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: welcomeStyles.cancelComponent, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "60px", height: "20px" }) })
  ] }) });
};
const container = "OnboardingPreloader-module__container___QbNKh";
const innerContainer = "OnboardingPreloader-module__innerContainer___dcy8O";
const orb = "OnboardingPreloader-module__orb___-y2a5";
const textContainer$1 = "OnboardingPreloader-module__textContainer___1yea-";
const mainText = "OnboardingPreloader-module__mainText___4D-PL";
const ellipsis = "OnboardingPreloader-module__ellipsis___iroa3";
const progress = "OnboardingPreloader-module__progress___dm13H";
const progressFill$1 = "OnboardingPreloader-module__progressFill___6yE-5";
const styles$h = {
  container,
  innerContainer,
  orb,
  textContainer: textContainer$1,
  mainText,
  ellipsis,
  progress,
  progressFill: progressFill$1
};
const OnboardingPreloader = () => {
  const reducedMotion = reactExports.useMemo(() => {
    if (typeof window === "undefined") return false;
    return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
  }, []);
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    Li,
    {
      className: styles$h.container,
      children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$h.innerContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: styles$h.orb, width: "80", height: "80", viewBox: "0 0 80 80", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("radialGradient", { id: "circleGrad", cx: "40", cy: "40", r: "40", fx: "40", fy: "40", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "0", stopColor: "#4F46E5", children: !reducedMotion && /* @__PURE__ */ jsxRuntimeExports.jsx(
              "animate",
              {
                attributeName: "stopColor",
                values: "#4F46E5;#3B82F6;#10B981;#4F46E5",
                dur: "2s",
                repeatCount: "indefinite"
              }
            ) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "1", stopColor: "#3B82F6", children: !reducedMotion && /* @__PURE__ */ jsxRuntimeExports.jsx(
              "animate",
              {
                attributeName: "stopColor",
                values: "#3B82F6;#10B981;#4F46E5;#3B82F6",
                dur: "2s",
                repeatCount: "indefinite"
              }
            ) })
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "40", cy: "40", r: "38", fill: "url(#circleGrad)", children: !reducedMotion && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "animate",
            {
              attributeName: "r",
              values: "38;40;38",
              dur: "1.5s",
              repeatCount: "indefinite"
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "40", cy: "40", r: "45", fill: "none", stroke: "#E0E7FF", strokeWidth: "2", children: !reducedMotion && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "animateTransform",
            {
              attributeName: "transform",
              type: "rotate",
              from: "0 40 40",
              to: "360 40 40",
              dur: "2s",
              repeatCount: "indefinite"
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$h.textContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$h.mainText, children: [
          "We prepare your onboarding",
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$h.ellipsis, children: "..." })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$h.progress, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$h.progressFill }) })
      ] })
    }
  );
};
const Onboarding = ({ isPluginLoading }) => {
  const dispatch = useAppDispatch();
  const { plugin } = useSelector((state) => state.app);
  const pluginData = plugin == null ? void 0 : plugin.pluginData;
  const initialSettings = (pluginData == null ? void 0 : pluginData.settings) || {};
  const [isStepsLoading, setIsStepsLoading] = reactExports.useState(true);
  const [currentStep, setCurrentStep] = reactExports.useState(null);
  const [showErrorModal, setShowErrorModal] = reactExports.useState(false);
  const [isCompleted, setIsCompleted] = reactExports.useState(false);
  const [skipWelcomeScreen, setSkipWelcomeScreen] = reactExports.useState(false);
  reactExports.useEffect(() => {
    if (!isPluginLoading) {
      loadInitialState();
    }
  }, [isPluginLoading]);
  const loadInitialState = async () => {
    var _a2;
    setIsStepsLoading(true);
    try {
      const urlParams = new URLSearchParams(window.location.search);
      const shouldSkipWelcome = urlParams.get("skipWelcomeScreen") === "1";
      setSkipWelcomeScreen(shouldSkipWelcome);
      const queryParams = { noCache: true, debug: true };
      if (shouldSkipWelcome) {
        queryParams.skipWelcomeScreen = 1;
      }
      if (initialSettings == null ? void 0 : initialSettings.allow_auto_onboarding) {
        await dispatch(
          OnboardingStore.postApiOnboardingExtractAutoThunk({
            requestBody: null,
            queryParams: { noCache: true, debug: true }
          })
        );
      }
      const response = await dispatch(
        OnboardingStore.postApiOnboardingGenerateStepsThunk({
          requestBody: null,
          queryParams
        })
      ).unwrap();
      if ((_a2 = response == null ? void 0 : response.steps) == null ? void 0 : _a2.elements) {
        const finalStep2 = response.steps.elements.find(
          (element) => element.isFinalStep === true && element.completed === true
        );
        if (finalStep2) {
          setIsCompleted(true);
        }
      }
    } catch (error2) {
      setShowErrorModal(true);
    } finally {
      setIsStepsLoading(false);
    }
  };
  if (isPluginLoading || isStepsLoading) {
    if (initialSettings == null ? void 0 : initialSettings.allow_auto_onboarding) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingPreloader, {});
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingPlaceholder, {});
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$p.onboardingContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      OnboardingWelcome,
      {
        isCompleted,
        currentStep: currentStep ?? void 0,
        skipWelcomeScreen
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ErrorModal,
      {
        isOpen: showErrorModal,
        onClose: () => setShowErrorModal(false),
        errorMessage: __("Something went wrong from our side, please try again!", "beyondseo")
      }
    )
  ] });
};
const registrationContainer$1 = "Registration-module__registration-container___-RnXz";
const headerSection$1 = "Registration-module__header-section___8NGNO";
const logo$2 = "Registration-module__logo___xr96X";
const topDivider$1 = "Registration-module__top-divider___Izzwo";
const registrationContent$1 = "Registration-module__registration-content___HbyB0";
const authTitle = "Registration-module__auth-title___QLxxC";
const authDescription = "Registration-module__auth-description___fnoXq";
const emailInput = "Registration-module__email-input___699sM";
const countrySelect = "Registration-module__country-select___klpoO";
const termsContainer = "Registration-module__terms-container___7nAQT";
const termsText = "Registration-module__terms-text___S600P";
const bottomDivider$1 = "Registration-module__bottom-divider___8uQPp";
const footerSection$1 = "Registration-module__footer-section___W3FQT";
const registrationResetButton = "Registration-module__registrationResetButton___k7GIl";
const verifyTitle = "Registration-module__verifyTitle___43qwb";
const verifyImage = "Registration-module__verifyImage___KdPVX";
const verifyDescription = "Registration-module__verifyDescription___JemSm";
const styles$g = {
  registrationContainer: registrationContainer$1,
  headerSection: headerSection$1,
  logo: logo$2,
  topDivider: topDivider$1,
  registrationContent: registrationContent$1,
  authTitle,
  authDescription,
  emailInput,
  countrySelect,
  termsContainer,
  termsText,
  bottomDivider: bottomDivider$1,
  footerSection: footerSection$1,
  registrationResetButton,
  verifyTitle,
  verifyImage,
  verifyDescription
};
const emailVerifySvg = "" + new URL("assets/validate-email-illustration-BRFxnysX.svg", import.meta.url).href;
const registrationContainer = "RegistrationWelcome-module__registration-container___Gro6h";
const headerSection = "RegistrationWelcome-module__header-section___7Po0A";
const logo$1 = "RegistrationWelcome-module__logo___3t8AM";
const topDivider = "RegistrationWelcome-module__top-divider___S5Ojt";
const registrationContent = "RegistrationWelcome-module__registration-content___ghQXA";
const welcomeTitle = "RegistrationWelcome-module__welcome-title___O5MvP";
const optionsList = "RegistrationWelcome-module__options-list___Ts-2u";
const optionCard = "RegistrationWelcome-module__option-card___dSjbd";
const optionTitle = "RegistrationWelcome-module__option-title___lhblq";
const optionDescription = "RegistrationWelcome-module__option-description___m71TK";
const bottomDivider = "RegistrationWelcome-module__bottom-divider___Dk1lC";
const footerSection = "RegistrationWelcome-module__footer-section___gkuSi";
const styles$f = {
  registrationContainer,
  headerSection,
  logo: logo$1,
  topDivider,
  registrationContent,
  welcomeTitle,
  optionsList,
  optionCard,
  optionTitle,
  optionDescription,
  bottomDivider,
  footerSection
};
const ACTIVATION_URL = `${((_b = window.rankingCoachReactData) == null ? void 0 : _b.adminurl) || "admin.php"}?page=rankingcoach-activation`;
const RegistrationWelcome = ({ onContinueWithEmail, showEmail, showActivation }) => {
  const handleActivationCode = () => {
    window.location.href = ACTIVATION_URL;
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$f.registrationContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$f.headerSection, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$f.logo, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: beyondSEOLogo, alt: "Beyond SEO Logo" }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$f.topDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$f.registrationContent, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.heading1,
          fontWeight: si.bold,
          className: styles$f.welcomeTitle,
          children: __("Welcome, how would you like to get started?", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$f.optionsList, children: [
        showEmail && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: styles$f.optionCard, onClick: onContinueWithEmail, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.bold, className: styles$f.optionTitle, children: __("Continue with email", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$f.optionDescription, children: __("Log in or create a free account to start using the plugin.", "beyondseo") })
        ] }),
        showActivation && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: styles$f.optionCard, onClick: handleActivationCode, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.bold, className: styles$f.optionTitle, children: __("Use an activation code", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$f.optionDescription, children: __("Already received a code by email? Enter it here to activate your plugin.", "beyondseo") })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$f.bottomDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$f.footerSection })
  ] });
};
const STORAGE_KEYS = {
  EMAIL: "registrationEmail",
  COUNTRY: "registrationCountry",
  POLL_TOKEN: "registrationPollToken",
  ACCOUNT_STATUS: "registrationAccountStatus",
  REGISTRATION_STATUS: "registrationRegistrationStatus"
};
const ONBOARDING_URL = `${((_c = window.rankingCoachReactData) == null ? void 0 : _c.adminurl) || "admin.php"}?page=rankingcoach-onboarding&skipWelcomeScreen=1`;
const POLLING_INTERVAL = 5e3;
const VERIFICATION_TIME_WINDOW = 60;
const Registration = ({ isPluginLoading }) => {
  var _a2, _b2, _c2, _d2, _e, _f;
  const dispatch = useAppDispatch();
  const [showWelcome, setShowWelcome] = reactExports.useState(true);
  const [isLoading, setIsLoading] = reactExports.useState(Boolean(isPluginLoading));
  const [showErrorModal, setShowErrorModal] = reactExports.useState(false);
  const [errorDetails, setErrorDetails] = reactExports.useState(null);
  const [country, setCountry] = reactExports.useState(() => sessionStorage.getItem(STORAGE_KEYS.COUNTRY) || "DE");
  const [isVerificationPhase, setIsVerificationPhase] = reactExports.useState(false);
  const [isButtonLoading, setIsButtonLoading] = reactExports.useState(false);
  const [isPolling, setIsPolling] = reactExports.useState(false);
  const [pollToken, setPollToken] = reactExports.useState(() => localStorage.getItem(STORAGE_KEYS.POLL_TOKEN) || null);
  const [accountStatus, setAccountStatus] = reactExports.useState(() => localStorage.getItem(STORAGE_KEYS.ACCOUNT_STATUS) || null);
  const [registrationStatus, setRegistrationStatus] = reactExports.useState(() => localStorage.getItem(STORAGE_KEYS.REGISTRATION_STATUS) || null);
  const [termsAccepted, setTermsAccepted] = reactExports.useState(false);
  const pollingIntervalRef = reactExports.useRef(null);
  const pollTokenRef = reactExports.useRef(null);
  const accountStatusRef = reactExports.useRef(null);
  const registrationStatusRef = reactExports.useRef(null);
  const finalizingRef = reactExports.useRef(false);
  const { plugin } = useSelector((state) => state.app);
  const adminEmail = ((_c2 = (_b2 = (_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.website) == null ? void 0 : _b2.settings) == null ? void 0 : _c2.adminEmail) || "";
  const allowedCountries = ((_f = (_e = (_d2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _d2.website) == null ? void 0 : _e.settings) == null ? void 0 : _f.allowedCountries) || {};
  const [email, setEmail] = reactExports.useState(() => localStorage.getItem(STORAGE_KEYS.EMAIL) || adminEmail);
  reactExports.useEffect(() => {
    pollTokenRef.current = pollToken;
    accountStatusRef.current = accountStatus;
    registrationStatusRef.current = registrationStatus;
  }, [pollToken, accountStatus, registrationStatus]);
  const isWithinTimeWindow = reactExports.useCallback((timestamp, windowSeconds = VERIFICATION_TIME_WINDOW) => {
    const currentTimestamp = Math.floor(Date.now() / 1e3);
    return currentTimestamp - timestamp <= windowSeconds;
  }, []);
  const shouldFinalizeRegistration = reactExports.useCallback((registrationStatus2, verificationSetting) => {
    if (registrationStatus2 === "new_account") {
      return (verificationSetting == null ? void 0 : verificationSetting.emailValidated) && (verificationSetting == null ? void 0 : verificationSetting.validatedAt) && isWithinTimeWindow(verificationSetting.validatedAt);
    } else if (registrationStatus2 === "existing_account") {
      return (verificationSetting == null ? void 0 : verificationSetting.accountClaimed) && (verificationSetting == null ? void 0 : verificationSetting.claimedAt) && isWithinTimeWindow(verificationSetting.claimedAt);
    }
    return false;
  }, [isWithinTimeWindow]);
  const clearLocalStorageVerification = reactExports.useCallback(() => {
    localStorage.removeItem(STORAGE_KEYS.POLL_TOKEN);
    localStorage.removeItem(STORAGE_KEYS.ACCOUNT_STATUS);
    localStorage.removeItem(STORAGE_KEYS.REGISTRATION_STATUS);
    localStorage.removeItem(STORAGE_KEYS.EMAIL);
  }, []);
  const loadInitialState = reactExports.useCallback(async () => {
    const savedPollToken = localStorage.getItem(STORAGE_KEYS.POLL_TOKEN);
    const savedAccountStatus = localStorage.getItem(STORAGE_KEYS.ACCOUNT_STATUS);
    const savedRegistrationStatus = localStorage.getItem(STORAGE_KEYS.REGISTRATION_STATUS);
    const savedEmail = localStorage.getItem(STORAGE_KEYS.EMAIL);
    if (savedPollToken && savedAccountStatus && savedRegistrationStatus && savedEmail) {
      try {
        const result = await dispatch(
          SeoStore.getRankingcoachSeoAccountVerificationStatusThunk({
            pollToken: savedPollToken,
            status: savedAccountStatus
          })
        ).unwrap();
        if (!result) {
          clearLocalStorageVerification();
          return;
        }
        if (result.pollToken && result.pollToken !== savedPollToken) {
          localStorage.setItem(STORAGE_KEYS.POLL_TOKEN, result.pollToken);
          setPollToken(result.pollToken);
        }
        if (result.emailChecked) {
          const verificationSetting = result.verificationStatusSetting;
          if (shouldFinalizeRegistration(savedRegistrationStatus, verificationSetting)) {
            await finalizeRegistration(result.pollToken || savedPollToken);
            return;
          }
        }
        setShowWelcome(false);
        setIsVerificationPhase(true);
      } catch (error2) {
        console.error("[REGISTRATION] Error loading initial state:", error2);
        clearLocalStorageVerification();
      }
    }
  }, [dispatch, shouldFinalizeRegistration, clearLocalStorageVerification]);
  const finalizeRegistration = reactExports.useCallback(async (pollToken2) => {
    if (finalizingRef.current) {
      console.log("[REGISTRATION] Finalization already in progress, skipping");
      return false;
    }
    finalizingRef.current = true;
    setIsButtonLoading(true);
    stopPolling();
    try {
      const finalizeResult = await dispatch(
        SeoStore.postRankingcoachSeoAccountFinalizeRegisterThunk({
          requestBody: null,
          queryParams: {
            email: email.trim(),
            country,
            type: "direct",
            pollToken: pollToken2
          }
        })
      ).unwrap();
      if (!finalizeResult || !finalizeResult.ok && !finalizeResult.success) {
        console.error("[REGISTRATION] Finalize registration failed - invalid response:", finalizeResult);
        setErrorDetails(finalizeResult);
        setShowErrorModal(true);
        setIsButtonLoading(false);
        return false;
      }
      clearLocalStorageVerification();
      window.location.href = ONBOARDING_URL;
      return true;
    } catch (error2) {
      console.error("[REGISTRATION] Finalize registration error:", error2);
      setErrorDetails(error2);
      setShowErrorModal(true);
      setIsButtonLoading(false);
      return false;
    } finally {
      finalizingRef.current = false;
    }
  }, [dispatch, email, country, clearLocalStorageVerification]);
  reactExports.useEffect(() => {
    setIsLoading(Boolean(isPluginLoading));
  }, [isPluginLoading]);
  reactExports.useEffect(() => {
    if (!isPluginLoading) {
      loadInitialState();
    }
  }, [isPluginLoading, loadInitialState]);
  reactExports.useEffect(() => {
    return () => {
      if (pollingIntervalRef.current) {
        clearInterval(pollingIntervalRef.current);
      }
    };
  }, []);
  reactExports.useEffect(() => {
    if (isVerificationPhase && pollToken && accountStatus) {
      startPolling();
    } else {
      stopPolling();
    }
    return () => {
      stopPolling();
    };
  }, [isVerificationPhase]);
  const stopPolling = () => {
    if (pollingIntervalRef.current) {
      clearInterval(pollingIntervalRef.current);
      pollingIntervalRef.current = null;
      setIsPolling(false);
      console.log("[REGISTRATION] Polling stopped");
    }
  };
  const checkVerificationStatus = async () => {
    const currentPollToken = pollTokenRef.current;
    const currentAccountStatus = accountStatusRef.current;
    const currentRegistrationStatus = registrationStatusRef.current;
    if (!currentPollToken || !currentAccountStatus) {
      console.error("[REGISTRATION] Missing pollToken or status for verification check");
      return;
    }
    try {
      console.log("[REGISTRATION] Checking verification status with pollToken:", currentPollToken);
      const result = await dispatch(
        SeoStore.getRankingcoachSeoAccountVerificationStatusThunk({
          pollToken: currentPollToken,
          status: currentAccountStatus
        })
      ).unwrap();
      console.log("[REGISTRATION] Verification status result:", result);
      if (!result) {
        console.error("[REGISTRATION] Invalid verification status response");
        stopPolling();
        setErrorDetails("Invalid verification status response");
        setShowErrorModal(true);
        return;
      }
      if (result.pollToken && result.pollToken !== currentPollToken) {
        console.log("[REGISTRATION] Updating pollToken:", result.pollToken);
        setPollToken(result.pollToken);
        localStorage.setItem(STORAGE_KEYS.POLL_TOKEN, result.pollToken);
      }
      if (result.emailChecked) {
        const verificationSetting = result.verificationStatusSetting;
        if (shouldFinalizeRegistration(currentRegistrationStatus, verificationSetting)) {
          console.log("[REGISTRATION] All conditions met! Attempting finalize registration...");
          await finalizeRegistration(result.pollToken || currentPollToken);
        }
      }
    } catch (error2) {
      console.error("[REGISTRATION] Verification status check error:", error2);
      stopPolling();
      setErrorDetails(error2);
      setShowErrorModal(true);
    }
  };
  const startPolling = () => {
    stopPolling();
    setIsPolling(true);
    checkVerificationStatus();
    pollingIntervalRef.current = setInterval(() => {
      checkVerificationStatus();
    }, POLLING_INTERVAL);
  };
  const handleEmailChange = reactExports.useCallback((e2) => {
    const newEmail = e2.target.value;
    setEmail(newEmail);
  }, []);
  const handleCountryChange = reactExports.useCallback((e2) => {
    const newCountry = e2.target.value;
    setCountry(newCountry);
    sessionStorage.setItem(STORAGE_KEYS.COUNTRY, newCountry);
  }, []);
  const handleTermsChange = reactExports.useCallback((e2) => {
    setTermsAccepted(e2.target.checked);
  }, []);
  const handleNext = async () => {
    if (termsAccepted) {
      try {
        await seoStore.postRankingcoachSeoSettings({
          settings: { beyondseo_comm_opt_in: true }
        }).toPromise();
      } catch (_) {
      }
    }
    if (isVerificationPhase) {
      await handleVerify();
    } else {
      await handleRegister();
    }
  };
  const handleRegister = async () => {
    if (!email.trim()) {
      return;
    }
    setIsButtonLoading(true);
    try {
      const result = await dispatch(
        SeoStore.postRankingcoachSeoAccountRegisterThunk({
          requestBody: null,
          queryParams: {
            email: email.trim(),
            country,
            type: "direct",
            marketingConsent: true
          }
        })
      ).unwrap();
      if (!result || !result.pollToken || !result.status) {
        console.error("[REGISTRATION] Invalid registration response:", result);
        setErrorDetails(result);
        setShowErrorModal(true);
        setIsButtonLoading(false);
        return;
      }
      setPollToken(result.pollToken);
      setRegistrationStatus(result.status);
      console.log("[REGISTRATION] Stored registration status (new_account/existing_account):", result.status);
      setAccountStatus(result.status);
      localStorage.setItem(STORAGE_KEYS.POLL_TOKEN, result.pollToken);
      localStorage.setItem(STORAGE_KEYS.ACCOUNT_STATUS, result.status);
      localStorage.setItem(STORAGE_KEYS.REGISTRATION_STATUS, result.status);
      localStorage.setItem(STORAGE_KEYS.EMAIL, email.trim());
      setIsVerificationPhase(true);
    } catch (error2) {
      console.error("[REGISTRATION] Error:", error2);
      setErrorDetails(error2);
      setShowErrorModal(true);
    } finally {
      setIsButtonLoading(false);
    }
  };
  const handleRegistrationReset = () => {
    stopPolling();
    setIsButtonLoading(false);
    setPollToken(null);
    setAccountStatus(null);
    setRegistrationStatus(null);
    setIsVerificationPhase(false);
    clearLocalStorageVerification();
  };
  const handleVerify = async () => {
    if (!pollToken || !accountStatus) {
      console.error("[REGISTRATION] Missing pollToken or status for manual verification");
      return;
    }
    setIsButtonLoading(true);
    try {
      const result = await dispatch(
        SeoStore.getRankingcoachSeoAccountVerificationStatusThunk({
          pollToken,
          status: accountStatus
        })
      ).unwrap();
      if (!result) {
        console.error("[REGISTRATION] Invalid manual verification response");
        setErrorDetails("Invalid manual verification response");
        setShowErrorModal(true);
        setIsButtonLoading(false);
        return;
      }
      if (result.pollToken && result.pollToken !== pollToken) {
        setPollToken(result.pollToken);
        localStorage.setItem(STORAGE_KEYS.POLL_TOKEN, result.pollToken);
      }
      if (result.emailChecked) {
        const verificationSetting = result.verificationStatusSetting;
        if (shouldFinalizeRegistration(registrationStatus, verificationSetting)) {
          const success2 = await finalizeRegistration(result.pollToken || pollToken);
          if (success2) {
            return;
          }
        }
      }
    } catch (error2) {
      console.error("[REGISTRATION] Manual verification error:", error2);
      setErrorDetails(error2);
      setShowErrorModal(true);
    } finally {
      setIsButtonLoading(false);
    }
  };
  const countryOptions = reactExports.useMemo(() => {
    if (allowedCountries && typeof allowedCountries === "object" && Object.keys(allowedCountries).length > 0) {
      return Object.entries(allowedCountries).map(([code, name]) => ({
        key: code,
        value: code,
        title: String(name)
      }));
    }
    return [];
  }, [allowedCountries]);
  if (showWelcome) {
    const rcData = window.rankingCoachReactData;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      RegistrationWelcome,
      {
        onContinueWithEmail: () => setShowWelcome(false),
        showEmail: (rcData == null ? void 0 : rcData.registrationShowEmail) !== "false",
        showActivation: (rcData == null ? void 0 : rcData.registrationShowActivation) !== "false"
      }
    );
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$g.registrationContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.headerSection, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.logo, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: beyondSEOLogo, alt: "Beyond SEO Logo" }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.topDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.registrationContent, children: !isVerificationPhase ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.heading1,
          fontWeight: si.bold,
          className: styles$g.authTitle,
          children: __("Sign in or create an account", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.text,
          className: styles$g.authDescription,
          children: __("Enter your email and we'll get you set up.", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        L8e,
        {
          label: __("Email", "beyondseo"),
          required: true,
          value: email,
          onChange: handleEmailChange,
          placeholder: __("Enter your email", "beyondseo"),
          type: "email",
          className: styles$g.emailInput
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        B8e,
        {
          label: __("Country", "beyondseo"),
          labelType: "outer",
          required: true,
          value: country,
          onChange: handleCountryChange,
          options: countryOptions,
          className: styles$g.countrySelect
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.termsContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        r9e,
        {
          checked: termsAccepted,
          onChange: handleTermsChange,
          label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$g.termsText, children: [
            __("I agree that the BeyondSEO plugin may create/authenticate my account and communicate with rankingCoach servers to provide its services. I have read and accept the ", "beyondseo"),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { href: "https://www.rankingcoach.com/en-us/privacy-policy", target: "_blank", rel: "noopener noreferrer", children: __("Privacy Policy", "beyondseo") }),
            __(" and the ", "beyondseo"),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Ske, { href: "https://www.rankingcoach.com/en-us/terms-and-conditions", target: "_blank", rel: "noopener noreferrer", children: __("Terms and Conditions", "beyondseo") }),
            "."
          ] })
        }
      ) })
    ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.heading2,
          fontWeight: si.bold,
          className: styles$g.verifyTitle,
          children: registrationStatus === "existing_account" ? __("Claim your existing account", "beyondseo") : __("Verify your email", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "img",
        {
          src: emailVerifySvg,
          alt: "Email verification",
          className: styles$g.verifyImage
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.text,
          className: styles$g.verifyDescription,
          children: registrationStatus === "existing_account" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            __("Follow the instructions in the email we've sent to ", "beyondseo"),
            /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: email }),
            __(" to claim your existing account.", "beyondseo")
          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            __("Follow the instructions in the email we've sent to this address: ", "beyondseo"),
            /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: email }),
            __(". This helps keep your account secure.", "beyondseo")
          ] })
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$g.bottomDivider }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$g.footerSection, children: [
      isVerificationPhase && /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.secondary,
          size: uf.medium,
          onClick: handleRegistrationReset,
          className: styles$g.registrationResetButton,
          children: __("Change Email address", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.medium,
          iconRight: !isVerificationPhase ? Ln.arrowRight : void 0,
          onClick: handleNext,
          disabled: isLoading || isButtonLoading || isPolling || !isVerificationPhase && (!email.trim() || !termsAccepted),
          isLoading: isButtonLoading || isPolling,
          children: isVerificationPhase ? __("Verify", "beyondseo") : __("Next", "beyondseo")
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ErrorModal,
      {
        isOpen: showErrorModal,
        onClose: () => setShowErrorModal(false),
        errorMessage: __("Something went wrong from our side, please try again!", "beyondseo"),
        errorDetails,
        primaryButtonText: __("Try again", "beyondseo"),
        onPrimaryAction: () => {
          setShowErrorModal(false);
          handleRegistrationReset();
        }
      }
    )
  ] });
};
const seoOptimiserContainer = "SEOOptimiser-module__seo-optimiser-container___N-HLL";
const transitioning = "SEOOptimiser-module__transitioning___L3kh-";
const small = "SEOOptimiser-module__small___h1DZt";
const header$1 = "SEOOptimiser-module__header___z-ebf";
const expanded = "SEOOptimiser-module__expanded___zcUuF";
const logo = "SEOOptimiser-module__logo___lcs2k";
const logoImage = "SEOOptimiser-module__logo-image___y1kKo";
const title$7 = "SEOOptimiser-module__title___Brw5c";
const close = "SEOOptimiser-module__close___ZgxrJ";
const content = "SEOOptimiser-module__content___mLS3y";
const loadingOptimizationContainer = "SEOOptimiser-module__loading-optimization-container___Rzpbs";
const success = "SEOOptimiser-module__success___mhy6o";
const loadingImage = "SEOOptimiser-module__loading-image___oMM9B";
const contentText = "SEOOptimiser-module__content-text___i4Crh";
const contentTitle = "SEOOptimiser-module__content-title___VJ3nY";
const contentSubtitle = "SEOOptimiser-module__content-subtitle___vvJBd";
const noKeywordsWrapper = "SEOOptimiser-module__noKeywordsWrapper___x3wtA";
const styles$e = {
  seoOptimiserContainer,
  transitioning,
  small,
  header: header$1,
  expanded,
  logo,
  logoImage,
  title: title$7,
  close,
  content,
  loadingOptimizationContainer,
  success,
  loadingImage,
  contentText,
  contentTitle,
  contentSubtitle,
  noKeywordsWrapper
};
const rcLogo = "data:image/svg+xml,%3csvg%20width='12'%20height='14'%20viewBox='0%200%2012%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='rc%20Logo'%3e%3cpath%20id='Symbol'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.62116%205.63399L5.81815%200.838967C5.87458%200.774674%205.99092%200.711635%206.07484%200.699008C6.07484%200.699008%209.60356%200.134258%2010.1189%200.722527C10.634%201.3107%2010.6438%201.96721%2010.4739%202.3521C10.3239%202.69168%209.01921%205.54869%208.69827%206.26419C9.53783%206.86374%2010.3021%207.84943%2010.4739%208.91252C10.8297%2011.1119%209.8554%2014.0476%205.08623%2013.7435C3.36995%2013.7435%200.374282%2013.1304%200.0392115%2010.5024C-0.295365%207.87449%201.62116%205.63399%201.62116%205.63399ZM7.72819%2012.8146C8.55574%2012.8146%2010.0774%2011.6674%2010.0234%209.46998C9.96929%207.27322%208.02905%206.37715%208.02905%206.37715L10.0482%201.94202C10.0829%201.86477%2010.1013%201.71615%2010.0866%201.63341C10.0575%201.47236%209.95554%201.19939%209.86822%201.07687C9.75045%200.911203%209.50449%200.856397%209.36698%201.06955C9.36698%201.06955%205.52638%206.82658%205.52638%209.55176C5.52648%2012.2771%206.90074%2012.8146%207.72819%2012.8146ZM6.69468%201.99235H5.9424C5.85966%201.99235%205.83306%201.94224%205.8825%201.88043L6.22168%201.45636C6.25411%201.41582%206.3253%201.3778%206.37989%201.37244C6.37989%201.37244%206.65773%201.34405%207.03402%201.31541C7.41031%201.28676%207.9548%201.30924%207.9548%201.30924C8.06469%201.31239%208.10669%201.3862%208.04897%201.47352L7.73985%201.9412C7.7112%201.98455%207.64333%202.01818%207.58848%202.01598C7.58848%202.01598%206.82408%201.99235%206.69468%201.99235Z'%20fill='%238699B6'/%3e%3c/g%3e%3c/svg%3e";
const nm = "Main Scene";
const ddd = 0;
const h = 600;
const w = 600;
const meta = { "g": "@lottiefiles/creator 1.42.2" };
const layers = [{ "ty": 4, "nm": "Rectangle", "sr": 1, "st": 0, "op": 3600, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [0, 0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 1, "k": [{ "o": { "x": 0.275, "y": 0 }, "i": { "x": 0.376, "y": 1 }, "s": [300, 485.5, 0], "t": 0 }, { "o": { "x": 0.632, "y": 0 }, "i": { "x": 0.725, "y": 1 }, "s": [300, 125.5, 0], "t": 110 }, { "s": [300, 485.5, 0], "t": 220 }], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle", "ix": 1, "cix": 2, "np": 2, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "Rectangle Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 4.5, "ix": 4 }, "s": { "a": 0, "k": [300, 9], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.1882, 0.498, 0.9098], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [0, 0], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 1 }, { "ty": 4, "nm": "bottom-grad", "sr": 1, "st": 0, "op": 3600, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [0, 0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, -100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 1, "k": [{ "o": { "x": 0.274, "y": 0 }, "i": { "x": 0.374, "y": 1 }, "s": [300, 463.5, 0], "t": 1 }, { "o": { "x": 0.621, "y": 0 }, "i": { "x": 0.726, "y": 1 }, "s": [300, 146.5, 0], "t": 111 }, { "s": [300, 506.5, 0], "t": 221 }], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [0], "t": 120 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [40], "t": 152 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [40], "t": 199 }, { "s": [0], "t": 218 }], "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle", "ix": 1, "cix": 2, "np": 2, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "Rectangle Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 0, "ix": 4 }, "s": { "a": 0, "k": [300, 45], "ix": 2 } }, { "ty": "gf", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - G-Fill", "nm": "Gradient Fill 1", "e": { "a": 0, "k": [0, 22.5], "ix": 6 }, "g": { "p": 3, "k": { "a": 0, "k": [0, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 0.5, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 1, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 0, 0, 0.5, 0.2, 1, 0.4], "ix": 9 } }, "t": 1, "a": { "a": 0, "k": 0 }, "h": { "a": 0, "k": 0 }, "s": { "a": 0, "k": [0, -22.5], "ix": 5 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 10 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [0, 0], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 2 }, { "ty": 4, "nm": "top-grad", "sr": 1, "st": 0, "op": 3600, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [0, 0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 1, "k": [{ "o": { "x": 0.271, "y": 0 }, "i": { "x": 0.376, "y": 1 }, "s": [300, 463.5, 0], "t": 1 }, { "o": { "x": 0.632, "y": 0 }, "i": { "x": 0.725, "y": 1 }, "s": [300, 103.5, 0], "t": 111 }, { "s": [300, 463.5, 0], "t": 221 }], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 1, "k": [{ "o": { "x": 0.167, "y": 0 }, "i": { "x": 0.833, "y": 1 }, "s": [0], "t": 0 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [40], "t": 14 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [40], "t": 89 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.833, "y": 1 }, "s": [0], "t": 108 }, { "s": [0], "t": 221 }], "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle", "ix": 1, "cix": 2, "np": 2, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "Rectangle Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 0, "ix": 4 }, "s": { "a": 0, "k": [300, 45], "ix": 2 } }, { "ty": "gf", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - G-Fill", "nm": "Gradient Fill 1", "e": { "a": 0, "k": [0, 22.5], "ix": 6 }, "g": { "p": 3, "k": { "a": 0, "k": [0, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 0.5, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 1, 0.09411764705882353, 0.4392156862745098, 0.8431372549019608, 0, 0, 0.5, 0.2, 1, 0.4], "ix": 9 } }, "t": 1, "a": { "a": 0, "k": 0 }, "h": { "a": 0, "k": 0 }, "s": { "a": 0, "k": [0, -22.5], "ix": 5 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 10 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [0, 0], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 3 }, { "ty": 0, "nm": "full", "sr": 1, "st": 0, "op": 3600, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": true, "ao": 0, "ks": { "a": { "a": 0, "k": [300, 300, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [300, 300, 0], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "masksProperties": [{ "nm": "Mask 1", "inv": false, "mode": "i", "x": { "a": 0, "k": 0, "ix": 4 }, "o": { "a": 0, "k": 100, "ix": 3 }, "pt": { "a": 1, "k": [{ "o": { "x": 0.272, "y": 0 }, "i": { "x": 0.364, "y": 1 }, "s": [{ "c": true, "i": [[0, 0], [0, 0], [0, 0], [0, 0]], "o": [[0, 0], [0, 0], [0, 0], [0, 0]], "v": [[448.801, 109], [153, 109], [153, 479.957], [448.801, 479.957]] }], "t": 0 }, { "o": { "x": 0.631, "y": 0 }, "i": { "x": 0.73, "y": 1 }, "s": [{ "c": true, "i": [[0, 0], [0, 0], [0, 0], [0, 0]], "o": [[0, 0], [0, 0], [0, 0], [0, 0]], "v": [[448.801, 109], [153, 109], [153, 129.957], [448.801, 129.957]] }], "t": 110 }, { "s": [{ "c": true, "i": [[0, 0], [0, 0], [0, 0], [0, 0]], "o": [[0, 0], [0, 0], [0, 0], [0, 0]], "v": [[448.801, 109], [153, 109], [153, 479.957], [448.801, 479.957]] }], "t": 220 }], "ix": 1 } }], "w": 600, "h": 600, "refId": "comp_0_e389e4b1-d16e-4f5e-b824-10f7e0cc9f99", "ind": 4 }, { "ty": 0, "nm": "trans", "sr": 1, "st": 0, "op": 3600, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [300, 300, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [300, 300, 0], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "w": 600, "h": 600, "refId": "comp_1_8869a999-9f0e-4b88-9d73-d1c18895e771", "ind": 5 }, { "ty": 4, "nm": "Ellipse 1", "sr": 1, "st": 0, "op": 227, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [0, 0] }, "s": { "a": 0, "k": [143.2636, 143.2636] }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [300, 300] }, "r": { "a": 0, "k": 0 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100 } }, "shapes": [{ "ty": "el", "bm": 0, "hd": false, "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0] }, "s": { "a": 0, "k": [340, 340] } }, { "ty": "fl", "bm": 0, "hd": false, "nm": "Fill", "c": { "a": 0, "k": [0.9412, 0.9569, 0.9608] }, "r": 1, "o": { "a": 0, "k": 100 } }], "ind": 6 }];
const v = "5.7.0";
const fr = 60;
const op = 227;
const ip = 0;
const assets = /* @__PURE__ */ JSON.parse('[{"nm":"Scene","id":"comp_0_e389e4b1-d16e-4f5e-b824-10f7e0cc9f99","layers":[{"ty":4,"nm":"Rectangle Copy 10","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 9","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 8","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 7","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy 6","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]},{"nm":"Scene_1","id":"comp_1_8869a999-9f0e-4b88-9d73-d1c18895e771","layers":[{"ty":4,"nm":"Rectangle Copy 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 5","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 4","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1882,0.498,0.9098],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":60,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]}]');
const loadingOptimization = {
  nm,
  ddd,
  h,
  w,
  meta,
  layers,
  v,
  fr,
  op,
  ip,
  assets
};
const loadingOptimization$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  assets,
  ddd,
  default: loadingOptimization,
  fr,
  h,
  ip,
  layers,
  meta,
  nm,
  op,
  v,
  w
}, Symbol.toStringTag, { value: "Module" }));
var SEOOptimiserSizeType = /* @__PURE__ */ ((SEOOptimiserSizeType2) => {
  SEOOptimiserSizeType2["Small"] = "small";
  SEOOptimiserSizeType2["Expanded"] = "expanded";
  return SEOOptimiserSizeType2;
})(SEOOptimiserSizeType || {});
const SizeTypeEnum = SEOOptimiserSizeType;
const SEOOptimiser = (props) => {
  var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
  const {
    plugin,
    hasValidSEOKeywords,
    postSeoOptimiserLoading,
    postSeoOptimiserKeywords = void 0,
    primaryKeyword,
    additionalKeywords
  } = useSelector((state) => state.app);
  const { setPostSeoOptimiserLoading, setHasValidSEOKeywords } = AppSlice;
  const dispatch = useAppDispatch();
  const onboarding = ((_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.setupData) ? (_b2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _b2.setupData : void 0;
  const internalOnboarding = !!(onboarding == null ? void 0 : onboarding.isPluginOnboarded);
  if (!internalOnboarding) {
    return null;
  }
  const {
    headerText,
    loadingText,
    seoScore = void 0,
    noKeywordsText,
    noKeywordsDescription,
    closeButtonText,
    useKwdButtonText,
    skipKwdButtonText,
    onCloseFunction,
    onUseKeywordsFunction
  } = props;
  const [sizeType, setSizeType] = reactExports.useState(SizeTypeEnum.Small);
  const [title2, setTitle] = reactExports.useState("");
  const [subtitle2, setSubtitle] = reactExports.useState("");
  const [isTransitioning, setIsTransitioning] = reactExports.useState(false);
  const isSmall = sizeType === SizeTypeEnum.Small;
  const isExpanded = sizeType === SizeTypeEnum.Expanded;
  const debouncedSizeChange = (newSize) => {
    if (isTransitioning || sizeType === newSize) return;
    setIsTransitioning(true);
    setSizeType(newSize);
    setTimeout(() => {
      setIsTransitioning(false);
    }, 650);
  };
  const clickHandler = () => {
    if (isSmall && !isTransitioning) {
      debouncedSizeChange(SizeTypeEnum.Expanded);
    }
  };
  reactExports.useEffect(() => {
    if (hasValidSEOKeywords != void 0) {
      if (!hasValidSEOKeywords) {
        setTitle(noKeywordsText);
        setSubtitle(noKeywordsDescription);
        debouncedSizeChange(SizeTypeEnum.Expanded);
      }
      if (hasValidSEOKeywords) {
        setTitle("");
        setSubtitle("");
        debouncedSizeChange(SizeTypeEnum.Expanded);
      }
    }
  }, [postSeoOptimiserLoading === false]);
  reactExports.useEffect(() => {
    const handleKeywordsUpdated = () => {
      if (isExpanded && (primaryKeyword || additionalKeywords && additionalKeywords.length > 0)) {
        onCloseFunction && onCloseFunction();
      }
    };
    document.addEventListener("rankingcoach-keywords-updated", handleKeywordsUpdated);
    return () => {
      document.removeEventListener("rankingcoach-keywords-updated", handleKeywordsUpdated);
    };
  }, [isExpanded, primaryKeyword, additionalKeywords, onCloseFunction]);
  reactExports.useEffect(() => {
    setTitle(loadingText);
    {
      dispatch(setPostSeoOptimiserLoading(false));
      dispatch(setHasValidSEOKeywords(false));
      return;
    }
  }, [seoScore == void 0, plugin == null ? void 0 : plugin.rcSubscriptionName]);
  const notSuccess = hasValidSEOKeywords === false && postSeoOptimiserLoading === false;
  const withSuccess = hasValidSEOKeywords === true && postSeoOptimiserLoading === false;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    Va,
    {
      if: seoScore == void 0 && ((_d2 = (_c2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _c2.setupData) == null ? void 0 : _d2.isPluginOnboarded) == true && ((_f = (_e = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _e.setupData) == null ? void 0 : _f.isApplicationOnboarded) == true,
      children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Li,
        {
          className: Kt(
            styles$e.seoOptimiserContainer,
            isExpanded ? styles$e.expanded : styles$e.small,
            isTransitioning ? styles$e.transitioning : ""
          ),
          onClick: clickHandler,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$e.header, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$e.logo, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: styles$e.logoImage, src: rcLogo, alt: "svg-image" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textCaption, color: "--n400", className: Kt(styles$e.title, S8e.mr3), children: headerText })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$e.close, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: isExpanded && postSeoOptimiserLoading === true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                gh,
                {
                  type: Vo.secondary,
                  iconLeft: Ln.close,
                  size: uf.small,
                  color: "--n400",
                  onClick: () => {
                    debouncedSizeChange(SizeTypeEnum.Small);
                  }
                }
              ) }) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$e.content), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Li,
              {
                testId: "loading-optimization-testId",
                className: Kt(
                  styles$e.loadingOptimizationContainer,
                  withSuccess ? styles$e.success : "",
                  S8e.dFlex,
                  S8e.justifyContentCenter,
                  S8e.alignContentCenter,
                  isExpanded ? styles$e.expanded : styles$e.small
                ),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { className: styles$e.contentText, fontWeight: si.medium, fontSize: isExpanded ? 19 : 0, children: title2 }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { className: styles$e.contentText, fontWeight: si.regular, fontSize: isExpanded ? 16 : 0, children: subtitle2 }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: notSuccess, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    gh,
                    {
                      className: Kt(S8e.mb1, S8e.mt2),
                      size: uf.small,
                      onClick: () => {
                        onCloseFunction && onCloseFunction();
                      },
                      children: closeButtonText
                    }
                  ) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Va, { if: withSuccess, children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$e.noKeywordsWrapper, S8e.mb3, S8e.textAlignCenter), children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        nr,
                        {
                          className: Kt(styles$e.contentTitle, S8e.mb2),
                          fontWeight: si.medium,
                          fontSize: 22,
                          children: "This page doesn't have keywords"
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { className: styles$e.contentSubtitle, fontWeight: si.regular, fontSize: 16, children: __(
                        "Using the right keywords can significantly increase your website`s visibility, making it easier for people to find it.",
                        "beyondseo"
                      ) })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      nr,
                      {
                        type: Er.heading3,
                        fontWeight: si.medium,
                        fontSize: 18,
                        className: Kt(styles$e.contentText, S8e.mb4),
                        children: "We've picked the most effective keywords"
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      nr,
                      {
                        fontSize: 16,
                        className: Kt(styles$e.contentText, S8e.mb3),
                        type: Er.heading3,
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Primary keyword: " }),
                          ((_g = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.primaryKeywordFromExisting) == null ? void 0 : _g.name) || ((_h = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.primaryKeywordFromContent) == null ? void 0 : _h.name)
                        ]
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      Va,
                      {
                        if: !!(((_j = (_i = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.additionalKeywordsFromExisting) == null ? void 0 : _i.elements) == null ? void 0 : _j.length) ?? false) || !!(((_l = (_k = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.additionalKeywordsFromContent) == null ? void 0 : _k.elements) == null ? void 0 : _l.length) ?? false),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                          nr,
                          {
                            fontWeight: si.regular,
                            fontSize: 16,
                            className: Kt(styles$e.contentText, S8e.mb1),
                            children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Additional keywords: " }),
                              (_n = (_m = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.additionalKeywordsFromExisting) == null ? void 0 : _m.elements) == null ? void 0 : _n.map((keyword) => {
                                return keyword.name + ", ";
                              }),
                              (_p = (_o = postSeoOptimiserKeywords == null ? void 0 : postSeoOptimiserKeywords.additionalKeywordsFromContent) == null ? void 0 : _o.elements) == null ? void 0 : _p.map((keyword) => {
                                return keyword.name + ", ";
                              })
                            ]
                          }
                        )
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      Li,
                      {
                        className: Kt(
                          S8e.dFlex,
                          S8e.justifyContentCenter,
                          S8e.alignItemsCenter,
                          S8e.gap9
                        ),
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            gh,
                            {
                              size: uf.small,
                              className: Kt(S8e.mb1, S8e.mt2),
                              onClick: () => {
                                if (onUseKeywordsFunction && postSeoOptimiserKeywords) {
                                  onUseKeywordsFunction(postSeoOptimiserKeywords);
                                } else {
                                  onCloseFunction && onCloseFunction();
                                }
                              },
                              children: useKwdButtonText
                            }
                          ),
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            gh,
                            {
                              size: uf.small,
                              type: Vo.secondary,
                              className: Kt(S8e.mb1, S8e.mt2),
                              onClick: () => {
                                onCloseFunction && onCloseFunction();
                              },
                              children: skipKwdButtonText
                            }
                          )
                        ]
                      }
                    )
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: postSeoOptimiserLoading === true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Li,
                    {
                      testId: "loading-document-testId",
                      className: Kt(styles$e.loadingImage, isExpanded ? S8e.mt1 : ""),
                      onClick: clickHandler,
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx($8e, { src: loadingOptimization$1 })
                    }
                  ) })
                ]
              }
            ) })
          ]
        }
      )
    }
  );
};
const DonutChart = ({ percentage, label, textPosition = "rigth" }) => {
  const radius = 40;
  const stroke = 10;
  const normalizedRadius = radius - stroke / 2;
  const circumference = normalizedRadius * 2 * Math.PI;
  const strokeDashoffset = circumference - percentage / 100 * circumference;
  const color = percentage < 30 ? "#e74c3c" : "#2ecc71";
  const flexDirection = textPosition === "rigth" ? "row" : "column";
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px", flexDirection }, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { height: radius * 2, width: radius * 2, style: { transform: "rotate(-90deg)" }, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { stroke: "#e6e6e6", fill: "transparent", strokeWidth: stroke, r: normalizedRadius, cx: radius, cy: radius }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "circle",
        {
          stroke: color,
          fill: "transparent",
          strokeWidth: stroke,
          strokeLinecap: "round",
          strokeDasharray: `${circumference} ${circumference}`,
          style: {
            strokeDashoffset,
            transition: "stroke-dashoffset 0.5s ease"
          },
          r: normalizedRadius,
          cx: radius,
          cy: radius
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "text",
        {
          x: "50%",
          y: "50%",
          textAnchor: "middle",
          dy: ".3em",
          fill: "#2c3e50",
          fontSize: "16px",
          fontWeight: 700,
          transform: `rotate(90, ${radius}, ${radius})`,
          children: [
            percentage,
            "%"
          ]
        }
      )
    ] }),
    label && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: "bold", color: "#2c3e50" }, children: label })
  ] });
};
const SeoScoreCellPlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { type: tb.rectangle, width: 140, height: 32 });
};
const cellWidgetSuccessURL = "data:image/svg+xml,%3csvg%20width='16'%20height='20'%20viewBox='0%200%2016%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.45%2018C7.3968%2018%207.34309%2017.9922%207.29053%2017.9754C7.05843%2017.9022%206.89997%2017.6802%206.89997%2017.4286V11.7144H3.04998C2.84703%2011.7144%202.66056%2011.5984%202.56494%2011.4125C2.46931%2011.2266%202.48002%2011.0013%202.5923%2010.8261L8.09228%202.25479C8.22643%202.04487%208.47797%201.9512%208.70933%202.02494C8.94156%202.09775%209.10002%202.31989%209.10002%202.57166V8.28584H12.95C13.153%208.28584%2013.3394%208.40183%2013.4351%208.58771C13.5307%208.77358%2013.52%208.99892%2013.4077%209.17416L7.90771%2017.7454C7.80387%2017.9071%207.63043%2018%207.45%2018Z'%20fill='%233C28CC'/%3e%3cpath%20d='M2.56494%2011.4125L1.67572%2011.87C1.41734%2011.3678%201.44532%2010.7626%201.75032%2010.2866L1.75067%2010.286L7.24964%201.71631C7.24988%201.71594%207.25011%201.71557%207.25035%201.71521C7.61989%201.138%208.33472%200.855976%209.013%201.07216L8.70933%202.02494L9.00848%201.07073C9.67853%201.2808%2010.1%201.90502%2010.1%202.57166L2.56494%2011.4125ZM2.56494%2011.4125L1.67572%2011.87C1.93639%2012.3767%202.45875%2012.7144%203.04998%2012.7144H5.89997V17.4286C5.89997%2018.0953%206.32127%2018.7176%206.98839%2018.9287L2.56494%2011.4125Z'%20stroke='%238377E4'%20stroke-opacity='0.2'%20stroke-width='2'/%3e%3c/svg%3e";
const rcIconManageProjectsURL = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%200H2C0.9%200%200%200.900001%200%202V14C0%2015.1%200.9%2016%202%2016H4V14H2V4H14V5H16V2C16%200.900001%2015.1%200%2014%200ZM13.9333%208.48333L15.1%207.31667L13.6833%205.9L12.5167%207.06667C12.2%206.88333%2011.8667%206.73333%2011.5%206.63333V5H9.5V6.63333C9.13333%206.73333%208.8%206.88333%208.48333%207.06667L7.31667%205.9L5.9%207.31667L7.06667%208.48333C6.88333%208.8%206.73333%209.13333%206.63333%209.5H5V11.5H6.63333C6.73333%2011.8667%206.88333%2012.2%207.06667%2012.5167L5.9%2013.6833L7.31667%2015.1L8.48333%2013.9333C8.8%2014.1167%209.13333%2014.2667%209.5%2014.3667V16H11.5V14.3667C11.8667%2014.2667%2012.2%2014.1167%2012.5167%2013.9333L13.6833%2015.1L15.1%2013.6833L13.9333%2012.5167C14.1167%2012.2%2014.2667%2011.8667%2014.35%2011.5H16V9.5H14.35C14.2667%209.13333%2014.1167%208.8%2013.9333%208.48333ZM10.5%2012.5C9.4%2012.5%208.5%2011.6%208.5%2010.5C8.5%209.4%209.4%208.5%2010.5%208.5C11.6%208.5%2012.5%209.4%2012.5%2010.5C12.5%2011.6%2011.6%2012.5%2010.5%2012.5Z'%20fill='%23003B99'/%3e%3c/svg%3e";
const calculateScore = (rawScore) => {
  return rawScore > 1 ? Math.round(rawScore) : Math.round(rawScore * 100);
};
const getBadgeConfig = (hasIssues, issuesCount) => {
  return {
    badgeClass: "success",
    badgeIcon: cellWidgetSuccessURL,
    badgeValue: issuesCount === 0 ? "-" : issuesCount.toString()
  };
};
const SeoScoreCell = ({ postId, onDataLoaded }) => {
  const dispatch = useAppDispatch();
  const [show, setShow] = reactExports.useState(false);
  const [score2, setScore] = reactExports.useState(0);
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [badgeClass, setBadgeClass] = reactExports.useState(
    "success"
    /* Success */
  );
  const [badgeIcon, setBadgeIcon] = reactExports.useState(cellWidgetSuccessURL);
  const [badgeValue, setBadgeValue] = reactExports.useState("0");
  const [iconUrl, setIconUrl] = reactExports.useState(rcIconManageProjectsURL);
  const [recommendations2, setRecommendations] = reactExports.useState([]);
  let issueLabel = __("Issues", "beyondseo");
  let recommendationLabel = __("Recommendations", "beyondseo");
  let optimisationLabel = __("Optimisation level", "beyondseo");
  const isValidAnalysisResult = (result) => {
    var _a2;
    return result && typeof result.score === "number" && ((_a2 = result.contexts) == null ? void 0 : _a2.elements) !== void 0 && Array.isArray(result.contexts.elements);
  };
  const processAnalysisResult = (analysisResult) => {
    var _a2;
    const calculatedScore = calculateScore(analysisResult.score);
    setScore(calculatedScore);
    const suggestions = ((_a2 = analysisResult.topSuggestions) == null ? void 0 : _a2.elements) || [];
    setRecommendations(suggestions);
    const hasIssues = suggestions.length > 0;
    const badgeConfig = getBadgeConfig(hasIssues, suggestions.length);
    setBadgeClass(badgeConfig.badgeClass);
    setBadgeIcon(badgeConfig.badgeIcon);
    setBadgeValue(badgeConfig.badgeValue);
  };
  const useSeoAnalysis = (postId2) => {
    const fetchSeoData2 = async () => {
      try {
        setIsLoading(true);
        const apiResponse = await dispatch(
          OptimiserStore.getApiOptimiserByPostIdThunk({
            postId: postId2,
            queryParams: { noCache: true }
          })
        );
        if (apiResponse == null ? void 0 : apiResponse.payload) {
          const analysisResult = apiResponse.payload.analyseResult;
          if (isValidAnalysisResult(analysisResult)) {
            const calculatedScore = calculateScore(analysisResult.score);
            if (calculatedScore === 0) {
              try {
                const postApiResponse = await dispatch(
                  OptimiserStore.postApiOptimiserByPostIdThunk({
                    postId: postId2,
                    requestBody: null,
                    queryParams: { noCache: true }
                  })
                );
                if (postApiResponse == null ? void 0 : postApiResponse.payload) {
                  const postAnalysisResult = postApiResponse.payload.analyseResult;
                  if (isValidAnalysisResult(postAnalysisResult)) {
                    const postScore = calculateScore(postAnalysisResult.score);
                    if (postScore !== 0) {
                      processAnalysisResult(postAnalysisResult);
                      return;
                    }
                  }
                }
              } catch (postError) {
              }
            }
            processAnalysisResult(analysisResult);
          } else {
            setScore(0);
            const defaultBadgeConfig = getBadgeConfig(false, 0);
            setBadgeClass(defaultBadgeConfig.badgeClass);
            setBadgeValue(defaultBadgeConfig.badgeValue);
            setRecommendations([]);
          }
        }
      } catch (error2) {
        setScore(0);
        const errorBadgeConfig = getBadgeConfig(false, 0);
        setBadgeClass(errorBadgeConfig.badgeClass);
        setBadgeValue(errorBadgeConfig.badgeValue);
        setRecommendations([]);
      } finally {
        setIsLoading(false);
      }
    };
    return { fetchSeoData: fetchSeoData2 };
  };
  const { fetchSeoData } = useSeoAnalysis(postId);
  reactExports.useEffect(() => {
    fetchSeoData();
  }, [postId]);
  reactExports.useEffect(() => {
    if (!isLoading && onDataLoaded) {
      onDataLoaded();
    }
  }, [isLoading, onDataLoaded]);
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(SeoScoreCellPlaceholder, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "div",
    {
      className: styles$r.seoScoreCellWrapper,
      onMouseEnter: () => setShow(true),
      onMouseLeave: () => setShow(false),
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$r.assistantCell, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$r.scoreContainer, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconUrl, alt: __("rC Icon", "beyondseo"), className: styles$r.icon }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { fontSize: 14, children: [
              score2,
              " / 100"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt(styles$r.issuesContainer, styles$r[badgeClass]), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: badgeIcon, alt: __("Status Icon", "beyondseo"), width: "16", height: "16" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { fontSize: 14, fontWeight: si.medium, children: badgeValue })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: show, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$r.popup, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            DonutChart,
            {
              percentage: Number(score2),
              label: optimisationLabel,
              textPosition: "bottom"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: styles$r.popupInner, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$r.recommendations, children: recommendations2.slice(0, 4).map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
              O8e,
              {
                icon: Ln.check,
                iconColor: "#379683",
                verticalAlign: "start",
                iconSize: ai.small,
                className: styles$r.iconText,
                fontWeight: si.regular,
                maxWidth: "180px",
                children: item.title
              },
              index
            )) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { className: Kt(styles$r.recomandationsCount, styles$r[badgeClass]), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: badgeIcon, alt: __("Status Icon", "beyondseo"), width: "16", height: "16" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { fontSize: 14, textWrap: "no-wrap", children: [
                badgeValue + " ",
                badgeClass === "warning" ? issueLabel : recommendationLabel
              ] })
            ] })
          ] })
        ] }) })
      ]
    }
  ) });
};
const scoreContainer = "ScoreButtonHeader-module__scoreContainer___vIzK-";
const styles$d = {
  scoreContainer
};
const rCLogoBlue = "data:image/svg+xml,%3csvg%20width='12'%20height='14'%20viewBox='0%200%2012%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='rc%20Logo'%3e%3cpath%20id='Symbol'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.62116%205.63399L5.81815%200.838967C5.87458%200.774674%205.99092%200.711635%206.07484%200.699008C6.07484%200.699008%209.60356%200.134258%2010.1189%200.722527C10.634%201.3107%2010.6438%201.96721%2010.4739%202.3521C10.3239%202.69168%209.01921%205.54869%208.69827%206.26419C9.53783%206.86374%2010.3021%207.84943%2010.4739%208.91252C10.8297%2011.1119%209.8554%2014.0476%205.08623%2013.7435C3.36995%2013.7435%200.374282%2013.1304%200.0392115%2010.5024C-0.295365%207.87449%201.62116%205.63399%201.62116%205.63399ZM7.72819%2012.8146C8.55574%2012.8146%2010.0774%2011.6674%2010.0234%209.46998C9.96929%207.27322%208.02905%206.37715%208.02905%206.37715L10.0482%201.94202C10.0829%201.86477%2010.1013%201.71615%2010.0866%201.63341C10.0575%201.47236%209.95554%201.19939%209.86822%201.07687C9.75045%200.911203%209.50449%200.856397%209.36698%201.06955C9.36698%201.06955%205.52638%206.82658%205.52638%209.55176C5.52648%2012.2771%206.90074%2012.8146%207.72819%2012.8146ZM6.69468%201.99235H5.9424C5.85966%201.99235%205.83306%201.94224%205.8825%201.88043L6.22168%201.45636C6.25411%201.41582%206.3253%201.3778%206.37989%201.37244C6.37989%201.37244%206.65773%201.34405%207.03402%201.31541C7.41031%201.28676%207.9548%201.30924%207.9548%201.30924C8.06469%201.31239%208.10669%201.3862%208.04897%201.47352L7.73985%201.9412C7.7112%201.98455%207.64333%202.01818%207.58848%202.01598C7.58848%202.01598%206.82408%201.99235%206.69468%201.99235Z'%20fill='%23003b99'/%3e%3c/g%3e%3c/svg%3e";
const ScoreButtonHeaderPlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { type: tb.rectangle, width: 90, height: 32 });
};
const ScoreButtonHeader = (props) => {
  const [score2, setScore] = reactExports.useState(null);
  const optimiserResult = useSelector((state) => state.app.optimiserResult);
  reactExports.useEffect(() => {
    if (optimiserResult && typeof optimiserResult.score === "number") {
      const rawScore = optimiserResult.score;
      const normalizedScore = rawScore > 1 ? Math.round(rawScore) : Math.round(rawScore * 100);
      setScore(normalizedScore);
    }
  }, [optimiserResult]);
  if (typeof score2 !== "number") {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreButtonHeaderPlaceholder, {});
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { id: "score-button-header", className: styles$d.scoreContainer, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: rCLogoBlue, alt: __("rC Icon", "beyondseo"), className: styles$d.icon }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { fontSize: 14, fontWeight: si.medium, children: [
      score2,
      "/100"
    ] })
  ] }) });
};
const settingsContainer = "Settings-module__settingsContainer___Gr7M6";
const wpMenuExpanded = "Settings-module__wpMenuExpanded___b0-ZY";
const wpMenuCollapsed = "Settings-module__wpMenuCollapsed___iIvHJ";
const contentArea = "Settings-module__contentArea___6GZlV";
const header = "Settings-module__header___OugXO";
const mainContent = "Settings-module__mainContent___cVslo";
const sidebar = "Settings-module__sidebar___chZZB";
const settingsTitleContainer = "Settings-module__settingsTitleContainer___z9A-K";
const menuList = "Settings-module__menuList___GttGY";
const menuItem = "Settings-module__menuItem___swQ6d";
const activeMenuItem = "Settings-module__activeMenuItem___xrd-D";
const footer = "Settings-module__footer___Wiyl3";
const footerInfoContainer = "Settings-module__footerInfoContainer___W0AtI";
const checkUpdateButton = "Settings-module__checkUpdateButton___aEW74";
const infoItem = "Settings-module__infoItem___DLbwA";
const activeSettingsTitle = "Settings-module__activeSettingsTitle___qxWW7";
const menuItemContent = "Settings-module__menuItemContent___-n8WL";
const menuItemSubtext = "Settings-module__menuItemSubtext___nd0b0";
const rssItem = "Settings-module__rssItem___aKMI1";
const styles$c = {
  settingsContainer,
  wpMenuExpanded,
  wpMenuCollapsed,
  contentArea,
  header,
  mainContent,
  sidebar,
  settingsTitleContainer,
  menuList,
  menuItem,
  activeMenuItem,
  footer,
  footerInfoContainer,
  checkUpdateButton,
  infoItem,
  activeSettingsTitle,
  menuItemContent,
  menuItemSubtext,
  rssItem
};
const title$6 = "BreadcrumbsPage-module__title___sUjrj";
const description$4 = "BreadcrumbsPage-module__description___1LlOg";
const separator$6 = "BreadcrumbsPage-module__separator___ttibu";
const switchLabel$3 = "BreadcrumbsPage-module__switchLabel___1cjJn";
const breadcrumbsSwitch = "BreadcrumbsPage-module__breadcrumbsSwitch___OA5XU";
const displayOptionsTitle$2 = "BreadcrumbsPage-module__displayOptionsTitle___F52z8";
const optionsContainer = "BreadcrumbsPage-module__optionsContainer___TX0ij";
const settingsColumn$1 = "BreadcrumbsPage-module__settingsColumn___4l1-Z";
const previewColumn = "BreadcrumbsPage-module__previewColumn___a2k8A";
const previewTitle = "BreadcrumbsPage-module__previewTitle___F9-3Y";
const homeAnchorInput = "BreadcrumbsPage-module__homeAnchorInput___yyBEr";
const advancedOptionsTitle = "BreadcrumbsPage-module__advancedOptionsTitle___kR-Fu";
const advancedInput = "BreadcrumbsPage-module__advancedInput___UvMlW";
const previewItem = "BreadcrumbsPage-module__previewItem___N9qsH";
const archive = "BreadcrumbsPage-module__archive___ppqc9";
const search = "BreadcrumbsPage-module__search___ypXMC";
const error = "BreadcrumbsPage-module__error___-5aPa";
const inputWrapper = "BreadcrumbsPage-module__inputWrapper___iWoZZ";
const buttonContainer$3 = "BreadcrumbsPage-module__buttonContainer___1XapC";
const styles$b = {
  title: title$6,
  description: description$4,
  separator: separator$6,
  switchLabel: switchLabel$3,
  breadcrumbsSwitch,
  displayOptionsTitle: displayOptionsTitle$2,
  optionsContainer,
  settingsColumn: settingsColumn$1,
  previewColumn,
  previewTitle,
  homeAnchorInput,
  advancedOptionsTitle,
  advancedInput,
  previewItem,
  archive,
  search,
  error,
  inputWrapper,
  buttonContainer: buttonContainer$3
};
const title$5 = "SeparatorSettings-module__title___0K-Go";
const separatorsContainer = "SeparatorSettings-module__separatorsContainer___rZi32";
const separator$5 = "SeparatorSettings-module__separator___z-DO0";
const selected = "SeparatorSettings-module__selected___6Ljrj";
const styles$a = {
  title: title$5,
  separatorsContainer,
  separator: separator$5,
  selected
};
const SeparatorSettings = ({ value, onChange }) => {
  const separators = {
    pipe: "|",
    dash: "-",
    en_dash: "–",
    em_dash: "—",
    dot: "·",
    colon: ":",
    bullet: "•",
    angle_double: "»",
    angle_single: "›",
    tilde: "~",
    asterisk: "*",
    plus: "+",
    slash: "/",
    backslash: "\\",
    equals: "=",
    ellipsis: "…"
  };
  const defaultSeparator = "»";
  reactExports.useEffect(() => {
    if (!value || !Object.values(separators).includes(value)) {
      onChange(defaultSeparator);
    }
  }, [value]);
  const handleSelect = (separator2) => {
    onChange(separator2);
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$a.container, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, className: styles$a.title, children: __("Separator", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$a.separatorsContainer, children: Object.entries(separators).map(([key, separator2]) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: classNames(styles$a.separator, {
          [styles$a.selected]: separator2 === value
        }),
        onClick: () => handleSelect(separator2),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { translate: false, color: separator2 === value ? "--fn-bg-cta-fg" : void 0, children: separator2 })
      },
      key
    )) })
  ] });
};
const previewContainer = "BreadcrumbPreview-module__previewContainer___EJP6R";
const link = "BreadcrumbPreview-module__link___SBgnd";
const text = "BreadcrumbPreview-module__text___4nrkn";
const separator$4 = "BreadcrumbPreview-module__separator___nLOrQ";
const prefix = "BreadcrumbPreview-module__prefix___Kl2Mh";
const styles$9 = {
  previewContainer,
  link,
  text,
  separator: separator$4,
  prefix
};
const BreadcrumbPreview = ({ items, separator: separator2, prefix: prefix2 }) => {
  const spaceStyle = {
    marginRight: "8px",
    display: "inline-block"
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$9.previewContainer, children: [
    prefix2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: spaceStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.medium, className: styles$9.prefix, children: prefix2 }) }),
    items.map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: item.isLink ? styles$9.link : styles$9.text, children: item.text }),
      index < items.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$9.separator, children: ` ${separator2} ` })
    ] }, index))
  ] });
};
const BreadcrumbsPagePlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "32px", className: styles$b.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$b.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90%", height: "20px", className: styles$b.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "95%", height: "20px", className: styles$b.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "150px", height: "24px", className: styles$b.switchLabel }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "36px", height: "20px", className: styles$b.breadcrumbsSwitch }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "180px", height: "28px", style: { marginTop: "32px", marginBottom: "16px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.optionsContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.settingsColumn, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "80px", style: { marginBottom: "24px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "180px", height: "20px", style: { marginBottom: "8px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "40px", style: { marginBottom: "24px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "160px", height: "28px", style: { marginTop: "24px", marginBottom: "16px" } }),
        [...Array(4)].map((_, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.advancedInput, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "180px", height: "20px", style: { marginBottom: "8px" } }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "40px" })
        ] }, index))
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.previewColumn, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "80px", height: "24px", className: styles$b.previewTitle }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "80%", height: "32px", style: { marginTop: "16px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "60%", height: "32px", style: { marginTop: "16px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "70%", height: "32px", style: { marginTop: "16px" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "65%", height: "32px", style: { marginTop: "16px" } })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px" }) })
  ] });
};
const defaultBreadcrumbSettings = {
  home_text: "Home",
  separator: " » ",
  enable_schema_markup: true,
  max_depth: 4,
  show_current_as_link: false,
  allow_filters: true,
  prefix: "You are here: ",
  suffix: "",
  show_on_posts: true,
  show_on_pages: true,
  show_on_search: true,
  show_on_404: true,
  show_on_archives: true,
  show_on_categories: true,
  show_on_tags: true,
  show_on_custom_post_types: true,
  show_on_taxonomies: true,
  enabled_post_types: ["post", "page"],
  enabled_taxonomies: ["category", "post_tag", "product_cat"],
  suffixes: {
    archive: "Archives for",
    search: "Search results for",
    "404": "Error 404: Page not found",
    custom_post: "Custom post type archives for",
    category: "Categories",
    taxonomy: "Taxonomy archives for"
  },
  prefixes: {
    archive: "",
    search: "",
    "404": "",
    custom_post: "",
    taxonomy: ""
  }
};
const BreadcrumbsPage = () => {
  const [breadcrumbsEnabled, setBreadcrumbsEnabled] = reactExports.useState(false);
  const [homeAnchorText, setHomeAnchorText] = reactExports.useState("");
  const [pathPrefix, setPathPrefix] = reactExports.useState("");
  const [archiveSuffix, setArchiveSuffix] = reactExports.useState("");
  const [searchSuffix, setSearchSuffix] = reactExports.useState("");
  const [errorText2, setErrorText] = reactExports.useState("");
  const [separator2, setSeparator] = reactExports.useState(defaultBreadcrumbSettings.separator);
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [isSaving, setIsSaving] = reactExports.useState(false);
  const [breadcrumbSettings, setBreadcrumbSettings] = reactExports.useState(defaultBreadcrumbSettings);
  reactExports.useEffect(() => {
    loadSettings();
  }, []);
  const loadSettings = async () => {
    var _a2, _b2, _c2, _d2;
    try {
      setIsLoading(true);
      const response = await seoStore.getRankingcoachSeoSettings({}).toPromise();
      const apiResponse = response;
      if ((_a2 = apiResponse == null ? void 0 : apiResponse.response) == null ? void 0 : _a2.settings) {
        const settings = apiResponse.response.settings;
        setBreadcrumbsEnabled(settings.enable_breadcrumbs || false);
        if (settings.breadcrumb_settings) {
          setBreadcrumbSettings({
            ...defaultBreadcrumbSettings,
            ...settings.breadcrumb_settings
          });
          setHomeAnchorText(settings.breadcrumb_settings.home_text || "");
          setPathPrefix(settings.breadcrumb_settings.prefix || "");
          setArchiveSuffix(((_b2 = settings.breadcrumb_settings.suffixes) == null ? void 0 : _b2.archive) || "");
          setSearchSuffix(((_c2 = settings.breadcrumb_settings.suffixes) == null ? void 0 : _c2.search) || "");
          setErrorText(((_d2 = settings.breadcrumb_settings.suffixes) == null ? void 0 : _d2["404"]) || "");
          setSeparator(settings.breadcrumb_settings.separator || "|");
        }
      }
    } catch (error2) {
    } finally {
      setIsLoading(false);
    }
  };
  const handleSwitchChange = async (event) => {
    const checked = event.currentTarget.checked;
    setBreadcrumbsEnabled(checked);
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_breadcrumbs: checked
        }
      }).toPromise();
    } catch (error2) {
      setBreadcrumbsEnabled(!checked);
    } finally {
      setIsSaving(false);
    }
  };
  const handleHomeAnchorChange = (event) => {
    setHomeAnchorText(event.target.value);
  };
  const handlePathPrefixChange = (event) => {
    setPathPrefix(event.target.value);
  };
  const handleArchiveSuffixChange = (event) => {
    setArchiveSuffix(event.target.value);
  };
  const handleSearchSuffixChange = (event) => {
    setSearchSuffix(event.target.value);
  };
  const handleErrorTextChange = (event) => {
    setErrorText(event.target.value);
  };
  const handleSeparatorChange = (newSeparator) => {
    setSeparator(newSeparator);
  };
  const handleSave = async () => {
    setIsSaving(true);
    try {
      const updatedSettings = {
        ...breadcrumbSettings,
        home_text: homeAnchorText,
        prefix: pathPrefix,
        separator: separator2,
        suffixes: {
          ...breadcrumbSettings.suffixes,
          archive: archiveSuffix,
          search: searchSuffix,
          "404": errorText2
        }
      };
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_breadcrumbs: breadcrumbsEnabled,
          breadcrumb_settings: updatedSettings
        }
      }).toPromise();
      setBreadcrumbSettings(updatedSettings);
    } catch (error2) {
    } finally {
      setIsSaving(false);
    }
  };
  const previewItems = [
    { text: homeAnchorText || "Home", isLink: true },
    { text: "Category", isLink: true },
    { text: "Subcategory", isLink: true },
    { text: "Article Title" }
  ];
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbsPagePlaceholder, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, className: styles$b.title, children: __("Breadcrumbs", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$b.description, children: __(
      "Show users their location on a website with clickable links to parent pages, acting as a secondary navigation tool. In our BeyondSEO plugin, customize their look to fit your site. They're auto-added to schema markup for better SEO and crawlability, no extra setup needed.",
      "beyondseo"
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.medium, className: styles$b.switchLabel, children: __("Enable breadcrumbs", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      X8e,
      {
        value: breadcrumbsEnabled,
        onChange: handleSwitchChange,
        size: "small",
        testId: `breadcrumbs-enable-switch`,
        className: styles$b.breadcrumbsSwitch,
        disabled: isSaving
      }
    ),
    breadcrumbsEnabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.textIntro,
          fontWeight: si.medium,
          className: `${styles$b.title} ${styles$b.displayOptionsTitle}`,
          children: __("Display options", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.optionsContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.settingsColumn, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(SeparatorSettings, { value: separator2, onChange: handleSeparatorChange }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              value: homeAnchorText,
              onChange: handleHomeAnchorChange,
              label: __("Anchor text for homepage", "beyondseo"),
              labelType: "outer",
              required: true,
              placeholder: __("Home", "beyondseo"),
              className: styles$b.homeAnchorInput
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            nr,
            {
              type: Er.textIntro,
              fontWeight: si.medium,
              className: `${styles$b.title} ${styles$b.advancedOptionsTitle}`,
              children: __("Advanced options", "beyondseo")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              value: pathPrefix,
              onChange: handlePathPrefixChange,
              label: __("Prefix for breadcrumb path", "beyondseo"),
              labelType: "outer",
              required: true,
              className: styles$b.advancedInput
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.advancedInput, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.inputWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              value: archiveSuffix,
              onChange: handleArchiveSuffixChange,
              label: __("Suffix for archive breadcrumbs", "beyondseo"),
              labelType: "outer",
              required: true,
              placeholder: __("Archives for", "beyondseo")
            }
          ) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.advancedInput, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.inputWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              value: searchSuffix,
              onChange: handleSearchSuffixChange,
              label: __("Suffix for search page breadcrumbs", "beyondseo"),
              labelType: "outer",
              required: true,
              placeholder: __("Search results for", "beyondseo")
            }
          ) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.advancedInput, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.inputWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              value: errorText2,
              onChange: handleErrorTextChange,
              label: __("Breadcrumbs for 404 Page", "beyondseo"),
              labelType: "outer",
              required: true,
              placeholder: __("Error 404: Page not found", "beyondseo")
            }
          ) }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.previewColumn, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, className: styles$b.previewTitle, children: __("Preview", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbPreview, { items: previewItems, separator: separator2, prefix: pathPrefix }),
          archiveSuffix && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$b.previewItem} ${styles$b.archive}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            BreadcrumbPreview,
            {
              items: [{ text: homeAnchorText || "Home", isLink: true }, { text: archiveSuffix }],
              separator: separator2,
              prefix: pathPrefix
            }
          ) }),
          searchSuffix && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$b.previewItem} ${styles$b.search}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            BreadcrumbPreview,
            {
              items: [{ text: homeAnchorText || "Home", isLink: true }, { text: searchSuffix }],
              separator: separator2,
              prefix: pathPrefix
            }
          ) }),
          errorText2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$b.previewItem} ${styles$b.error}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            BreadcrumbPreview,
            {
              items: [{ text: homeAnchorText || "Home", isLink: true }, { text: errorText2 }],
              separator: separator2,
              prefix: pathPrefix
            }
          ) })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          onClick: handleSave,
          testId: "save-breadcrumbs-settings",
          disabled: isSaving,
          isLoading: isSaving,
          children: __("Save changes", "beyondseo")
        }
      ) })
    ] })
  ] }) });
};
const title$4 = "RSSPage-module__title___dl-Vf";
const description$3 = "RSSPage-module__description___YwFwu";
const separator$3 = "RSSPage-module__separator___Qmx0v";
const switchLabel$2 = "RSSPage-module__switchLabel___gmngv";
const settingsColumn = "RSSPage-module__settingsColumn___fL3Yt";
const openRssButton = "RSSPage-module__openRssButton___uEGhz";
const rssInput = "RSSPage-module__rssInput___kIk0K";
const buttonContainer$2 = "RSSPage-module__buttonContainer___JsYIk";
const urlContainer$2 = "RSSPage-module__urlContainer___GhLqA";
const urlValue$2 = "RSSPage-module__urlValue___rtfxC";
const displayOptionsTitle$1 = "RSSPage-module__displayOptionsTitle___uUUeM";
const styles$8 = {
  title: title$4,
  description: description$3,
  separator: separator$3,
  switchLabel: switchLabel$2,
  settingsColumn,
  openRssButton,
  rssInput,
  buttonContainer: buttonContainer$2,
  urlContainer: urlContainer$2,
  urlValue: urlValue$2,
  displayOptionsTitle: displayOptionsTitle$1
};
const RSSPagePlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "80px", height: "32px", className: styles$8.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$8.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90%", height: "20px", className: styles$8.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "85%", height: "20px", className: styles$8.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$8.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$8.settingsColumn, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px", className: styles$8.openRssButton }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "240px", height: "20px", className: styles$8.rssInput }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "40px", className: styles$8.rssInput }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "240px", height: "20px", className: styles$8.rssInput }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "40px", className: styles$8.rssInput }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$8.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px" }) })
    ] })
  ] });
};
const defaultRSSSettings = {
  feeds: {
    cleanupEnable: false,
    global: true,
    globalComments: true,
    postComments: true,
    attachments: true,
    authors: true,
    search: true,
    archivesIncluded: ["post", "page", "attachment"],
    archivesAll: false,
    taxonomiesIncluded: ["category", "post_tag"],
    taxonomiesAll: false,
    atom: true,
    rdf: true,
    staticBlogPage: true,
    paginated: true
  },
  content: {
    before: "",
    after: ""
  }
};
const RSSPage = () => {
  var _a2, _b2, _c2;
  const [rssEnabled, setRssEnabled] = reactExports.useState(true);
  const [beforeContent, setBeforeContent] = reactExports.useState("");
  const [afterContent, setAfterContent] = reactExports.useState("");
  const [beforeContentError, setBeforeContentError] = reactExports.useState("");
  const [afterContentError, setAfterContentError] = reactExports.useState("");
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [isSaving, setIsSaving] = reactExports.useState(false);
  const [rssSettings, setRssSettings] = reactExports.useState({ ...defaultRSSSettings });
  const { plugin } = useSelector((state) => state.app);
  reactExports.useEffect(() => {
    loadSettings();
  }, []);
  const loadSettings = async () => {
    var _a3;
    try {
      setIsLoading(true);
      const response = await seoStore.getRankingcoachSeoSettings({}).toPromise();
      const apiResponse = response;
      if ((_a3 = apiResponse == null ? void 0 : apiResponse.response) == null ? void 0 : _a3.settings) {
        const settings = apiResponse.response.settings;
        setRssEnabled(settings.enable_rss !== void 0 ? settings.enable_rss : true);
        if (settings.rss) {
          setRssSettings(settings.rss || { ...defaultRSSSettings });
          if (settings.rss.content) {
            setBeforeContent(settings.rss.content.before || "");
            setAfterContent(settings.rss.content.after || "");
          }
        }
      }
    } catch (error2) {
    } finally {
      setIsLoading(false);
    }
  };
  const validateContent = (value) => {
    return value.length <= 255;
  };
  const handleBeforeContentChange = (event) => {
    const value = event.target.value;
    setBeforeContent(value);
    if (!validateContent(value)) {
      setBeforeContentError(__("Content exceeds maximum length of 255 characters", "beyondseo"));
    } else {
      setBeforeContentError("");
    }
  };
  const handleAfterContentChange = (event) => {
    const value = event.target.value;
    setAfterContent(value);
    if (!validateContent(value)) {
      setAfterContentError("Content exceeds maximum length of 255 characters");
    } else {
      setAfterContentError("");
    }
  };
  const handleRssToggle = async (event) => {
    const checked = event.currentTarget.checked;
    setRssEnabled(checked);
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_rss: checked
        }
      }).toPromise();
    } catch (error2) {
      setRssEnabled(!checked);
    } finally {
      setIsSaving(false);
    }
  };
  const handleOpenRSS = () => {
    var _a3, _b3, _c3;
    const homeUrl = (_c3 = (_b3 = (_a3 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a3.website) == null ? void 0 : _b3.settings) == null ? void 0 : _c3.homeUrl;
    window.open(`${homeUrl}/feed/`, "_blank");
  };
  const handleSave = async () => {
    if (!validateContent(beforeContent) || !validateContent(afterContent)) {
      return;
    }
    setIsSaving(true);
    try {
      const updatedSettings = {
        ...rssSettings,
        content: {
          ...rssSettings.content,
          before: beforeContent,
          after: afterContent
        }
      };
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_rss: rssEnabled,
          rss: updatedSettings
        }
      }).toPromise();
      setRssSettings(updatedSettings);
    } catch (error2) {
    } finally {
      setIsSaving(false);
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSSPagePlaceholder, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, className: styles$8.title, children: __("RSS", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$8.description, children: __(
      "This feature is used to automatically add content to your site's RSS feed. More specifically, it allows you to add links back to your blog and your blog posts so scrapers will automatically add these links too. This helps search engines identify you as the original source of the content.",
      "beyondseo"
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$8.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.medium, className: styles$8.switchLabel, children: __("Enable RSS", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      X8e,
      {
        value: rssEnabled,
        onChange: handleRssToggle,
        size: "small",
        testId: "rss-enable-switch",
        className: styles$8.rssSwitch,
        disabled: isSaving
      }
    ),
    rssEnabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.textIntro,
          fontWeight: si.medium,
          className: `${styles$8.title} ${styles$8.displayOptionsTitle}`,
          children: __("Options", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$8.settingsColumn, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          L8e,
          {
            value: beforeContent,
            onChange: handleBeforeContentChange,
            label: __("Content to put before each post in the feed", "beyondseo"),
            labelType: "outer",
            maxLength: 255,
            counter: true,
            required: true,
            infoText: beforeContentError,
            className: styles$8.rssInput,
            highlightLengthExceeded: beforeContent.length > 255,
            disabled: isSaving
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          L8e,
          {
            value: afterContent,
            onChange: handleAfterContentChange,
            label: __("Content to put after each post in the feed", "beyondseo"),
            labelType: "outer",
            maxLength: 255,
            counter: true,
            required: true,
            infoText: afterContentError,
            className: styles$8.rssInput,
            highlightLengthExceeded: afterContent.length > 255,
            disabled: isSaving
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$8.urlContainer, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, children: __("Your RSS feed URL:", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.text, className: styles$8.urlValue, children: [
            (_c2 = (_b2 = (_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.website) == null ? void 0 : _b2.settings) == null ? void 0 : _c2.homeUrl,
            "/feed/"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(gh, { type: Vo.secondary, onClick: handleOpenRSS, className: styles$8.openRssButton, children: __("View RSS Feed", "beyondseo") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$8.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          gh,
          {
            type: Vo.primary,
            onClick: handleSave,
            disabled: !validateContent(beforeContent) || !validateContent(afterContent) || isSaving,
            isLoading: isSaving,
            children: __("Save changes", "beyondseo")
          }
        ) })
      ] })
    ] })
  ] }) });
};
const description$2 = "SitemapPage-module__description___eHub5";
const separator$2 = "SitemapPage-module__separator___tDAhJ";
const switchLabel$1 = "SitemapPage-module__switchLabel___-Bdhd";
const buttonContainer$1 = "SitemapPage-module__buttonContainer___40r-I";
const lastUpdated$1 = "SitemapPage-module__lastUpdated___Y2HXv";
const additionalInfo$1 = "SitemapPage-module__additionalInfo___HZcMn";
const secondarySeparator$1 = "SitemapPage-module__secondarySeparator___kExC5";
const urlContainer$1 = "SitemapPage-module__urlContainer___SppxX";
const urlValue$1 = "SitemapPage-module__urlValue___nq-XI";
const title$3 = "SitemapPage-module__title___KYNqH";
const styles$7 = {
  description: description$2,
  separator: separator$2,
  switchLabel: switchLabel$1,
  buttonContainer: buttonContainer$1,
  lastUpdated: lastUpdated$1,
  additionalInfo: additionalInfo$1,
  secondarySeparator: secondarySeparator$1,
  urlContainer: urlContainer$1,
  urlValue: urlValue$1,
  title: title$3
};
const SitemapPagePlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "32px", className: styles$7.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$7.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "70%", height: "20px", className: styles$7.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$7.buttonContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "140px", height: "40px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "18px", className: styles$7.lastUpdated }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.secondarySeparator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$7.additionalInfo }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90%", height: "20px", className: styles$7.additionalInfo, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$7.urlContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "20px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "32px", className: styles$7.urlValue })
    ] })
  ] });
};
const defaultSitemapSettings = {
  enabled: true,
  includeImages: true,
  maxLinks: 1e3,
  pingGoogle: true,
  pingBing: true
};
const SitemapPage = () => {
  var _a2, _b2, _c2;
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [isSaving, setIsSaving] = reactExports.useState(false);
  const [sitemapSettings, setSitemapSettings] = reactExports.useState(defaultSitemapSettings);
  const { plugin } = useSelector((state) => state.app);
  const homeUrl = (_c2 = (_b2 = (_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.website) == null ? void 0 : _b2.settings) == null ? void 0 : _c2.homeUrl;
  reactExports.useEffect(() => {
    loadSettings();
  }, []);
  const loadSettings = async () => {
    var _a3, _b3;
    try {
      setIsLoading(true);
      const response = await seoStore.getRankingcoachSeoSettings({}).toPromise();
      const apiResponse = response;
      if ((_b3 = (_a3 = apiResponse == null ? void 0 : apiResponse.response) == null ? void 0 : _a3.settings) == null ? void 0 : _b3.sitemap) {
        const settings = apiResponse.response.settings.sitemap;
        setSitemapSettings({
          ...defaultSitemapSettings,
          ...settings
        });
      }
    } catch (error2) {
    } finally {
      setIsLoading(false);
    }
  };
  const handleSitemapToggle = async (event) => {
    const checked = event.currentTarget.checked;
    const updatedSettings = {
      ...sitemapSettings,
      enabled: checked
    };
    setSitemapSettings(updatedSettings);
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          sitemap: updatedSettings
        }
      }).toPromise();
    } catch (error2) {
      setSitemapSettings({
        ...sitemapSettings,
        enabled: !checked
      });
    } finally {
      setIsSaving(false);
    }
  };
  const handleSave = async () => {
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          sitemap: sitemapSettings
        }
      }).toPromise();
    } catch (error2) {
    } finally {
      setIsSaving(false);
    }
  };
  const handleViewSitemap = () => {
    window.open(`${homeUrl}/sitemap.xml`, "_blank");
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(SitemapPagePlaceholder, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, className: styles$7.title, children: __("Sitemap", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$7.description, children: __("Generate and manage your XML sitemap for better search engine indexing.", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.medium, className: styles$7.switchLabel, children: __("Enable sitemap", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      X8e,
      {
        value: sitemapSettings.enabled,
        onChange: handleSitemapToggle,
        size: "small",
        testId: "sitemap-enable-switch",
        className: styles$7.sitemapSwitch,
        disabled: isSaving
      }
    ),
    sitemapSettings.enabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.text, className: styles$7.lastUpdated, children: [
        __("Last updated:", "beyondseo"),
        " June 24, 2025 8:31 am"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.secondarySeparator }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$7.additionalInfo, children: __(
        "The sitemap is automatically regenerated when you publish new content. You can also manually generate it using the button above.",
        "beyondseo"
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$7.urlContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, children: __("Your sitemap URL:", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.text, className: styles$7.urlValue, children: [
          homeUrl,
          "/sitemap.xml"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(gh, { type: Vo.secondary, onClick: handleViewSitemap, children: __("View Sitemap", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          onClick: handleSave,
          testId: "save-sitemap-settings",
          disabled: isSaving,
          isLoading: isSaving,
          children: __("Save changes", "beyondseo")
        }
      ) })
    ] })
  ] }) });
};
const title$2 = "RobotsPage-module__title___0WRAy";
const switchLabel = "RobotsPage-module__switchLabel___tkobJ";
const displayOptionsTitle = "RobotsPage-module__displayOptionsTitle___w99cT";
const viewButton = "RobotsPage-module__viewButton___9fN3Y";
const description$1 = "RobotsPage-module__description___i78QT";
const separator$1 = "RobotsPage-module__separator___263ot";
const buttonContainer = "RobotsPage-module__buttonContainer___uSkdb";
const lastUpdated = "RobotsPage-module__lastUpdated___Kx2-y";
const additionalInfo = "RobotsPage-module__additionalInfo___-dhmr";
const secondarySeparator = "RobotsPage-module__secondarySeparator___z0-Jn";
const urlContainer = "RobotsPage-module__urlContainer___7w-LS";
const urlValue = "RobotsPage-module__urlValue___o5aJd";
const checkboxContainer = "RobotsPage-module__checkboxContainer___NbIJ5";
const checkboxDescription = "RobotsPage-module__checkboxDescription___VVP2Y";
const styles$6 = {
  title: title$2,
  switchLabel,
  displayOptionsTitle,
  viewButton,
  description: description$1,
  separator: separator$1,
  buttonContainer,
  lastUpdated,
  additionalInfo,
  secondarySeparator,
  urlContainer,
  urlValue,
  checkboxContainer,
  checkboxDescription
};
const RobotsPagePlaceholder = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Li, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "150px", height: "32px", className: styles$6.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$6.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "70%", height: "20px", className: styles$6.description, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$6.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$6.checkboxContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "280px", height: "24px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Z8e,
        {
          width: "90%",
          height: "16px",
          style: { marginTop: "12px", marginLeft: "28px" },
          className: styles$6.checkboxDescription
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$6.buttonContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "40px" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "18px", className: styles$6.lastUpdated }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$6.secondarySeparator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "100%", height: "20px", className: styles$6.additionalInfo }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "90%", height: "20px", className: styles$6.additionalInfo, style: { marginTop: "8px" } }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$6.urlContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "120px", height: "20px" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Z8e, { width: "200px", height: "32px", className: styles$6.urlValue })
    ] })
  ] });
};
const RobotsPage = () => {
  var _a2, _b2, _c2;
  const [robotsEnabled, setRobotsEnabled] = reactExports.useState(true);
  const [includeSitemap, setIncludeSitemap] = reactExports.useState(false);
  const [isLoading, setIsLoading] = reactExports.useState(true);
  const [isSaving, setIsSaving] = reactExports.useState(false);
  const { plugin } = useSelector((state) => state.app);
  const homeUrl = (_c2 = (_b2 = (_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.website) == null ? void 0 : _b2.settings) == null ? void 0 : _c2.homeUrl;
  reactExports.useEffect(() => {
    loadSettings();
  }, []);
  const loadSettings = async () => {
    var _a3;
    try {
      setIsLoading(true);
      const response = await seoStore.getRankingcoachSeoSettings({}).toPromise();
      const apiResponse = response;
      if ((_a3 = apiResponse == null ? void 0 : apiResponse.response) == null ? void 0 : _a3.settings) {
        const settings = apiResponse.response.settings;
        setRobotsEnabled(settings.enable_robots_txt !== void 0 ? settings.enable_robots_txt : true);
        setIncludeSitemap(settings.include_sitemap_in_robots !== void 0 ? settings.include_sitemap_in_robots : false);
      }
    } catch (error2) {
    } finally {
      setIsLoading(false);
    }
  };
  const handleRobotsToggle = async (event) => {
    const checked = event.currentTarget.checked;
    setRobotsEnabled(checked);
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_robots_txt: checked
        }
      }).toPromise();
    } catch (error2) {
      setRobotsEnabled(!checked);
    } finally {
      setIsSaving(false);
    }
  };
  const handleIncludeSitemapChange = (event) => {
    setIncludeSitemap(event.target.checked);
  };
  const handleSave = async () => {
    setIsSaving(true);
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          enable_robots_txt: robotsEnabled,
          include_sitemap_in_robots: includeSitemap
        }
      }).toPromise();
    } catch (error2) {
    } finally {
      setIsSaving(false);
    }
  };
  const handleViewRobots = () => {
    window.open(`${homeUrl}/robots.txt`, "_blank");
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(RobotsPagePlaceholder, {}) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, className: styles$6.title, children: __("Robots.txt", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$6.description, children: __("View your robots.txt file to check search engine crawling instructions.", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$6.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, fontWeight: si.medium, className: styles$6.switchLabel, children: __("Enable robots.txt", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      X8e,
      {
        value: robotsEnabled,
        onChange: handleRobotsToggle,
        size: "small",
        testId: "robots-enable-switch",
        className: styles$6.robotsSwitch,
        disabled: isSaving
      }
    ),
    robotsEnabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        nr,
        {
          type: Er.textIntro,
          fontWeight: si.medium,
          className: `${styles$6.title} ${styles$6.displayOptionsTitle}`,
          children: __("Options", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$6.checkboxContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          r9e,
          {
            checked: includeSitemap,
            onChange: handleIncludeSitemapChange,
            label: __("Include sitemap URL in robots.txt file", "beyondseo"),
            disabled: isSaving
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$6.checkboxDescription, children: __(
          "When enabled, your sitemap URL will be automatically added to your robots.txt file.",
          "beyondseo"
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$6.urlContainer, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, children: __("Your robots.txt URL:", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.text, className: styles$6.urlValue, children: [
          homeUrl,
          "/robots.txt"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(gh, { type: Vo.secondary, onClick: handleViewRobots, className: styles$6.viewButton, children: __("View Robots.txt", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$6.secondarySeparator }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$6.additionalInfo, children: __(
        "The robots.txt file tells search engines which pages or files they can or cannot request from your site.",
        "beyondseo"
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$6.buttonContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          onClick: handleSave,
          testId: "save-robots-settings",
          disabled: isSaving,
          isLoading: isSaving,
          children: __("Save changes", "beyondseo")
        }
      ) })
    ] })
  ] }) });
};
const title$1 = "GeneralSettingsPage-module__title___1ys9X";
const separator = "GeneralSettingsPage-module__separator___0G9dP";
const settingsList = "GeneralSettingsPage-module__settingsList___tbBk7";
const styles$5 = {
  title: title$1,
  separator,
  settingsList
};
const settingsRow = "SettingsRow-module__settingsRow___Zpeex";
const textContainer = "SettingsRow-module__textContainer___4TyXX";
const title = "SettingsRow-module__title___H20L8";
const description = "SettingsRow-module__description___gw2-P";
const switchContainer = "SettingsRow-module__switchContainer___UkSmx";
const styles$4 = {
  settingsRow,
  textContainer,
  title,
  description,
  switchContainer
};
const SettingsRow = ({ title: title2, description: description2, checked, onChange, testId, disabled }) => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.settingsRow, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.textContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.medium, className: styles$4.title, children: __(title2, "beyondseo") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$4.description, children: __(description2, "beyondseo") })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.switchContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X8e, { value: checked, onChange, size: "small", testId, disabled }) })
  ] });
};
const GeneralSettingsPage = () => {
  var _a2;
  const { plugin } = useSelector((state) => state.app);
  const initialSettings = ((_a2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _a2.settings) || {};
  const [settings, setSettings] = reactExports.useState(initialSettings);
  const [isSaving, setIsSaving] = reactExports.useState({});
  reactExports.useEffect(() => {
    setSettings(initialSettings);
  }, [plugin]);
  const handleSettingChange = async (key, value) => {
    setIsSaving((prev) => ({ ...prev, [key]: true }));
    setSettings((prev) => ({ ...prev, [key]: value }));
    try {
      await seoStore.postRankingcoachSeoSettings({
        settings: {
          [key]: value
        }
      }).toPromise();
    } catch (error2) {
      setSettings((prev) => ({ ...prev, [key]: !value }));
    } finally {
      setIsSaving((prev) => ({ ...prev, [key]: false }));
    }
  };
  const settingsConfig = [
    {
      key: "allow_seo_optimiser_on_saved_posts",
      title: __("Allow run score calculation on page/post save", "beyondseo"),
      description: __(
        "Enable this option to automatically run the SEO score calculation when a page or post is saved",
        "beyondseo"
      )
    },
    {
      key: "allow_sync_keywords_to_rankingcoach",
      title: __("Allow synchronisation the keywords an interval basis", "beyondseo"),
      description: __(
        "Enable this option to synchronise keywords from your WordPress site to the rC platform",
        "beyondseo"
      )
    },
    {
      key: "enable_wp_cron_service",
      title: __("Enable WP-Cron service", "beyondseo"),
      description: __("Enable this option to use the WP-Cron service for scheduling tasks", "beyondseo")
    },
    {
      key: "enable_broken_link_checker_job",
      title: __("Allow to run broken link checker an interval basis", "beyondseo"),
      description: __(
        "Enable this option to run the broken link checker job that scans your site for broken links",
        "beyondseo"
      )
    },
    {
      key: "beyondseo_comm_opt_in",
      title: __("Allow communication with rankingCoach servers", "beyondseo"),
      description: __(
        "Allow the plugin to communicate with beyondseo backend servers to provide its services. Required for account features, keyword sync, and dashboard functionality. You can withdraw consent at any time.",
        "beyondseo"
      )
    },
    {
      key: "disable_wp_heartbeat_service",
      title: __("Disable WordPress heartbeat admin-ajax service", "beyondseo"),
      description: __(
        "Enable this option to disable the WordPress heartbeat service that sends periodic AJAX requests to admin-ajax.php. This can improve performance by reducing server load",
        "beyondseo"
      )
    },
    {
      key: "open_rc_dashboard_in_new_tab",
      title: __("Open rC dashboard in new tab", "beyondseo"),
      description: __(
        "Enable this option to open the RankingCoach dashboard in a new browser tab instead of the current tab",
        "beyondseo"
      )
    }
  ];
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, className: styles$5.title, children: __("General Settings", "beyondseo") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.separator }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.settingsList, children: settingsConfig.map(({ key, title: title2, description: description2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      SettingsRow,
      {
        title: title2,
        description: description2,
        checked: !!settings[key],
        onChange: (e2) => handleSettingChange(key, e2.target.checked),
        testId: `${key}-switch`,
        disabled: isSaving[key]
      },
      key
    )) })
  ] });
};
const menuItems = [
  { id: "general", label: __("General", "beyondseo"), icon: "settings", component: GeneralSettingsPage },
  { id: "breadcrumbs", label: __("Breadcrumbs", "beyondseo"), icon: "link", component: BreadcrumbsPage },
  { id: "rss", label: __("RSS", "beyondseo"), icon: "rss", component: RSSPage, className: styles$c.rssItem, subtext: __("Really Simple Syndication", "beyondseo") },
  { id: "sitemap", label: __("Sitemap", "beyondseo"), icon: "sitemap", component: SitemapPage },
  { id: "robots", label: __("Robots.txt", "beyondseo"), icon: "robot", component: RobotsPage }
];
const Settings = () => {
  var _a2, _b2, _c2;
  const [activeItem, setActiveItem] = reactExports.useState("general");
  const [isMenuCollapsed, setIsMenuCollapsed] = reactExports.useState(false);
  const { plugin } = useSelector((state) => state.app);
  const [isAccountChecking, setIsAccountChecking] = reactExports.useState(false);
  const dispatch = useDispatch();
  const handleCheckAccount = async () => {
    try {
      setIsAccountChecking(true);
      const response = await dispatch(
        SeoStore.getRankingcoachSeoAccountDetailsThunk({})
      ).unwrap();
    } catch (error2) {
    } finally {
      setIsAccountChecking(false);
    }
  };
  const handleMenuClick = (id) => {
    setActiveItem(id);
  };
  const debounce2 = (func, delay) => {
    let timeoutId;
    return (...args) => {
      clearTimeout(timeoutId);
      timeoutId = setTimeout(() => func(...args), delay);
    };
  };
  const checkWpMenuState = reactExports.useCallback(() => {
    try {
      const adminMenu = document.getElementById("adminmenu") || document.getElementById("adminmenuwrap");
      const isMobileScreen = window.matchMedia("(max-width: 782px)").matches;
      const isSmallScreen = window.matchMedia("(max-width: 960px)").matches;
      if (isMobileScreen || isSmallScreen) {
        setIsMenuCollapsed(true);
        return;
      }
      if (adminMenu) {
        const menuRect = adminMenu.getBoundingClientRect();
        const menuWidth = menuRect.width;
        setIsMenuCollapsed(menuWidth < 50);
      } else {
        const body = document.body;
        const isCollapsed = body.classList.contains("folded") || body.classList.contains("auto-fold");
        setIsMenuCollapsed(isCollapsed);
      }
    } catch (error2) {
      setIsMenuCollapsed(false);
    }
  }, []);
  const debouncedCheckWpMenuState = reactExports.useCallback(debounce2(checkWpMenuState, 100), [checkWpMenuState]);
  reactExports.useEffect(() => {
    checkWpMenuState();
    const adminMenu = document.getElementById("adminmenu") || document.getElementById("adminmenuwrap");
    let resizeObserver = null;
    if (adminMenu && window.ResizeObserver) {
      resizeObserver = new ResizeObserver(debouncedCheckWpMenuState);
      resizeObserver.observe(adminMenu);
    }
    const bodyObserver = new MutationObserver((mutations) => {
      mutations.forEach((mutation) => {
        if (mutation.type === "attributes" && (mutation.attributeName === "class" || mutation.attributeName === "style")) {
          debouncedCheckWpMenuState();
        }
      });
    });
    bodyObserver.observe(document.body, {
      attributes: true,
      attributeFilter: ["class", "style"]
    });
    const adminmenuwrap = document.getElementById("adminmenuwrap");
    if (adminmenuwrap) {
      bodyObserver.observe(adminmenuwrap, {
        attributes: true,
        childList: true,
        subtree: true
      });
    }
    window.addEventListener("resize", debouncedCheckWpMenuState);
    document.addEventListener("click", (event) => {
      const target = event.target;
      if (target && (target.id === "collapse-menu" || target.closest("#collapse-menu") || target.classList.contains("collapse-button") || target.closest(".collapse-button"))) {
        setTimeout(checkWpMenuState, 300);
      }
    });
    const intervalCheck = setInterval(debouncedCheckWpMenuState, 2e3);
    return () => {
      if (resizeObserver) {
        resizeObserver.disconnect();
      }
      bodyObserver.disconnect();
      window.removeEventListener("resize", debouncedCheckWpMenuState);
      clearInterval(intervalCheck);
    };
  }, [checkWpMenuState, debouncedCheckWpMenuState]);
  const ActiveComponent = (_a2 = menuItems.find((item) => item.id === activeItem)) == null ? void 0 : _a2.component;
  const isActiveItemComingSoon = (_b2 = menuItems.find((item) => item.id === activeItem)) == null ? void 0 : _b2.comingSoon;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${styles$c.settingsContainer} ${isMenuCollapsed ? styles$c.wpMenuCollapsed : styles$c.wpMenuExpanded}`, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("header", { className: styles$c.header }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.mainContent, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { className: styles$c.sidebar, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            onClick: () => handleMenuClick("general"),
            className: `${styles$c.settingsTitleContainer} ${activeItem === "general" ? styles$c.activeSettingsTitle : ""}`,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              O8e,
              {
                icon: Ln.settings,
                fontWeight: si.bold,
                iconSize: ai.large,
                verticalAlign: "center",
                children: __("Settings", "beyondseo")
              }
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$c.menuList, children: menuItems.map(
          (item) => item.id !== "general" && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "li",
            {
              className: `${styles$c.menuItem} ${activeItem === item.id ? styles$c.activeMenuItem : ""} ${item.className || ""}`,
              onClick: () => handleMenuClick(item.id),
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.menuItemContent, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { children: __(item.label, "beyondseo") }),
                item.subtext && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { className: styles$c.menuItemSubtext, children: __(item.subtext, "beyondseo") })
              ] })
            },
            item.id
          )
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("main", { className: styles$c.contentArea, children: ActiveComponent && /* @__PURE__ */ jsxRuntimeExports.jsx(ActiveComponent, { comingSoon: isActiveItemComingSoon }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("footer", { className: styles$c.footer, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$c.footerInfoContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => !isAccountChecking && handleCheckAccount(),
          disabled: isAccountChecking,
          className: styles$c.checkUpdateButton,
          children: isAccountChecking ? __("Checking…", "beyondseo") : __("Check my account", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(nr, { type: Er.textHelp, className: styles$c.infoItem, children: [
        __("Plugin version:", "beyondseo"),
        " ",
        ((_c2 = plugin == null ? void 0 : plugin.pluginData) == null ? void 0 : _c2.version) || "1.1.15"
      ] })
    ] }) })
  ] });
};
const upsellPage = "Upsell-module__upsellPage___UekaQ";
const hero$1 = "Upsell-module__hero___yXHiO";
const heroTitle$1 = "Upsell-module__heroTitle___eBo1B";
const heroSubtitle$1 = "Upsell-module__heroSubtitle___gBnAN";
const limitedOfferBadge = "Upsell-module__limitedOfferBadge___VtvWC";
const limitedOfferBadgeButton = "Upsell-module__limitedOfferBadgeButton___V7Zju";
const heroButton$1 = "Upsell-module__heroButton___ElEWM";
const testimonialsSection$1 = "Upsell-module__testimonialsSection___4D67m";
const testimonialsContainer$1 = "Upsell-module__testimonialsContainer___WaBw5";
const testimonialsHeader$1 = "Upsell-module__testimonialsHeader___MxNbf";
const testimonialsTitle$1 = "Upsell-module__testimonialsTitle___GBCNR";
const testimonialsRating$1 = "Upsell-module__testimonialsRating___-wtGh";
const ratingStars$1 = "Upsell-module__ratingStars___Uo5Y-";
const ratingScore$1 = "Upsell-module__ratingScore___r7d-i";
const testimonialsGrid$1 = "Upsell-module__testimonialsGrid___ExYN-";
const testimonialCard$1 = "Upsell-module__testimonialCard___cVGaV";
const quoteMark$1 = "Upsell-module__quoteMark___vDDF0";
const testimonialText$1 = "Upsell-module__testimonialText___mwaF0";
const authorRow$1 = "Upsell-module__authorRow___zXXHm";
const avatar$1 = "Upsell-module__avatar___bXDly";
const authorName$1 = "Upsell-module__authorName___-xDm4";
const reviewPartners$1 = "Upsell-module__reviewPartners___pukRr";
const partnerText$1 = "Upsell-module__partnerText___hKtx4";
const reviewsioLogo$2 = "Upsell-module__reviewsioLogo___6glQW";
const trustIndicators$1 = "Upsell-module__trustIndicators___fl9Jl";
const trustIndicator$1 = "Upsell-module__trustIndicator___9Q-HW";
const statsGrid = "Upsell-module__statsGrid___lhjLj";
const statCard = "Upsell-module__statCard___tCRKJ";
const statLabel = "Upsell-module__statLabel___m-V3M";
const statValue = "Upsell-module__statValue___UaoL2";
const statChange = "Upsell-module__statChange___3PJbm";
const impactSection = "Upsell-module__impactSection___Twnbp";
const impactContent = "Upsell-module__impactContent___aVBUk";
const impactMetricsRow = "Upsell-module__impactMetricsRow___IYmSD";
const impactMetric = "Upsell-module__impactMetric___os2qj";
const impactValue = "Upsell-module__impactValue___D-CTs";
const impactLabel = "Upsell-module__impactLabel___lVBqY";
const impactButton = "Upsell-module__impactButton___Yjyj-";
const impactButtonContent = "Upsell-module__impactButtonContent___ooMDH";
const foundationSection = "Upsell-module__foundationSection___25-OU";
const featureHighlightsSection = "Upsell-module__featureHighlightsSection___M4u9k";
const featureHighlightsContainer = "Upsell-module__featureHighlightsContainer___ZzMLR";
const featureHighlightsHeader = "Upsell-module__featureHighlightsHeader___qIpoL";
const featureHighlightsTitle = "Upsell-module__featureHighlightsTitle___05pV0";
const featureHighlightsSubtitle = "Upsell-module__featureHighlightsSubtitle___oa-Ki";
const featureHighlightsGrid = "Upsell-module__featureHighlightsGrid___P7PVl";
const featureHighlightCard = "Upsell-module__featureHighlightCard___6mtpg";
const featureIconWrapper = "Upsell-module__featureIconWrapper___kOr8I";
const featureHighlightText = "Upsell-module__featureHighlightText___Q7bwR";
const featureCardTitle$1 = "Upsell-module__featureCardTitle___Oluwd";
const featureCardDescription = "Upsell-module__featureCardDescription___3BmAk";
const pricingContainer = "Upsell-module__pricingContainer___ZjQm1";
const bottomPlansSection = "Upsell-module__bottomPlansSection___SNnGk";
const bottomPlansHeader = "Upsell-module__bottomPlansHeader___0cVDR";
const bottomPlansTitle = "Upsell-module__bottomPlansTitle___HeTXy";
const bottomPlansSubtitle = "Upsell-module__bottomPlansSubtitle___efk8q";
const bottomPlansGrid = "Upsell-module__bottomPlansGrid___qVBF-";
const planCard = "Upsell-module__planCard___c6lzY";
const agencyCard = "Upsell-module__agencyCard___XpP8t";
const planTitle = "Upsell-module__planTitle___X7HfZ";
const planSubtitle = "Upsell-module__planSubtitle___tkGl3";
const planFeatureList = "Upsell-module__planFeatureList___JXiKJ";
const planButton = "Upsell-module__planButton___yQ2nR";
const planFeatureItem = "Upsell-module__planFeatureItem___1hjam";
const planFeatureIcon = "Upsell-module__planFeatureIcon___WRAhq";
const planFeatureText = "Upsell-module__planFeatureText___f-LsN";
const cardTitle = "Upsell-module__cardTitle___XNAgC";
const comparisonSection = "Upsell-module__comparisonSection___nMNqR";
const comparisonContainer = "Upsell-module__comparisonContainer___ozaZj";
const comparisonHeader = "Upsell-module__comparisonHeader___PQj6j";
const comparisonSubtitle = "Upsell-module__comparisonSubtitle___5RRib";
const comparisonCard = "Upsell-module__comparisonCard___P1Uo6";
const tableHeader = "Upsell-module__tableHeader___JJ8-q";
const headerCell = "Upsell-module__headerCell___CBCA1";
const headerCellCenter = "Upsell-module__headerCellCenter___B4yd3";
const categoryBlock = "Upsell-module__categoryBlock___FTWSC";
const summaryRow = "Upsell-module__summaryRow___-IWKd";
const summaryLeft = "Upsell-module__summaryLeft___7dpWY";
const summaryTitle = "Upsell-module__summaryTitle___Dv9on";
const summaryCaret = "Upsell-module__summaryCaret___IFL4j";
const summaryRowOpen = "Upsell-module__summaryRowOpen___HiAPI";
const row = "Upsell-module__row___LsaNd";
const cell = "Upsell-module__cell___DoVGN";
const featureTitleCell = "Upsell-module__featureTitleCell___MNUi1";
const statusCell = "Upsell-module__statusCell___CwL2e";
const statusIcon = "Upsell-module__statusIcon___OV9ge";
const statusPositive = "Upsell-module__statusPositive___mmkGt";
const statusNegative = "Upsell-module__statusNegative___9dr8Q";
const statusText = "Upsell-module__statusText___w4OIo";
const limitedTag = "Upsell-module__limitedTag___7-NIs";
const detailsWrapper = "Upsell-module__detailsWrapper___EO5Cs";
const detailRow = "Upsell-module__detailRow___tU6WC";
const detailLabel = "Upsell-module__detailLabel___sVzrU";
const legendRow = "Upsell-module__legendRow___iM4Bi";
const legendItem = "Upsell-module__legendItem___hi7KV";
const legendText = "Upsell-module__legendText___oqa6H";
const legendCta = "Upsell-module__legendCta___2k9Hf";
const legendButton = "Upsell-module__legendButton___IDvCO";
const professionalsSection = "Upsell-module__professionalsSection___aXm2n";
const professionalsLabel = "Upsell-module__professionalsLabel___VhJbv";
const professionalsTitle = "Upsell-module__professionalsTitle___gYEu-";
const professionalsDescription = "Upsell-module__professionalsDescription___Vsnwq";
const professionalsCardsContainer = "Upsell-module__professionalsCardsContainer___SO58e";
const professionalCard = "Upsell-module__professionalCard___tO6l-";
const cardIcon = "Upsell-module__cardIcon___IoDG8";
const cardDescription = "Upsell-module__cardDescription___IGYXH";
const professionalsQuoteTitle = "Upsell-module__professionalsQuoteTitle___kdd0U";
const professionalsQuoteSubtitle = "Upsell-module__professionalsQuoteSubtitle___SXQJb";
const salesButton = "Upsell-module__salesButton___B7Jxh";
const styles$3 = {
  upsellPage,
  hero: hero$1,
  heroTitle: heroTitle$1,
  heroSubtitle: heroSubtitle$1,
  limitedOfferBadge,
  limitedOfferBadgeButton,
  heroButton: heroButton$1,
  testimonialsSection: testimonialsSection$1,
  testimonialsContainer: testimonialsContainer$1,
  testimonialsHeader: testimonialsHeader$1,
  testimonialsTitle: testimonialsTitle$1,
  testimonialsRating: testimonialsRating$1,
  ratingStars: ratingStars$1,
  ratingScore: ratingScore$1,
  testimonialsGrid: testimonialsGrid$1,
  testimonialCard: testimonialCard$1,
  quoteMark: quoteMark$1,
  testimonialText: testimonialText$1,
  authorRow: authorRow$1,
  avatar: avatar$1,
  authorName: authorName$1,
  reviewPartners: reviewPartners$1,
  partnerText: partnerText$1,
  reviewsioLogo: reviewsioLogo$2,
  trustIndicators: trustIndicators$1,
  trustIndicator: trustIndicator$1,
  statsGrid,
  statCard,
  statLabel,
  statValue,
  statChange,
  impactSection,
  impactContent,
  impactMetricsRow,
  impactMetric,
  impactValue,
  impactLabel,
  impactButton,
  impactButtonContent,
  foundationSection,
  featureHighlightsSection,
  featureHighlightsContainer,
  featureHighlightsHeader,
  featureHighlightsTitle,
  featureHighlightsSubtitle,
  featureHighlightsGrid,
  featureHighlightCard,
  featureIconWrapper,
  featureHighlightText,
  featureCardTitle: featureCardTitle$1,
  featureCardDescription,
  pricingContainer,
  bottomPlansSection,
  bottomPlansHeader,
  bottomPlansTitle,
  bottomPlansSubtitle,
  bottomPlansGrid,
  planCard,
  agencyCard,
  planTitle,
  planSubtitle,
  planFeatureList,
  planButton,
  planFeatureItem,
  planFeatureIcon,
  planFeatureText,
  cardTitle,
  comparisonSection,
  comparisonContainer,
  comparisonHeader,
  comparisonSubtitle,
  comparisonCard,
  tableHeader,
  headerCell,
  headerCellCenter,
  categoryBlock,
  summaryRow,
  summaryLeft,
  summaryTitle,
  summaryCaret,
  summaryRowOpen,
  row,
  cell,
  featureTitleCell,
  statusCell,
  statusIcon,
  statusPositive,
  statusNegative,
  statusText,
  limitedTag,
  detailsWrapper,
  detailRow,
  detailLabel,
  legendRow,
  legendItem,
  legendText,
  legendCta,
  legendButton,
  professionalsSection,
  professionalsLabel,
  professionalsTitle,
  professionalsDescription,
  professionalsCardsContainer,
  professionalCard,
  cardIcon,
  cardDescription,
  professionalsQuoteTitle,
  professionalsQuoteSubtitle,
  salesButton
};
const gradientBackground = "" + new URL("assets/gradient-background-D-j6Kdpu.svg", import.meta.url).href;
const aiSparksBackgroundHorizontal = "" + new URL("assets/ai-sparks-background-horizontal-Fjixgfhm.svg", import.meta.url).href;
const backgroundGradientBlueGreen = "" + new URL("assets/background-gradient-blue-green-CKJziRpY.png", import.meta.url).href;
const aiSparksPricingCard = "" + new URL("assets/ai-sparks-pricing-card-BGiauYZ8.svg", import.meta.url).href;
const simpleQuoteCharacter = "data:image/svg+xml,%3csvg%20width='112'%20height='75'%20viewBox='0%200%20112%2075'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2049.625C0%2049.9581%200.023114%2050.2916%200.0124087%2050.6245C0.00415799%2050.8811%200%2051.1387%200%2051.3973C0%2064.1013%2010.0339%2074.4375%2022.3664%2074.4375C34.6988%2074.4375%2044.7327%2064.1013%2044.7327%2051.3973C44.7327%2038.6933%2034.6988%2028.3571%2022.3664%2028.3571C18.7046%2028.3571%2014.9018%2024.192%2017.2875%2021.4225C24.8573%2012.6352%2035.8984%207.08929%2048.1737%207.08929C50.0766%207.08929%2051.6147%205.50483%2051.6147%203.54464C51.6147%201.58446%2050.0766%200%2048.1737%200C21.6093%200%200%2022.2604%200%2049.625Z'%20fill='white'%20style='mix-blend-mode:soft-light'/%3e%3cpath%20d='M60.0416%2049.625C60.0416%2049.9581%2060.0647%2050.2916%2060.054%2050.6245C60.0457%2050.8811%2060.0416%2051.1387%2060.0416%2051.3973C60.0416%2064.1013%2070.0755%2074.4375%2082.4079%2074.4375C94.7404%2074.4375%20104.774%2064.1013%20104.774%2051.3973C104.774%2038.6933%2094.7404%2028.3571%2082.4079%2028.3571C78.7461%2028.3571%2074.9433%2024.192%2077.329%2021.4225C84.8989%2012.6352%2095.94%207.08929%20108.215%207.08929C110.118%207.08929%20111.656%205.50483%20111.656%203.54464C111.656%201.58446%20110.118%200%20108.215%200C81.6509%200%2060.0416%2022.2604%2060.0416%2049.625Z'%20fill='white'%20style='mix-blend-mode:soft-light'/%3e%3c/svg%3e";
const reviewsioLogo$1 = "" + new URL("assets/reviewsio-logo-DI-bDF_N.svg", import.meta.url).href;
const RotatingWord = ({
  words,
  interval = 1500,
  debug = false
}) => {
  const [index, setIndex] = reactExports.useState(0);
  const [phase, setPhase] = reactExports.useState("visible");
  const [width, setWidth] = reactExports.useState(void 0);
  const wordRef = reactExports.useRef(null);
  if (!words || words.length === 0) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "inline-block", color: "inherit" }, children: "—" });
  }
  if (words.length === 1) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "inline-block", color: "inherit", opacity: 1 }, children: words[0] });
  }
  reactExports.useLayoutEffect(() => {
    if (wordRef.current) {
      const measuredWidth = wordRef.current.offsetWidth;
      setWidth(measuredWidth);
    }
  }, [index, debug]);
  reactExports.useEffect(() => {
    const timerId = setInterval(() => {
      setPhase("fading");
      setTimeout(() => {
        setIndex((prev) => {
          const next = (prev + 1) % words.length;
          return next;
        });
        setPhase("visible");
      }, 300);
    }, interval);
    return () => {
      clearInterval(timerId);
    };
  }, [words, interval, index, debug]);
  const currentWord = words[index] || "";
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    "span",
    {
      style: {
        display: "inline-block",
        whiteSpace: "nowrap",
        fontSize: "inherit",
        fontWeight: "inherit",
        lineHeight: "inherit",
        width: width ? `${width}px` : "auto",
        transition: "width 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
        overflow: "visible"
      },
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "span",
        {
          ref: wordRef,
          style: {
            display: "inline-block",
            opacity: phase === "visible" ? 1 : 0,
            transform: phase === "visible" ? "translateY(0)" : "translateY(-10px)",
            transition: "opacity 0.3s ease, transform 0.3s ease",
            fontSize: "inherit",
            fontWeight: "inherit",
            lineHeight: "inherit",
            whiteSpace: "nowrap",
            background: "linear-gradient(90deg, #00D4FF 0%, #9F6CF9 50%, #FF6B9D 100%)",
            WebkitBackgroundClip: "text",
            WebkitTextFillColor: "transparent",
            backgroundClip: "text"
          },
          children: currentWord
        }
      )
    }
  );
};
const modalWrapper = "ContactSalesModal-module__modalWrapper___PKVTp";
const contactSalesModal = "ContactSalesModal-module__contactSalesModal___fnQLn";
const modalContent = "ContactSalesModal-module__modalContent___oFtWF";
const modalForm = "ContactSalesModal-module__modalForm___wQga4";
const formRow = "ContactSalesModal-module__formRow___TzYfK";
const formField = "ContactSalesModal-module__formField___xJX03";
const checkboxField = "ContactSalesModal-module__checkboxField___pis2R";
const styles$2 = {
  modalWrapper,
  contactSalesModal,
  modalContent,
  modalForm,
  formRow,
  formField,
  checkboxField
};
const avatar1 = "" + new URL("assets/avatar-1-DQvMFwgQ.svg", import.meta.url).href;
const avatar2 = "" + new URL("assets/avatar-2-DH89ihah.svg", import.meta.url).href;
const avatar3 = "" + new URL("assets/avatar-3-hLsqcRHT.svg", import.meta.url).href;
const avatar4 = "" + new URL("assets/avatar-4-D7jbZdE9.svg", import.meta.url).href;
const avatar5 = "" + new URL("assets/avatar-5-FzMTrRk1.svg", import.meta.url).href;
const avatar6 = "" + new URL("assets/avatar-6-Y2ot3PrV.svg", import.meta.url).href;
const featureCategories = [
  {
    id: "general",
    title: __("General features", "beyondseo"),
    radar: { type: "limited", label: __("Limited", "beyondseo") },
    rc360: { type: "check" },
    rows: [
      {
        label: __("Projects Included", "beyondseo"),
        radar: { type: "text", label: "1" },
        rc360: { type: "text", label: "1" }
      },
      {
        label: __("BeyondSEO WordPress plugin", "beyondseo"),
        radar: { type: "limited", label: __("Limited", "beyondseo") },
        rc360: { type: "check" }
      }
    ]
  },
  {
    id: "brand",
    title: __("Brand Monitoring", "beyondseo"),
    radar: { type: "check" },
    rc360: { type: "check" },
    rows: [
      {
        label: __("Brand & competitor monitoring feed", "beyondseo"),
        radar: { type: "check" },
        rc360: { type: "check" }
      },
      { label: __("Weekly reports", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Email alerts", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } }
    ]
  },
  {
    id: "seo",
    title: __("SEO", "beyondseo"),
    radar: { type: "limited", label: __("Limited", "beyondseo") },
    rc360: { type: "check" },
    rows: [
      {
        label: __("Tasks with video tutorials", "beyondseo"),
        radar: { type: "limited", label: __("Limited", "beyondseo") },
        rc360: { type: "check" }
      },
      { label: __("AI-powered SEO tasks", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("AI text optimisation", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("AI URL optimiser", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Keyword tracking", "beyondseo"),
        radar: { type: "text", label: "3" },
        rc360: { type: "text", label: "50" }
      },
      {
        label: __("Locations tracked", "beyondseo"),
        radar: { type: "text", label: "1" },
        rc360: { type: "text", label: "5" }
      },
      {
        label: __("Competitors monitoring", "beyondseo"),
        radar: { type: "text", label: "3" },
        rc360: { type: "text", label: "5" }
      },
      { label: __("Google Analytics integration", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Detailed SEO reports", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } }
    ]
  },
  {
    id: "online-presence",
    title: __("Online Presence", "beyondseo"),
    radar: { type: "limited", label: __("Limited", "beyondseo") },
    rc360: { type: "check" },
    rows: [
      { label: __("Directory checker", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Business Profile creation", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Profile fine-tuning", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      {
        label: __("Publish Business Profile on", "beyondseo"),
        radar: { type: "text", label: __("Just on Google Business Profile & Facebook", "beyondseo") },
        rc360: { type: "text", label: __("Google Business Profile, Facebook and up to 46 directories", "beyondseo") }
      },
      { label: __("Listings protection", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Online Presence insights", "beyondseo"),
        radar: { type: "limited", label: __("Limited", "beyondseo") },
        rc360: { type: "check" }
      }
    ]
  },
  {
    id: "google-ads",
    title: __("Google Ads", "beyondseo"),
    radar: { type: "cross" },
    rc360: { type: "check" },
    rows: [
      { label: __("Campaign creation", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Automatically generated ad texts", "beyondseo"),
        radar: { type: "cross" },
        rc360: { type: "check" }
      },
      { label: __("Budget control", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("Performance insights", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } }
    ]
  },
  {
    id: "social",
    title: __("Social", "beyondseo"),
    radar: { type: "limited", label: __("Limited", "beyondseo") },
    rc360: { type: "check" },
    rows: [
      {
        label: __("Create & publish events on Google Business Profile", "beyondseo"),
        radar: { type: "check" },
        rc360: { type: "check" }
      },
      {
        label: __("Create & publish posts on", "beyondseo"),
        radar: { type: "text", label: __("Just on Google Business Profile, Facebook, Instagram", "beyondseo") },
        rc360: { type: "text", label: __("Google Business Profile, Facebook, Instagram, X, LinkedIn", "beyondseo") }
      },
      { label: __("AI image generator", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Social Media Planner with calendar view", "beyondseo"),
        radar: { type: "cross" },
        rc360: { type: "check" }
      },
      { label: __("Boost posts with Meta ads", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Competitor-based post suggestions", "beyondseo"),
        radar: { type: "check" },
        rc360: { type: "check" }
      },
      { label: __("AI content for posts & events", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("View & respond to post comments", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Link performance", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Social Media insights", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } }
    ]
  },
  {
    id: "reputation",
    title: __("Web Reputation", "beyondseo"),
    radar: { type: "limited", label: __("Limited", "beyondseo") },
    rc360: { type: "check" },
    rows: [
      {
        label: __("View reviews from multiple platforms", "beyondseo"),
        radar: { type: "check" },
        rc360: { type: "check" }
      },
      { label: __("Manual review replies", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      {
        label: __("Generate replies to reviews with AI", "beyondseo"),
        radar: { type: "check" },
        rc360: { type: "check" }
      },
      { label: __("Automatic replies with AI", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      {
        label: __("Review booster (Send review requests via email and print materials)", "beyondseo"),
        radar: { type: "cross" },
        rc360: { type: "check" }
      },
      { label: __("Showcase Reviews widget", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } },
      { label: __("Collect Reviews widget", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("Additional review sources", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("Mentions", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("Reputation sentiment analysis", "beyondseo"), radar: { type: "cross" }, rc360: { type: "check" } },
      { label: __("Reputation insights", "beyondseo"), radar: { type: "check" }, rc360: { type: "check" } }
    ]
  }
];
const defaultExpandedCategoryIds = featureCategories.map((c) => c.id);
const stats = [
  { label: __("Google ads clicks", "beyondseo"), value: "854", change: "+24%" },
  { label: __("Boosted posts engagement", "beyondseo"), value: "5076", change: "+28%" },
  { label: __("AI auto-replies", "beyondseo"), value: "50", change: "+125%" },
  { label: __("Reach", "beyondseo"), value: "42.8k", change: "+14%" }
];
const impactMetrics = [
  { value: "10", label: __("Hours saved weekly", "beyondseo") },
  { value: "90%", label: __("Avg. visibility increase", "beyondseo") },
  { value: "45+", label: __("Directory integrations", "beyondseo") }
];
const testimonials = [
  {
    id: "milano",
    quote: __("They improved my website's ranking. Simple, intuitive actions and fair pricing.", "beyondseo"),
    author: __("Agenzia Grafica Milano", "beyondseo"),
    avatar: avatar1
  },
  {
    id: "play-music",
    quote: __(
      "It is simply the best tool to control, optimize and position your business from one place. Highly recommended!",
      "beyondseo"
    ),
    author: __("Play Music Co.", "beyondseo"),
    avatar: avatar2
  },
  {
    id: "nieuwenburg",
    quote: __(
      "A clear overview of what is happening on your site and what to do to improve it. We are very satisfied - TOP!",
      "beyondseo"
    ),
    author: __("John Nieuwenburg", "beyondseo"),
    avatar: avatar3
  },
  {
    id: "gandars",
    quote: __("A really great tool for work. It's helped me get more clients and reach more people.", "beyondseo"),
    author: __("Irving Gandars", "beyondseo"),
    avatar: avatar4
  },
  {
    id: "ecs",
    quote: __("Excellent tool with great visibility. Simple, efficient, and powerful. I recommend it.", "beyondseo"),
    author: __("Expert Coaching Solutions (ECS)", "beyondseo"),
    avatar: avatar5
  },
  {
    id: "quesada",
    quote: __(
      "I really like this tool. Setting your competitors in the config gives you very useful insights to help you improve.",
      "beyondseo"
    ),
    author: __("Fran Quesada", "beyondseo"),
    avatar: avatar6
  }
];
[__("Google Partner", "beyondseo"), __("REVIEWS.io", "beyondseo")];
const professionalCards = [
  {
    title: __("Web Agency", "beyondseo"),
    description: __("Manage multiple client websites and campaigns from one dashboard.", "beyondseo"),
    icon: Ln.category || "category"
  },
  {
    title: __("Enterprise", "beyondseo"),
    description: __("Custom solutions for large organizations with multiple locations.", "beyondseo"),
    icon: Ln.business || "business"
  },
  {
    title: __("Freelancer / Consultant", "beyondseo"),
    description: __("Handle your clients professionally and efficiently.", "beyondseo"),
    icon: Ln.user || "user"
  }
];
const agencyFeatures = [
  __("Manage all client projects in one place", "beyondseo"),
  __("Advanced analytics and performance insights", "beyondseo"),
  __("Comprehensive white-label reporting", "beyondseo"),
  __("Task time tracking and monitoring", "beyondseo"),
  __("Sub-account and user permissions management", "beyondseo"),
  __("Give your clients bespoke account access to their white-label reports", "beyondseo")
];
const featureHighlights = [
  {
    id: "seo",
    title: __("SEO", "beyondseo"),
    description: __(
      "Full AI-powered SEO. Get personalised guidance and video tutorials. No experience needed.",
      "beyondseo"
    ),
    iconColor: "#1bbf73",
    iconBackground: "#e8f8f1",
    iconName: Ln.search
  },
  {
    id: "google-ads",
    title: __("Google Ads", "beyondseo"),
    description: __(
      "Create AI-powered ads in 3 steps. Professional Google Ads, ready to launch immediately.",
      "beyondseo"
    ),
    iconColor: "#ff477e",
    iconBackground: "#ffe8f0",
    iconName: Ln.gAds
  },
  {
    id: "online-presence",
    title: __("Online Presence", "beyondseo"),
    description: __(
      "Publish your business automatically in 46+ directories. Visible everywhere with one click.",
      "beyondseo"
    ),
    iconColor: "#3a86ff",
    iconBackground: "#e6f0ff",
    iconName: Ln.business
  },
  {
    id: "web-reputation",
    title: __("Web Reputation", "beyondseo"),
    description: __("Never miss a review again. AI responds automatically in your preferred tone.", "beyondseo"),
    iconColor: "#f6c343",
    iconBackground: "#fff5da",
    iconName: Ln.starActive
  },
  {
    id: "brand-monitoring",
    title: __("Brand Monitoring", "beyondseo"),
    description: __(
      "Find out instantly when your business is mentioned online. Stay informed at all times.",
      "beyondseo"
    ),
    iconColor: "#6b5dfc",
    iconBackground: "#f0edff",
    iconName: Ln.shieldActive
  },
  {
    id: "competitor-analysis",
    title: __("Competitor Analysis", "beyondseo"),
    description: __("Track up to 5 competitors. See their strategies and outrank them.", "beyondseo"),
    iconColor: "#2f8ee5",
    iconBackground: "#e8f3ff",
    iconName: Ln.barChart
  },
  {
    id: "ai-features",
    title: __("AI Features", "beyondseo"),
    description: __("Generate images, get content suggestions, and more. Let AI do the work.", "beyondseo"),
    iconColor: "#7c4dff",
    iconBackground: "#f1e8ff",
    iconName: Ln.ai
  },
  {
    id: "social",
    title: __("Social", "beyondseo"),
    description: __(
      "Create entire series of connected posts with AI. Build cohesive campaigns effortlessly.",
      "beyondseo"
    ),
    iconColor: "#12c2c2",
    iconBackground: "#e4f7f7",
    iconName: Ln.socialMedia
  }
];
[
  { text: __("BeyondSEO WordPress plugin (limited)", "beyondseo"), checked: true },
  { text: __("Limited SEO features", "beyondseo"), checked: false },
  { text: __("Track 3 keywords", "beyondseo"), checked: false },
  { text: __("Profile publishing restricted to Facebook & Google", "beyondseo"), checked: false },
  { text: __("No Google Ads", "beyondseo"), checked: false },
  { text: __("No AI content series for social media", "beyondseo"), checked: false },
  { text: __("Manual review replies", "beyondseo"), checked: false },
  { text: __("No post boosting", "beyondseo"), checked: false }
];
[
  __("BeyondSEO WordPress plugin", "beyondseo"),
  __("Full AI-powered SEO", "beyondseo"),
  __("Track 50 keywords", "beyondseo"),
  __("Publish Profile in up to 46 directories automatically", "beyondseo"),
  __("Create Google Ads in minutes", "beyondseo"),
  __("Create entire series of social media posts with AI", "beyondseo"),
  __("Automatic replies with AI", "beyondseo"),
  __("Boosts posts with Meta ads", "beyondseo")
];
const LAUNCH_OFFER_ENABLED = true;
const formatPrice = (amount, symbol) => `${symbol}${Number.isInteger(amount) ? amount : amount.toFixed(2)}`;
const applyUpgradablePlansToLaunchOfferConfig = (baseConfig, upgradablePlans) => {
  const annual = upgradablePlans == null ? void 0 : upgradablePlans.annual;
  const monthly = upgradablePlans == null ? void 0 : upgradablePlans.monthly;
  if (!annual || !monthly) {
    return baseConfig;
  }
  const marketingDiscount = annual.marketingDiscount ?? 0;
  const hasMarketingDiscount = marketingDiscount > 0 && typeof annual.discountedPrice === "number" && annual.discountedPrice < annual.price;
  const effectiveAnnualPrice = hasMarketingDiscount ? annual.discountedPrice : annual.price;
  const monthlyEquivalentOfAnnual = formatPrice(effectiveAnnualPrice / 12, annual.currencySymbol);
  const yearlyTotalOfMonthly = formatPrice(monthly.price * 12, monthly.currencySymbol);
  const canCompareWithMonthly = effectiveAnnualPrice > 0 && monthly.price > 0;
  const savingsVsMonthlyPercent = canCompareWithMonthly ? Math.max(0, Math.round((1 - effectiveAnnualPrice / (monthly.price * 12)) * 100)) : 0;
  const monthlyMoreExpensivePercent = canCompareWithMonthly ? Math.max(0, Math.round((monthly.price * 12 / effectiveAnnualPrice - 1) * 100)) : 0;
  const formattedEffectiveAnnualPrice = formatPrice(effectiveAnnualPrice, annual.currencySymbol);
  const foundersDiscountOverlay = hasMarketingDiscount ? {
    strikethroughSubtext: formatPrice(annual.price, annual.currencySymbol),
    secondarySubtext: void 0,
    highlightText: sprintf(__("%d%% off", "beyondseo"), marketingDiscount),
    highlightType: "positive"
  } : {
    strikethroughSubtext: sprintf(__("%s/year", "beyondseo"), yearlyTotalOfMonthly),
    highlightText: sprintf(__("%d%% off vs. monthly billing", "beyondseo"), savingsVsMonthlyPercent)
  };
  return {
    ...baseConfig,
    founders: {
      ...baseConfig.founders,
      price: formattedEffectiveAnnualPrice,
      primarySubtext: sprintf(__("≈ %s/month", "beyondseo"), monthlyEquivalentOfAnnual),
      ...foundersDiscountOverlay
    },
    alternative: {
      ...baseConfig.alternative,
      price: formatPrice(monthly.price, monthly.currencySymbol),
      primarySubtext: sprintf(__("%s/year", "beyondseo"), yearlyTotalOfMonthly),
      highlightText: sprintf(__("%d%% more expensive", "beyondseo"), monthlyMoreExpensivePercent)
    },
    features: [
      { text: sprintf(__("Full first year for %s", "beyondseo"), formattedEffectiveAnnualPrice) },
      ...baseConfig.features.slice(1)
    ],
    ctaLabel: sprintf(__("Start for %s — Get Full Access", "beyondseo"), formattedEffectiveAnnualPrice)
  };
};
const launchOfferConfig = {
  title: __("Your WordPress Launch Offer", "beyondseo"),
  subtitle: __("For a limited time only. Exclusively for WordPress users.", "beyondseo"),
  spotsBadge: __("launch spots — almost gone", "beyondseo"),
  spotsLimit: __("Limited to max 5,000", "beyondseo"),
  spotsDescription: __(
    "Only a few spots remaining at this price — once they're gone, the offer closes permanently.",
    "beyondseo"
  ),
  spotsFilledPercent: 85,
  founders: {
    badge: __("Founders price", "beyondseo"),
    label: __("Annual · Year 1", "beyondseo"),
    price: "$99",
    pricePeriod: __("/year", "beyondseo"),
    primarySubtext: __("≈ $8.25/month", "beyondseo"),
    strikethroughSubtext: __("$600/year", "beyondseo"),
    secondarySubtext: __("monthly", "beyondseo"),
    highlightText: __("83% off vs. monthly billing", "beyondseo"),
    highlightType: "positive"
  },
  alternative: {
    label: __("Monthly billing", "beyondseo"),
    price: "$50",
    pricePeriod: __("/month", "beyondseo"),
    primarySubtext: __("$600/year", "beyondseo"),
    highlightText: __("506% more expensive", "beyondseo"),
    highlightType: "negative"
  },
  features: [
    { text: __("Full first year for $99", "beyondseo") },
    { text: __("50 keywords tracked daily", "beyondseo") },
    { text: __("up to 46+ directories synced", "beyondseo") },
    { text: __("AI content & Google Ads", "beyondseo") },
    { text: __("AI review management", "beyondseo") },
    { text: __("5 competitors monitored", "beyondseo") },
    { text: __("Weekly AI growth reports", "beyondseo") },
    { text: __("AI Social Media Posting", "beyondseo") }
  ],
  ctaLabel: __("Start for $99 — Get Full Access", "beyondseo"),
  ctaFootnote: __("Annual billing · Instant access · Cancel anytime", "beyondseo")
};
const contactSalesModalConfig = {
  fields: {
    companyName: {
      label: __("Company name", "beyondseo"),
      placeholder: __("Your company name", "beyondseo"),
      required: true
    },
    name: {
      label: __("Name", "beyondseo"),
      placeholder: __("Your full name", "beyondseo"),
      required: true
    },
    email: {
      label: __("Email", "beyondseo"),
      placeholder: __("Your email address", "beyondseo"),
      required: true
    },
    phoneNumber: {
      label: __("Phone number", "beyondseo"),
      placeholder: __("Enter your phone number", "beyondseo"),
      required: false
    },
    industry: {
      label: __("Industry", "beyondseo"),
      placeholder: __("Industry", "beyondseo"),
      required: false,
      options: [
        { value: "technology", label: __("Technology", "beyondseo") },
        { value: "healthcare", label: __("Healthcare", "beyondseo") },
        { value: "finance", label: __("Finance", "beyondseo") },
        { value: "retail", label: __("Retail", "beyondseo") },
        { value: "education", label: __("Education", "beyondseo") },
        { value: "hospitality", label: __("Hospitality", "beyondseo") },
        { value: "real-estate", label: __("Real Estate", "beyondseo") },
        { value: "marketing", label: __("Marketing & Advertising", "beyondseo") },
        { value: "manufacturing", label: __("Manufacturing", "beyondseo") },
        { value: "other", label: __("Other", "beyondseo") }
      ]
    },
    howDidYouFindUs: {
      label: __("How did you find us?", "beyondseo"),
      placeholder: __("How did you find us?", "beyondseo"),
      required: false,
      options: [
        { value: "search-engine", label: __("Search Engine", "beyondseo") },
        { value: "social-media", label: __("Social Media", "beyondseo") },
        { value: "referral", label: __("Referral", "beyondseo") },
        { value: "advertisement", label: __("Advertisement", "beyondseo") },
        { value: "wordpress-plugin", label: __("WordPress Plugin Directory", "beyondseo") },
        { value: "blog-article", label: __("Blog/Article", "beyondseo") },
        { value: "other", label: __("Other", "beyondseo") }
      ]
    },
    message: {
      label: __("Message", "beyondseo"),
      placeholder: __("Enter your message", "beyondseo"),
      required: true,
      maxLength: 400
    }
  },
  checkboxText: __("I agree to receive other communications from RankingCoach 360.", "beyondseo"),
  submitButtonText: __("Contact us", "beyondseo")
};
const ContactSalesModal = ({ isOpen, onClose }) => {
  var _a2, _b2;
  const [formData, setFormData] = reactExports.useState({
    companyName: "",
    name: "",
    email: "",
    phoneNumber: "",
    industry: "",
    howDidYouFindUs: "",
    message: "",
    agreeToContact: false
  });
  const [isSubmitting, setIsSubmitting] = reactExports.useState(false);
  const isFormValid = formData.companyName.trim().length > 0 && formData.name.trim().length > 0 && formData.email.trim().length > 0 && formData.message.trim().length > 0;
  const isSubmitEnabled = formData.agreeToContact && isFormValid && !isSubmitting;
  const handleInputChange = (field, value) => {
    if (typeof value === "object" && "target" in value) {
      setFormData((prev) => ({ ...prev, [field]: value.target.checked }));
    } else {
      setFormData((prev) => ({ ...prev, [field]: value }));
    }
  };
  const handleSubmit = async () => {
    if (!isSubmitEnabled) return;
    setIsSubmitting(true);
    console.log("Form submitted:", formData);
    setTimeout(() => {
      setIsSubmitting(false);
      onClose();
      setFormData({
        companyName: "",
        name: "",
        email: "",
        phoneNumber: "",
        industry: "",
        howDidYouFindUs: "",
        message: "",
        agreeToContact: false
      });
    }, 1e3);
  };
  const handleClose = () => {
    if (!isSubmitting) {
      onClose();
    }
  };
  if (!isOpen) return null;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$2.modalWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
    e9e,
    {
      title: "",
      close: handleClose,
      closeOnSave: false,
      saveCallback: handleSubmit,
      savable: isSubmitEnabled,
      savingInProgress: isSubmitting,
      width: "1148px",
      positiveBtnText: contactSalesModalConfig.submitButtonText,
      className: Kt(styles$2.contactSalesModal),
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { className: styles$2.modalContent, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(N8e, { className: styles$2.modalForm, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$2.formRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: contactSalesModalConfig.fields.companyName.label,
              required: contactSalesModalConfig.fields.companyName.required,
              value: formData.companyName,
              onChange: (e2) => handleInputChange("companyName", e2.target.value),
              placeholder: contactSalesModalConfig.fields.companyName.placeholder
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: contactSalesModalConfig.fields.name.label,
              required: contactSalesModalConfig.fields.name.required,
              value: formData.name,
              onChange: (e2) => handleInputChange("name", e2.target.value),
              placeholder: contactSalesModalConfig.fields.name.placeholder
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$2.formRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: contactSalesModalConfig.fields.email.label,
              required: contactSalesModalConfig.fields.email.required,
              type: "email",
              value: formData.email,
              onChange: (e2) => handleInputChange("email", e2.target.value),
              placeholder: contactSalesModalConfig.fields.email.placeholder
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            L8e,
            {
              label: contactSalesModalConfig.fields.phoneNumber.label,
              required: contactSalesModalConfig.fields.phoneNumber.required,
              type: "tel",
              value: formData.phoneNumber,
              onChange: (e2) => handleInputChange("phoneNumber", e2.target.value),
              placeholder: contactSalesModalConfig.fields.phoneNumber.placeholder
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$2.formRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            B8e,
            {
              label: contactSalesModalConfig.fields.industry.label,
              required: contactSalesModalConfig.fields.industry.required,
              value: formData.industry,
              onChange: (e2) => handleInputChange("industry", e2.target.value),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", disabled: true, children: contactSalesModalConfig.fields.industry.placeholder }),
                (_a2 = contactSalesModalConfig.fields.industry.options) == null ? void 0 : _a2.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option.value, children: option.label }, option.value))
              ]
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            B8e,
            {
              label: contactSalesModalConfig.fields.howDidYouFindUs.label,
              required: contactSalesModalConfig.fields.howDidYouFindUs.required,
              value: formData.howDidYouFindUs,
              onChange: (e2) => handleInputChange("howDidYouFindUs", e2.target.value),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", disabled: true, children: contactSalesModalConfig.fields.howDidYouFindUs.placeholder }),
                (_b2 = contactSalesModalConfig.fields.howDidYouFindUs.options) == null ? void 0 : _b2.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option.value, children: option.label }, option.value))
              ]
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.formField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          D8e,
          {
            label: contactSalesModalConfig.fields.message.label,
            required: contactSalesModalConfig.fields.message.required,
            value: formData.message,
            onChange: (e2) => handleInputChange("message", e2.target.value),
            placeholder: contactSalesModalConfig.fields.message.placeholder,
            rows: 4,
            minRows: 4,
            maxLength: contactSalesModalConfig.fields.message.maxLength
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$2.checkboxField, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          r9e,
          {
            checked: formData.agreeToContact,
            onChange: (e2) => handleInputChange("agreeToContact", e2),
            label: contactSalesModalConfig.checkboxText
          }
        ) })
      ] }) })
    }
  ) });
};
const connectPage = "Connect-module__connectPage___NdaPQ";
const hero = "Connect-module__hero___X-hxX";
const heroTitle = "Connect-module__heroTitle___sXgED";
const heroSubtitle = "Connect-module__heroSubtitle___793ZC";
const heroButton = "Connect-module__heroButton___nfnD8";
const heroDisclaimer = "Connect-module__heroDisclaimer___E5Nvg";
const trustIndicators = "Connect-module__trustIndicators___L3mzX";
const trustIndicator = "Connect-module__trustIndicator___Qe0rI";
const unlockSection = "Connect-module__unlockSection___EO8vO";
const unlockHeader = "Connect-module__unlockHeader___CI7xm";
const unlockTitle = "Connect-module__unlockTitle___z0Sqi";
const unlockSubtitle = "Connect-module__unlockSubtitle___X27jW";
const unlockCards = "Connect-module__unlockCards___XWM3s";
const rightNowCard = "Connect-module__rightNowCard___JTJ4J";
const withFreeCard = "Connect-module__withFreeCard___S-FH-";
const cardHeading = "Connect-module__cardHeading___s25AZ";
const unlockList = "Connect-module__unlockList___CxwOt";
const unlockItemText = "Connect-module__unlockItemText___xR3Jl";
const activateButton = "Connect-module__activateButton___LzVTU";
const growSection = "Connect-module__growSection___psqeG";
const growTitle = "Connect-module__growTitle___JggQT";
const cardsGrid = "Connect-module__cardsGrid___8MPXL";
const featureCard = "Connect-module__featureCard___NDokf";
const featureCardTitle = "Connect-module__featureCardTitle___X7QP3";
const featureCardIllustration = "Connect-module__featureCardIllustration___bc-Ni";
const cardPerformance = "Connect-module__cardPerformance___m7aco";
const cardCompetitors = "Connect-module__cardCompetitors___aMzz7";
const cardBusinessOnline = "Connect-module__cardBusinessOnline___NHBAi";
const cardVisibility = "Connect-module__cardVisibility___M21G2";
const cardReviews = "Connect-module__cardReviews___zvuLg";
const cardProgress = "Connect-module__cardProgress___Olu5r";
const testimonialsSection = "Connect-module__testimonialsSection___YIeXW";
const testimonialsContainer = "Connect-module__testimonialsContainer___1WB69";
const testimonialsHeader = "Connect-module__testimonialsHeader___JLvI0";
const testimonialsTitle = "Connect-module__testimonialsTitle___CNJbB";
const testimonialsRating = "Connect-module__testimonialsRating___53myV";
const ratingStars = "Connect-module__ratingStars___SUH-U";
const ratingScore = "Connect-module__ratingScore___KW1z1";
const testimonialsGrid = "Connect-module__testimonialsGrid___7Hckx";
const testimonialCard = "Connect-module__testimonialCard___eDCHL";
const quoteMark = "Connect-module__quoteMark___RSfCd";
const testimonialText = "Connect-module__testimonialText___Z0X1L";
const authorRow = "Connect-module__authorRow___6vrfp";
const avatar = "Connect-module__avatar___64xmg";
const authorName = "Connect-module__authorName___paqzW";
const reviewPartners = "Connect-module__reviewPartners___jNZUY";
const partnerText = "Connect-module__partnerText___EE5QH";
const reviewsioLogo = "Connect-module__reviewsioLogo___Evy5g";
const finalCtaSection = "Connect-module__finalCtaSection___4-zTS";
const finalCtaCard = "Connect-module__finalCtaCard___6dzYR";
const finalCtaTitle = "Connect-module__finalCtaTitle___9-M9K";
const finalCtaSubtitle = "Connect-module__finalCtaSubtitle___9IRwF";
const finalCtaButton = "Connect-module__finalCtaButton___-ZZjQ";
const finalCtaDisclaimer = "Connect-module__finalCtaDisclaimer___4fJg6";
const styles$1 = {
  connectPage,
  hero,
  heroTitle,
  heroSubtitle,
  heroButton,
  heroDisclaimer,
  trustIndicators,
  trustIndicator,
  unlockSection,
  unlockHeader,
  unlockTitle,
  unlockSubtitle,
  unlockCards,
  rightNowCard,
  withFreeCard,
  cardHeading,
  unlockList,
  unlockItemText,
  activateButton,
  growSection,
  growTitle,
  cardsGrid,
  featureCard,
  featureCardTitle,
  featureCardIllustration,
  cardPerformance,
  cardCompetitors,
  cardBusinessOnline,
  cardVisibility,
  cardReviews,
  cardProgress,
  testimonialsSection,
  testimonialsContainer,
  testimonialsHeader,
  testimonialsTitle,
  testimonialsRating,
  ratingStars,
  ratingScore,
  testimonialsGrid,
  testimonialCard,
  quoteMark,
  testimonialText,
  authorRow,
  avatar,
  authorName,
  reviewPartners,
  partnerText,
  reviewsioLogo,
  finalCtaSection,
  finalCtaCard,
  finalCtaTitle,
  finalCtaSubtitle,
  finalCtaButton,
  finalCtaDisclaimer
};
const seeYourPerformance = "" + new URL("assets/see-your-performance-Qy7xZUKJ.svg", import.meta.url).href;
const seeWhereYouStand = "" + new URL("assets/see-where-you-C-94N_WO.svg", import.meta.url).href;
const alwaysKnowWhats = "" + new URL("assets/always-know-whats-GIMG65g-.svg", import.meta.url).href;
const spotWhatsHolding = "" + new URL("assets/spot-whats-holding-Df5k2vVC.svg", import.meta.url).href;
const stayOnTopOf = "" + new URL("assets/stay-on-top-of-C_pOQ-n7.svg", import.meta.url).href;
const trackYourProgress = "" + new URL("assets/track-your-progress-URN-vhIi.svg", import.meta.url).href;
const featureCards = [
  {
    id: "performance",
    title: __("See your performance instantly", "beyondseo"),
    illustration: seeYourPerformance,
    className: "cardPerformance"
  },
  {
    id: "competitors",
    title: __("See where you stand vs competitors", "beyondseo"),
    illustration: seeWhereYouStand,
    className: "cardCompetitors"
  },
  {
    id: "businessOnline",
    title: __("Always know what’s happening with your business online", "beyondseo"),
    illustration: alwaysKnowWhats,
    className: "cardBusinessOnline"
  },
  {
    id: "visibility",
    title: __("Spot what’s holding back your visibility", "beyondseo"),
    illustration: spotWhatsHolding,
    className: "cardVisibility"
  },
  {
    id: "reviews",
    title: __("Stay on top of your reviews and protect your reputation", "beyondseo"),
    illustration: stayOnTopOf,
    className: "cardReviews"
  },
  {
    id: "progress",
    title: __("Track your progress over time", "beyondseo"),
    illustration: trackYourProgress,
    className: "cardProgress"
  }
];
const rightNowItems = [
  __("Basic SEO checks only", "beyondseo"),
  __("No keyword or ranking tracking", "beyondseo"),
  __("No competitor data", "beyondseo"),
  __("No clear performance insights", "beyondseo"),
  __("Limited visibility into your results", "beyondseo")
];
const withRcFreeItems = [
  __("Start tracking your own rankings, keywords & competitors", "beyondseo"),
  __("Finally see how visible you are on Google", "beyondseo"),
  __("Track how your performance improves over time", "beyondseo"),
  __("Compare your results with competitors", "beyondseo"),
  __("Monitor your reviews and online reputation", "beyondseo")
];
const Connect = () => {
  const handleActivateForFree = () => {
    var _a2, _b2;
    const adminUrl = (_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.adminurl;
    window.location.href = `${adminUrl}?page=rankingcoach-onboarding`;
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.connectPage, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(DSe, { background: Id.gradientPrimaryMesh, noDefaultPadding: true, className: styles$1.hero, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.heroTitle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.display2, fontWeight: si.bold, color: "var(--fn-fg-on-dark)", children: __("Turn your free plugin into a growth engine", "beyondseo") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, color: "var(--fn-fg-on-dark)", className: styles$1.heroSubtitle, children: __(
        "Activate your free account to track your visibility, improve your rankings and grow your business",
        "beyondseo"
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.secondary,
          size: uf.medium,
          className: styles$1.heroButton,
          onClick: handleActivateForFree,
          children: __("Activate your free account", "beyondseo")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.heroDisclaimer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, color: "var(--fn-fg-on-dark)", children: __("100% free  • No credit card  • Takes less than 2 minutes", "beyondseo") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.trustIndicators, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$1.trustIndicator, children: [
          Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "var(--a2900)", children: Ln.starActive }, i)),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { color: "var(--fn-fg-on-dark)", type: si.medium, children: __("4.84/5 | 5,000+ Reviews", "beyondseo") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { color: "var(--fn-fg-on-dark)", type: si.medium, children: __("Google Partner", "beyondseo") })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$1.unlockSection, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.unlockHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$1.unlockTitle, children: __("What you unlock with your free account", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$1.unlockSubtitle, children: __("It is 100% free, no credit card needed and it takes less than 2 minutes to activate", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.unlockCards, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.rightNowCard, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading4, fontWeight: si.bold, className: styles$1.cardHeading, children: __("Right now", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$1.unlockList, children: rightNowItems.map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            O8e,
            {
              icon: Ln.close,
              iconColor: "var(--n700)",
              iconSize: ai.small,
              textType: Er.text,
              textColor: "var(--n700)",
              verticalAlign: "start",
              className: styles$1.unlockItemText,
              children: item
            }
          ) }, index)) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.withFreeCard, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading4, fontWeight: si.bold, className: styles$1.cardHeading, children: __("After activation", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$1.unlockList, children: withRcFreeItems.map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            O8e,
            {
              icon: Ln.check,
              iconColor: "var(--white)",
              iconSize: ai.small,
              textType: Er.text,
              textColor: "var(--white)",
              fontWeight: si.bold,
              verticalAlign: "start",
              className: styles$1.unlockItemText,
              children: item
            }
          ) }, index)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.medium,
              className: styles$1.activateButton,
              onClick: handleActivateForFree,
              children: __("Activate your free account", "beyondseo")
            }
          )
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$1.growSection, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$1.growTitle, children: __("Everything you need to start growing", "beyondseo") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.cardsGrid, children: featureCards.map((card2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${styles$1.featureCard} ${styles$1[card2.className]}`, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, className: styles$1.featureCardTitle, children: card2.title }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: card2.illustration, alt: "", className: styles$1.featureCardIllustration })
      ] }, card2.id)) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$1.testimonialsSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.testimonialsContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.testimonialsHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$1.testimonialsTitle, children: __("Join 1M+ businesses already growing", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.testimonialsRating, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.ratingStars, children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "var(--a2900)", children: Ln.starActive }, i)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$1.ratingScore, children: __("4.84 out of 5", "beyondseo") })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.testimonialsGrid, children: testimonials.map((testimonial) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.testimonialCard, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: simpleQuoteCharacter, alt: "", className: styles$1.quoteMark }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$1.testimonialText, children: testimonial.quote }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.authorRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: testimonial.avatar, alt: `${testimonial.author} avatar`, className: styles$1.avatar }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.bold, className: styles$1.authorName, children: testimonial.author })
        ] })
      ] }, testimonial.id)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.reviewPartners, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$1.partnerText, children: __("Google Partner", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "a",
          {
            href: "https://www.reviews.io/company-reviews/store/www.rankingcoach.com#page:Qr",
            target: "_blank",
            rel: "noopener noreferrer",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: reviewsioLogo$1, alt: "REVIEWS.io", className: styles$1.reviewsioLogo })
          }
        )
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$1.finalCtaSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DSe,
      {
        background: Id.gradientPrimaryMesh,
        noDefaultPadding: true,
        className: styles$1.finalCtaCard,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            nr,
            {
              type: Er.heading2,
              fontWeight: si.bold,
              color: "var(--fn-fg-on-dark)",
              className: styles$1.finalCtaTitle,
              children: __("Activate your free account and start seeing results today", "beyondseo")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textIntro, color: "var(--fn-fg-on-dark)", className: styles$1.finalCtaSubtitle, children: __("Track your performance and see results in minutes", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.medium,
              className: styles$1.finalCtaButton,
              onClick: handleActivateForFree,
              children: __("Activate your free account", "beyondseo")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.textHelp, color: "var(--fn-fg-on-dark)", className: styles$1.finalCtaDisclaimer, children: __("100% free  • No credit card  • Takes less than 2 minutes", "beyondseo") })
        ]
      }
    ) })
  ] });
};
const launchOffer = "LaunchOfferUpsell-module__launchOffer___PgtUL";
const card = "LaunchOfferUpsell-module__card___jLdLD";
const gradientHeader = "LaunchOfferUpsell-module__gradientHeader___D2Oxf";
const flameDecoration = "LaunchOfferUpsell-module__flameDecoration___G4-lH";
const spotsHeader = "LaunchOfferUpsell-module__spotsHeader___n78bT";
const progressBar = "LaunchOfferUpsell-module__progressBar___wL3Fq";
const spotsDescription = "LaunchOfferUpsell-module__spotsDescription___XzMHw";
const spotsTitle = "LaunchOfferUpsell-module__spotsTitle___6Ort9";
const spotsLimit = "LaunchOfferUpsell-module__spotsLimit___rwPaj";
const progressFill = "LaunchOfferUpsell-module__progressFill___e87o9";
const cardBody = "LaunchOfferUpsell-module__cardBody___dykq2";
const pricingComparison = "LaunchOfferUpsell-module__pricingComparison___liCnN";
const pricingComparisonStacked = "LaunchOfferUpsell-module__pricingComparisonStacked___cNJK0";
const priceCard = "LaunchOfferUpsell-module__priceCard___yZm42";
const priceCardActive = "LaunchOfferUpsell-module__priceCardActive___Xz9mG";
const priceLabel = "LaunchOfferUpsell-module__priceLabel___5oKU9";
const priceAmount = "LaunchOfferUpsell-module__priceAmount___m3WCP";
const pricePeriod = "LaunchOfferUpsell-module__pricePeriod___FfmLO";
const priceSubtext = "LaunchOfferUpsell-module__priceSubtext___H3cke";
const priceCompare = "LaunchOfferUpsell-module__priceCompare___RWhDb";
const priceHighlight = "LaunchOfferUpsell-module__priceHighlight___7Opzi";
const priceCardInactive = "LaunchOfferUpsell-module__priceCardInactive___3uwY8";
const priceCardDisabled = "LaunchOfferUpsell-module__priceCardDisabled___1-xwe";
const foundersBadge = "LaunchOfferUpsell-module__foundersBadge___5Z-BH";
const priceMain = "LaunchOfferUpsell-module__priceMain___-ezrh";
const priceHighlightPositive = "LaunchOfferUpsell-module__priceHighlightPositive___tLhmG";
const priceHighlightNegative = "LaunchOfferUpsell-module__priceHighlightNegative___3Mcar";
const featuresList = "LaunchOfferUpsell-module__featuresList___xVDAo";
const featureItem = "LaunchOfferUpsell-module__featureItem___ib-2z";
const featureIcon = "LaunchOfferUpsell-module__featureIcon___r2T0X";
const ctaButton = "LaunchOfferUpsell-module__ctaButton___3fa-V";
const ctaFootnote = "LaunchOfferUpsell-module__ctaFootnote___Fn5AX";
const styles = {
  launchOffer,
  card,
  gradientHeader,
  flameDecoration,
  spotsHeader,
  progressBar,
  spotsDescription,
  spotsTitle,
  spotsLimit,
  progressFill,
  cardBody,
  pricingComparison,
  pricingComparisonStacked,
  priceCard,
  priceCardActive,
  priceLabel,
  priceAmount,
  pricePeriod,
  priceSubtext,
  priceCompare,
  priceHighlight,
  priceCardInactive,
  priceCardDisabled,
  foundersBadge,
  priceMain,
  priceHighlightPositive,
  priceHighlightNegative,
  featuresList,
  featureItem,
  featureIcon,
  ctaButton,
  ctaFootnote
};
const flameSvg = "data:image/svg+xml,%3csvg%20width='104'%20height='135'%20viewBox='0%200%20104%20135'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M76.4241%2035.8673C125.367%2089.4852%20100.922%20134.486%2050.3101%20134.803C-0.30172%20135.119%20-14.4335%2092.788%2015.7244%2051.8842C15.7244%2059.7702%2021.2266%2071.5483%2026.9674%2071.5483C23.8%2059.7272%2018.682%2030.8893%2050.3902%200C50.3902%2024.4817%2069.4853%2036.1227%2069.4853%2057.2284C75.9721%2052.456%2076.4241%2046.55%2076.4241%2035.8673Z'%20fill='url(%23paint0_radial_10978_12849)'/%3e%3cpath%20d='M73.9803%2069.5472C73.8852%2074.7763%2078.0652%2081.19%2079.5164%2084.0893C94.3935%20113.81%2080.2832%20129.648%2064.4145%20133.47C58.8709%20134.806%2052.3329%20135.217%2045.0001%20134.686C9.27958%20132.1%2016.2489%2098.2104%2022.0538%2080.332C25.0413%2084.0709%2026.6844%2089.0027%2035.648%2092.1399C31.7641%2080.4837%2041.9291%2058.4958%2047.4569%2052.6676C52.6031%2065.594%2063.4091%2072.7236%2065.9936%2085.2496C67.6118%2083.1964%2069.9872%2074.6812%2073.9803%2069.5472Z'%20fill='url(%23paint1_linear_10978_12849)'/%3e%3cpath%20d='M41.7302%20104.53C42.9474%20105.821%2044.067%20108.318%2044.4573%20111.541C47.8433%20105.108%2044.8859%2095.146%2045.1981%2092.7572C59.7351%20105.147%2083.5643%20134.251%2053.2969%20134.879C28.9055%20135.386%2036.8269%20120.213%2041.7302%20104.53Z'%20fill='url(%23paint2_linear_10978_12849)'/%3e%3cdefs%3e%3cradialGradient%20id='paint0_radial_10978_12849'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(49.8503%20122.188)%20rotate(-91.136)%20scale(112.525%2085.9919)'%3e%3cstop%20stop-color='%23FF1F69'/%3e%3cstop%20offset='1'%20stop-color='%23F59B2E'/%3e%3c/radialGradient%3e%3clinearGradient%20id='paint1_linear_10978_12849'%20x1='58.8915'%20y1='55.7081'%20x2='48.0366'%20y2='135.042'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFD37A'/%3e%3cstop%20offset='1'%20stop-color='%23FFB114'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_10978_12849'%20x1='52.2195'%20y1='92.483'%20x2='52.2195'%20y2='134.993'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFF5E0'/%3e%3cstop%20offset='1'%20stop-color='%23FFE4AD'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const LAUNCH_OFFER_SCROLL_ID = "wp-launch-offer";
const LaunchOfferUpsell = ({
  onUpgrade,
  isLoading = false,
  config: config2 = launchOfferConfig,
  scrollId = LAUNCH_OFFER_SCROLL_ID,
  stackPricingCards = false
}) => {
  var _a2, _b2;
  const [selectedPlan, setSelectedPlan] = reactExports.useState("annual");
  const upgradablePlans = (_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.upgradablePlans;
  const resolvedConfig = applyUpgradablePlansToLaunchOfferConfig(config2, upgradablePlans);
  const spotsFilled = Math.max(0, Math.min(100, resolvedConfig.spotsFilledPercent));
  const isAnnualActive = selectedPlan === "annual";
  const handleCtaClick = (event) => onUpgrade(selectedPlan, event);
  const handleAnnualCardClick = () => {
    if (!isAnnualActive) setSelectedPlan("annual");
  };
  const handleMonthlyCardClick = () => {
    if (isAnnualActive) setSelectedPlan("monthly");
  };
  const handleAnnualCardKey = (event) => {
    if ((event.key === "Enter" || event.key === " ") && !isAnnualActive) {
      event.preventDefault();
      setSelectedPlan("annual");
    }
  };
  const handleMonthlyCardKey = (event) => {
    if ((event.key === "Enter" || event.key === " ") && isAnnualActive) {
      event.preventDefault();
      setSelectedPlan("monthly");
    }
  };
  const monthlyCtaLabel = `Start for ${resolvedConfig.alternative.price}${resolvedConfig.alternative.pricePeriod}`;
  const ctaLabel = isAnnualActive ? resolvedConfig.ctaLabel : monthlyCtaLabel;
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.launchOffer, id: scrollId ?? void 0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.card, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.gradientHeader, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: flameSvg, alt: "", "aria-hidden": "true", className: styles.flameDecoration }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.spotsHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.spotsTitle, children: resolvedConfig.spotsBadge }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.spotsLimit, children: resolvedConfig.spotsLimit })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: styles.progressBar,
          role: "progressbar",
          "aria-valuenow": spotsFilled,
          "aria-valuemin": 0,
          "aria-valuemax": 100,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.progressFill, style: { width: `${spotsFilled}%` } })
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles.spotsDescription, children: resolvedConfig.spotsDescription })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.cardBody, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles.pricingComparison, stackPricingCards ? styles.pricingComparisonStacked : ""), children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            role: isAnnualActive ? void 0 : "button",
            tabIndex: isAnnualActive ? void 0 : isLoading ? -1 : 0,
            "aria-disabled": isAnnualActive ? void 0 : isLoading,
            className: Kt(
              styles.priceCard,
              isAnnualActive ? styles.priceCardActive : styles.priceCardInactive,
              !isAnnualActive && isLoading ? styles.priceCardDisabled : ""
            ),
            onClick: !isAnnualActive && !isLoading ? handleAnnualCardClick : void 0,
            onKeyDown: !isAnnualActive && !isLoading ? handleAnnualCardKey : void 0,
            children: renderPlanContent(resolvedConfig.founders)
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            role: isAnnualActive ? "button" : void 0,
            tabIndex: isAnnualActive ? isLoading ? -1 : 0 : void 0,
            "aria-disabled": isAnnualActive ? isLoading : void 0,
            className: Kt(
              styles.priceCard,
              isAnnualActive ? styles.priceCardInactive : styles.priceCardActive,
              isAnnualActive && isLoading ? styles.priceCardDisabled : ""
            ),
            onClick: isAnnualActive && !isLoading ? handleMonthlyCardClick : void 0,
            onKeyDown: isAnnualActive && !isLoading ? handleMonthlyCardKey : void 0,
            children: renderPlanContent(resolvedConfig.alternative)
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles.featuresList, children: resolvedConfig.features.map((feature, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: styles.featureItem, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.featureIcon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "var(--s900)", children: Ln.check }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: feature.text })
      ] }, index)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        gh,
        {
          type: Vo.primary,
          size: uf.medium,
          className: styles.ctaButton,
          onClick: handleCtaClick,
          isLoading,
          disabled: isLoading,
          children: ctaLabel
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles.ctaFootnote, children: resolvedConfig.ctaFootnote })
    ] })
  ] }) });
};
const renderPlanContent = (plan) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
  plan.badge && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.foundersBadge, children: plan.badge }),
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.priceLabel, children: plan.label }),
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.priceMain, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.priceAmount, children: plan.price }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.pricePeriod, children: plan.pricePeriod })
  ] }),
  plan.primarySubtext && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.priceSubtext, children: plan.primarySubtext }),
  plan.strikethroughSubtext && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.priceCompare, children: [
    "vs. ",
    /* @__PURE__ */ jsxRuntimeExports.jsx("s", { children: plan.strikethroughSubtext }),
    plan.secondarySubtext ? ` ${plan.secondarySubtext}` : ""
  ] }),
  plan.highlightText && /* @__PURE__ */ jsxRuntimeExports.jsx(
    "div",
    {
      className: Kt(
        styles.priceHighlight,
        plan.highlightType === "negative" ? styles.priceHighlightNegative : styles.priceHighlightPositive
      ),
      children: plan.highlightText
    }
  )
] });
function generateSessionId() {
  if (typeof crypto !== "undefined" && crypto.randomUUID) {
    return crypto.randomUUID();
  }
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
    const r = Math.random() * 16 | 0;
    const v2 = c === "x" ? r : r & 3 | 8;
    return v2.toString(16);
  });
}
function getCurrentOrigin() {
  return window.location.origin;
}
const Upsell = () => {
  var _a2, _b2;
  const isOnboardingCompleted = ((_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.isOnboardingCompleted) !== "false";
  if (!isOnboardingCompleted) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Connect, {});
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsx(UpsellContent, {});
};
const UpsellContent = () => {
  var _a2, _b2;
  const isOnboardingCompleted = ((_b2 = (_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) == null ? void 0 : _b2.isOnboardingCompleted) !== "false";
  const [paymentPeriod, setPaymentPeriod] = reactExports.useState("annual");
  const [isLoading, setIsLoading] = reactExports.useState(false);
  const [isContactModalOpen, setIsContactModalOpen] = reactExports.useState(false);
  const [expandedCategories, setExpandedCategories] = reactExports.useState(
    () => featureCategories.reduce((acc, category) => {
      acc[category.id] = defaultExpandedCategoryIds.includes(category.id);
      return acc;
    }, {})
  );
  const renderStatus = (status) => {
    if (status.type === "check") {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: Kt(styles$3.statusIcon, styles$3.statusPositive), children: /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#2bb673", hasCircle: true, fillColor: "#e9f7ef", children: Ln.check }) });
    }
    if (status.type === "cross") {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: Kt(styles$3.statusIcon, styles$3.statusNegative), children: /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#d14b4b", hasCircle: true, fillColor: "#ffefef", children: Ln.close }) });
    }
    if (status.type === "limited") {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$3.limitedTag, children: status.label || __("Limited", "beyondseo") });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.statusText, fontWeight: si.bold, children: status.label });
  };
  const toggleCategory = (categoryId) => {
    setExpandedCategories((prev) => ({
      ...prev,
      [categoryId]: !prev[categoryId]
    }));
  };
  const handleActivateForFree = () => {
    var _a3, _b3;
    const adminUrl = (_b3 = (_a3 = rcWindow) == null ? void 0 : _a3.rankingCoachReactData) == null ? void 0 : _b3.adminurl;
    window.location.href = `${adminUrl}?page=rankingcoach-onboarding`;
  };
  const triggerUpgrade = async (paymentType, event) => {
    event.preventDefault();
    if (!window.rcUpsell || !window.BSEORegistration) {
      console.error("[React] Required globals missing");
      alert("System not fully loaded. Please refresh.");
      return;
    }
    let windowOpened = false;
    if (window.BSEORegistration.openLoadingWindow) {
      windowOpened = window.BSEORegistration.openLoadingWindow();
      if (!windowOpened) {
        return;
      }
    }
    setIsLoading(true);
    try {
      const response = await fetch(window.rcUpsell.apiUrl, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "X-WP-Nonce": window.rcUpsell.nonce
        },
        body: JSON.stringify({
          paymentType
        })
      });
      const data = await response.json();
      if (data.registrationURL) {
        const url = new URL(window.rcUpsell.baseUrl + data.registrationURL);
        const autoClose = 1;
        if (data.s) {
          url.searchParams.set("s", data.s);
        }
        url.searchParams.set("sessionId", generateSessionId());
        url.searchParams.set("parentOrigin", getCurrentOrigin());
        url.searchParams.set("autoClose", String(Number(autoClose)));
        url.searchParams.set("do", "register");
        url.searchParams.set("payment_type", paymentType);
        const fullRegistrationURL = url.toString().replace("&amp;", "&").replace("?&", "?");
        let finalUrl = fullRegistrationURL;
        if (data.couponCode) {
          const couponUrl = new URL(
            `${window.rcUpsell.baseUrl}/${window.rcUpsell.locale}/c/${encodeURIComponent(data.couponCode)}`
          );
          couponUrl.searchParams.set("redirecturl", fullRegistrationURL);
          finalUrl = couponUrl.toString();
        }
        console.log("Upsell data:", data);
        console.log("Final Upsell URL:", finalUrl);
        if (windowOpened && window.BSEORegistration.navigateWindow) {
          window.BSEORegistration.navigateWindow(finalUrl);
        } else {
          window.BSEORegistration.openWindow(finalUrl);
        }
      } else {
        throw new Error(data.message || "Failed to get upsell URL");
      }
    } catch (error2) {
      console.error("[React] Upsell error:", error2);
      alert("Could not start upgrade process. Please try again.");
      if (windowOpened && window.BSEORegistration.closeWindow) {
        window.BSEORegistration.closeWindow();
      }
    } finally {
      setIsLoading(false);
    }
  };
  const handleLaunchOfferUpgrade = (paymentType, event) => triggerUpgrade(paymentType, event);
  const scrollToLaunchOffer = () => {
    const target = document.getElementById(LAUNCH_OFFER_SCROLL_ID);
    if (target) {
      target.scrollIntoView({ behavior: "smooth", block: "start" });
    }
  };
  const openContactModal = () => {
    setIsContactModalOpen(true);
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.upsellPage, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: styles$3.hero,
        style: {
          backgroundImage: `url(${gradientBackground})`,
          backgroundSize: "cover",
          backgroundPosition: "top center",
          backgroundRepeat: "no-repeat"
        },
        children: [
          isOnboardingCompleted && LAUNCH_OFFER_ENABLED && /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              type: "button",
              className: Kt(styles$3.limitedOfferBadge, styles$3.limitedOfferBadgeButton),
              onClick: scrollToLaunchOffer,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { role: "img", "aria-label": "party", children: "🎉" }),
                " ",
                __("Limited time only: Your Wordpress Launch Offer!", "beyondseo")
              ]
            }
          ),
          isOnboardingCompleted && !LAUNCH_OFFER_ENABLED,
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.heroTitle, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { style: {
              color: "white",
              fontSize: "inherit",
              fontWeight: "inherit",
              lineHeight: "inherit",
              margin: 0
            }, children: [
              __("Your ", "beyondseo"),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                RotatingWord,
                {
                  words: [
                    __("business", "beyondseo"),
                    __("SEO", "beyondseo"),
                    __("website", "beyondseo"),
                    __("GEO", "beyondseo"),
                    __("reputation", "beyondseo"),
                    __("social media", "beyondseo")
                  ]
                }
              ),
              __(" deserves", "beyondseo")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading1, fontWeight: si.bold, children: /* @__PURE__ */ jsxRuntimeExports.jsx("mark", { children: __("its full potential", "beyondseo") }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.heroSubtitle, children: __("Connect now to get rankingCoach Radar to access all features in your SEO, Online Presence, Social, and Reputation blocks, as well as new ones.", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.medium,
              className: styles$3.heroButton,
              onClick: isOnboardingCompleted ? scrollToLaunchOffer : handleActivateForFree,
              isLoading: isOnboardingCompleted ? isLoading : false,
              disabled: isOnboardingCompleted ? isLoading : false,
              children: isOnboardingCompleted ? __("Upgrade to rankingCoach 360 now", "beyondseo") : __("Connect for free", "beyondseo")
            }
          ),
          isOnboardingCompleted && !LAUNCH_OFFER_ENABLED,
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.trustIndicators, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$3.trustIndicator, children: [
              Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#FFB114", children: Ln.starActive }, i)),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "4.84/5 | 5,000+ Reviews" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Google Partner" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.statsGrid, children: stats.map((stat, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.statCard, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.statLabel, children: stat.label }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.statValue, children: stat.value }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.statChange, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "↑" }),
              " ",
              stat.change
            ] })
          ] }, index)) })
        ]
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.foundationSection, children: [
      !LAUNCH_OFFER_ENABLED,
      isOnboardingCompleted && LAUNCH_OFFER_ENABLED && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.pricingContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        LaunchOfferUpsell,
        {
          onUpgrade: handleLaunchOfferUpgrade,
          isLoading
        }
      ) }),
      isOnboardingCompleted && !LAUNCH_OFFER_ENABLED
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$3.comparisonSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.comparisonContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.comparisonHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.regular, children: __("What you get with free rankingCoach Radar", "beyondseo") }),
        isOnboardingCompleted && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.comparisonSubtitle, children: __("See the difference: With rankingCoach 360 you have all the tools for your online success.", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.comparisonCard, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.tableHeader, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, className: styles$3.headerCell, children: __("Feature", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, className: Kt(styles$3.headerCell, styles$3.headerCellCenter), children: __("RankingCoach Radar", "beyondseo") }),
          isOnboardingCompleted && /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, className: Kt(styles$3.headerCell, styles$3.headerCellCenter), children: __("RankingCoach 360", "beyondseo") })
        ] }),
        featureCategories.map((category) => {
          const isExpanded = expandedCategories[category.id];
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.categoryBlock, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                type: "button",
                className: Kt(styles$3.summaryRow, isExpanded ? styles$3.summaryRowOpen : ""),
                "aria-expanded": isExpanded,
                "aria-controls": `feature-${category.id}`,
                onClick: () => toggleCategory(category.id),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$3.cell, styles$3.featureTitleCell, styles$3.summaryLeft), children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.medium, className: styles$3.summaryTitle, color: "--n700", children: category.title }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$3.summaryCaret, "aria-hidden": "true" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$3.cell, styles$3.statusCell), children: renderStatus(category.radar) }),
                  isOnboardingCompleted && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$3.cell, styles$3.statusCell), children: renderStatus(category.rc360) })
                ]
              }
            ),
            isExpanded && category.rows.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.detailsWrapper, id: `feature-${category.id}`, children: category.rows.map((row2, rowIndex) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Kt(styles$3.row, styles$3.detailRow), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$3.cell, styles$3.detailLabel), children: /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.regular, color: "--n700", children: row2.label }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$3.cell, styles$3.statusCell), children: renderStatus(row2.radar) }),
              isOnboardingCompleted && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Kt(styles$3.cell, styles$3.statusCell), children: renderStatus(row2.rc360) })
            ] }, rowIndex)) })
          ] }, category.id);
        }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.legendRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.legendItem, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#2bb673", hasCircle: true, fillColor: "#e9f7ef", children: Ln.check }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.legendText, children: __("Full access", "beyondseo") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.legendItem, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#d14b4b", hasCircle: true, fillColor: "#ffefef", children: Ln.close }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.legendText, children: __("No access", "beyondseo") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.legendItem, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$3.limitedTag, children: __("Limited", "beyondseo") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.legendText, children: __("Partial access", "beyondseo") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.legendCta, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.primary,
              size: uf.medium,
              onClick: isOnboardingCompleted ? scrollToLaunchOffer : handleActivateForFree,
              isLoading: isOnboardingCompleted ? isLoading : false,
              disabled: isOnboardingCompleted ? isLoading : false,
              className: styles$3.legendButton,
              children: isOnboardingCompleted ? __("Upgrade now", "beyondseo") : __("Connect for free", "beyondseo")
            }
          ) })
        ] })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$3.featureHighlightsSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.featureHighlightsContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.featureHighlightsHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$3.featureHighlightsTitle, children: __("+45 features. 8 areas. 1 easy upgrade. 0 compromises.", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.featureHighlightsSubtitle, children: __("rankingCoach free combines everything you need for successful online marketing. Simple, effective, affordable.", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.featureHighlightsGrid, children: featureHighlights.map((feature) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.featureHighlightCard, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: styles$3.featureIconWrapper,
            style: { backgroundColor: feature.iconBackground },
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.medium, color: feature.iconColor, children: feature.iconName || Ln.check })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.featureHighlightText, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading4, fontWeight: si.bold, className: styles$3.featureCardTitle, children: feature.title }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.featureCardDescription, children: feature.description })
        ] })
      ] }, feature.id)) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$3.impactSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: styles$3.impactContent,
        style: {
          backgroundImage: `url(${aiSparksBackgroundHorizontal})`
        },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.impactMetricsRow, children: impactMetrics.map((metric) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.impactMetric, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading1, fontWeight: si.bold, className: styles$3.impactValue, children: metric.value }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.medium, className: styles$3.impactLabel, children: metric.label })
          ] }, metric.label)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.small,
              className: styles$3.impactButton,
              onClick: openContactModal,
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$3.impactButtonContent, children: [
                __("Agency or Enterprise? Talk to us", "beyondseo"),
                /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "var(--n000)", children: Ln.chevronRight })
              ] })
            }
          )
        ]
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$3.testimonialsSection, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.testimonialsContainer, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.testimonialsHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$3.testimonialsTitle, children: __("What our customers say", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.testimonialsRating, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.ratingStars, children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "#FFB114", children: Ln.starActive }, i)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.ratingScore, children: __("4.84 out of 5", "beyondseo") })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.testimonialsGrid, children: testimonials.map((testimonial) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.testimonialCard, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: simpleQuoteCharacter, alt: "", className: styles$3.quoteMark }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.testimonialText, children: testimonial.quote }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.authorRow, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: testimonial.avatar,
              alt: `${testimonial.author} avatar`,
              className: styles$3.avatar
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, fontWeight: si.bold, className: styles$3.authorName, children: testimonial.author })
        ] })
      ] }, testimonial.id)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.reviewPartners, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.partnerText, children: __("Google Partner", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://www.reviews.io/company-reviews/store/www.rankingcoach.com#page:Qr", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: reviewsioLogo$1, alt: "REVIEWS.io", className: styles$3.reviewsioLogo }) })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: styles$3.professionalsSection,
        style: {
          backgroundImage: `url('${backgroundGradientBlueGreen}')`
        },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.professionalsLabel, children: __("FOR PROFESSIONALS", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$3.professionalsTitle, children: __("Are you a Web Professional, Agency or Enterprise?", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.professionalsDescription, children: __("Managing SEO and Digital Marketing for clients or multiple businesses? Talk to our sales team to learn about our special offers and partner programs.", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.professionalsCardsContainer, children: professionalCards.map((card2, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.professionalCard, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.medium, color: "#35FAFF", className: styles$3.cardIcon, children: card2.icon }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading4, fontWeight: si.bold, className: styles$3.cardTitle, children: card2.title }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.cardDescription, children: card2.description })
          ] }, index)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading4, fontWeight: si.bold, className: styles$3.professionalsQuoteTitle, children: __("Get a custom quote for your business", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.professionalsQuoteSubtitle, children: __("Volume discounts and white-label solutions available.", "beyondseo") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            gh,
            {
              type: Vo.secondary,
              size: uf.medium,
              iconRight: Ln.arrowRight,
              className: styles$3.salesButton,
              onClick: openContactModal,
              children: __("Talk to sales", "beyondseo")
            }
          )
        ]
      }
    ),
    isOnboardingCompleted && /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$3.bottomPlansSection, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.bottomPlansHeader, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading2, fontWeight: si.bold, className: styles$3.bottomPlansTitle, children: __("Ready to unlock your business's full potential?", "beyondseo") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.bottomPlansSubtitle, children: __("Upgrade now to unlock all features that help grow your business with less effort.", "beyondseo") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.bottomPlansGrid, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          LaunchOfferUpsell,
          {
            onUpgrade: handleLaunchOfferUpgrade,
            isLoading,
            scrollId: null,
            stackPricingCards: true
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: Kt(styles$3.planCard, styles$3.agencyCard),
            style: { backgroundImage: `url(${aiSparksPricingCard})` },
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.heading3, fontWeight: si.bold, className: styles$3.planTitle, children: __("Agency, Enterprise or Freelancer?", "beyondseo") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.planSubtitle, children: __("Deliver growth to your clients.", "beyondseo") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                gh,
                {
                  type: Vo.secondary,
                  size: uf.medium,
                  className: styles$3.planButton,
                  onClick: () => setIsContactModalOpen(true),
                  children: __("Contact sales", "beyondseo")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$3.planFeatureList, children: agencyFeatures.map((feature) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: styles$3.planFeatureItem, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$3.planFeatureIcon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(li, { type: ai.small, color: "var(--n000)", children: Ln.check }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(nr, { type: Er.text, className: styles$3.planFeatureText, children: feature })
              ] }, feature)) })
            ]
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      ContactSalesModal,
      {
        isOpen: isContactModalOpen,
        onClose: () => setIsContactModalOpen(false)
      }
    )
  ] });
};
const params = new URLSearchParams(window.location.search);
["1", "true"].includes(params.get("debug") || "");
const componentsToLoad = (((_d = rcWindow.rankingCoachReactData) == null ? void 0 : _d.loadNextComponents) || "").split(",");
const MainComponent = ({ children }) => {
  var _a2, _b2, _c2, _d2, _e, _f;
  const isLocaleReady = useLocaleLoader();
  const dispatch = useAppDispatch();
  const { isPluginDataLoaded, isFetchingPluginData } = useSelector((state) => state.app);
  const { isCurrentPostLoaded, isFetchingPostData } = useSelector((state) => state.post);
  let { currentPostType, currentPostId, isEditingPost } = ((_a2 = rcWindow) == null ? void 0 : _a2.rankingCoachReactData) || {};
  const postId = (_c2 = (_b2 = wp == null ? void 0 : wp.data) == null ? void 0 : _b2.select("core/editor")) == null ? void 0 : _c2.getCurrentPostId();
  const postStatus = (_f = (_e = (_d2 = wp == null ? void 0 : wp.data) == null ? void 0 : _d2.select("core/editor")) == null ? void 0 : _e.getCurrentPost()) == null ? void 0 : _f.status;
  const isAddingPost = postStatus === "auto-draft" && postId !== 0;
  const [fetchPostExecuted, setFetchPostExecuted] = reactExports.useState(false);
  reactExports.useEffect(() => {
    if (!isPluginDataLoaded && !isFetchingPluginData) {
      dispatch(
        PluginInformationStore.postApiPluginInformationThunk({
          requestBody: null,
          queryParams: { debug: true, noCache: true }
        })
      );
    }
  }, [isPluginDataLoaded, isFetchingPluginData]);
  reactExports.useEffect(() => {
    if (fetchPostExecuted || isCurrentPostLoaded || isFetchingPostData) return;
    const shouldFetchForEditing = isEditingPost && ["post", "page"].includes(currentPostType);
    const shouldFetchForAdding = isAddingPost;
    if (shouldFetchForEditing || shouldFetchForAdding) {
      const targetPostId = shouldFetchForAdding ? postId : currentPostId;
      if (!targetPostId || isNaN(targetPostId) || targetPostId <= 0) {
        return;
      }
      if (postId) {
        rcWindow.rankingCoachReactData.currentPostId = postId;
      }
      setFetchPostExecuted(true);
      dispatch(fetchPost({ postId: targetPostId, postType: currentPostType }));
    }
  }, [
    isEditingPost,
    currentPostType,
    currentPostId,
    isAddingPost,
    postId,
    isCurrentPostLoaded,
    isFetchingPostData,
    fetchPostExecuted
  ]);
  const isLoading = !(isPluginDataLoaded && isLocaleReady);
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Li, { testId: "rc-main-container", style: { width: "100%" }, children: reactExports.Children.map(children, (child) => {
    if (reactExports.isValidElement(child) && (child.type === Onboarding || child.type === Registration || child.type === Activation)) {
      return reactExports.cloneElement(child, { isPluginLoading: isLoading });
    }
    return isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { opacity: 0.1 }, children: "Loading..." }) : child;
  }) });
};
const renderWithProviders = (container2, Component) => {
  if (container2) {
    clientExports.createRoot(container2).render(
      /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { store: MainStore, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PersistGate, { persistor: MainStorePersistor, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MainComponent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Component, {}) }) }) })
    );
  }
};
const COMPONENTS_MAP = {
  add_new: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
  },
  edit: () => /* @__PURE__ */ jsxRuntimeExports.jsx(App, { hideTabs: false }),
  float: () => {
    const { metaTagsData, seoTitle, seoDescription, seoKeywords, isMetaTagsDataLoaded } = useSelector(
      (state) => state.app
    );
    const [showFloating, setShowFloating] = reactExports.useState(false);
    const dispatch = useAppDispatch();
    const SEOOptimiserProps = {
      headerText: "BeyondSEO",
      loadingText: __("Checking your page for<br>existing keywords", "beyondseo"),
      noKeywordsText: __("This page doesn`t have keywords", "beyondseo"),
      noKeywordsDescription: __("Using the right keywords can significantly increase your website`s visibility, making it easier for people to find it.", "beyondseo"),
      closeButtonText: __("Close", "beyondseo"),
      useKwdButtonText: __("Use these keywords", "beyondseo"),
      skipKwdButtonText: __("Skip this", "beyondseo")
    };
    reactExports.useEffect(() => {
      const handleTriggerKeywordGenerator = () => {
        setShowFloating(true);
      };
      document.addEventListener("rankingcoach-trigger-keyword-generator", handleTriggerKeywordGenerator);
      return () => {
        document.removeEventListener("rankingcoach-trigger-keyword-generator", handleTriggerKeywordGenerator);
      };
    }, []);
    const handleOnUseKeywordsFunction = (keywords) => {
      var _a2, _b2, _c2, _d2;
      let currentPostId = getPathId();
      let oldKeywords = { ...metaTagsData == null ? void 0 : metaTagsData.keywords };
      const uniqueKeywordsSet = /* @__PURE__ */ new Set();
      if ((_a2 = keywords.primaryKeywordFromContent) == null ? void 0 : _a2.name) {
        uniqueKeywordsSet.add(keywords.primaryKeywordFromContent.name);
      } else if ((_b2 = keywords.primaryKeywordFromExisting) == null ? void 0 : _b2.name) {
        uniqueKeywordsSet.add(keywords.primaryKeywordFromExisting.name);
      }
      if (((_c2 = keywords.additionalKeywordsFromContent) == null ? void 0 : _c2.elements) && keywords.additionalKeywordsFromContent.elements.length > 0) {
        keywords.additionalKeywordsFromContent.elements.forEach((keyword) => {
          if (keyword.name) {
            uniqueKeywordsSet.add(keyword.name);
          }
        });
      }
      if (((_d2 = keywords.additionalKeywordsFromExisting) == null ? void 0 : _d2.elements) && keywords.additionalKeywordsFromExisting.elements.length > 0) {
        keywords.additionalKeywordsFromExisting.elements.forEach((keyword) => {
          if (keyword.name) {
            uniqueKeywordsSet.add(keyword.name);
          }
        });
      }
      const uniqueKeywords = Array.from(uniqueKeywordsSet);
      if (uniqueKeywords.length > 0) {
        oldKeywords.content = uniqueKeywords.join(",");
      }
      dispatch(
        MetatagsStore.postApiMetatagsByPostIdThunk({
          postId: currentPostId,
          requestBody: {
            keywords: oldKeywords
          },
          queryParams: {}
        })
      ).then(() => {
        const keywordsUpdatedEvent = new CustomEvent("rankingcoach-keywords-updated");
        document.dispatchEvent(keywordsUpdatedEvent);
      });
      setShowFloating(false);
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: !!showFloating, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      SEOOptimiser,
      {
        onCloseFunction: () => setShowFloating(false),
        onUseKeywordsFunction: handleOnUseKeywordsFunction,
        ...SEOOptimiserProps
      }
    ) });
  },
  onboarding: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Onboarding, {});
  },
  activation: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Activation, {});
  },
  registration: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Registration, {});
  },
  upsell: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Upsell, {});
  },
  generalSettings: () => {
    const [showGeneralSettings, setShowGeneralSettings] = reactExports.useState(true);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Va, { if: showGeneralSettings, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, {}) });
  },
  elementor: () => /* @__PURE__ */ jsxRuntimeExports.jsx(App, { hideTabs: false, context: "elementor" }),
  postlist: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
  },
  scoreOrbHeaderButton: () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreButtonHeader, {});
  },
  gutenbergSidebar: () => {
    var _a2, _b2;
    const dispatch = useAppDispatch();
    const { optimiserResult } = useSelector((state) => state.app);
    const [isLoading, setIsLoading] = reactExports.useState(false);
    const [hasOnboardingError, setHasOnboardingError] = reactExports.useState(false);
    const [dataFetched, setDataFetched] = reactExports.useState(false);
    const overallScore = reactExports.useMemo(() => {
      if (optimiserResult && typeof optimiserResult.score === "number") {
        const rawScore = optimiserResult.score;
        return rawScore > 1 ? Math.round(rawScore) : Math.round(rawScore * 100);
      }
      return 0;
    }, [optimiserResult]);
    reactExports.useEffect(() => {
      if (!optimiserResult && !isLoading && !hasOnboardingError && !dataFetched) {
        setIsLoading(true);
        setDataFetched(true);
        dispatch(
          OptimiserStore.getApiOptimiserByPostIdThunk({
            postId: getPathId(),
            queryParams: { noCache: false }
          })
        ).then((result) => {
          if (result.meta.requestStatus === "rejected") {
            const errorPayload = result.payload;
            if (errorPayload && typeof errorPayload === "object" && errorPayload.code === "rest_forbidden" && errorPayload.message && typeof errorPayload.message === "string" && errorPayload.message.includes("complete onboarding")) {
              setHasOnboardingError(true);
            }
          }
        }).finally(() => {
          setIsLoading(false);
        });
      }
    }, [optimiserResult, isLoading, hasOnboardingError, dataFetched, dispatch]);
    reactExports.useEffect(() => {
      const handleScoreRecalculated = (event) => {
      };
      document.addEventListener("rankingcoach-score-recalculated", handleScoreRecalculated);
      return () => {
        document.removeEventListener("rankingcoach-score-recalculated", handleScoreRecalculated);
      };
    }, []);
    const SEOOptimiserProps = {
      headerText: __("BeyondSEO", "beyondseo"),
      overallScore,
      analysisResult: optimiserResult ? {
        contexts: {
          elements: ((_b2 = (_a2 = optimiserResult.contexts) == null ? void 0 : _a2.elements) == null ? void 0 : _b2.map((context) => {
            var _a3, _b3;
            return {
              contextName: context.contextName || "",
              score: context.score,
              weight: context.weight || 1,
              weightedScore: Math.round((context.score || 0) * (context.weight || 1)) * 100,
              factors: {
                elements: ((_b3 = (_a3 = context.factors) == null ? void 0 : _a3.elements) == null ? void 0 : _b3.map((factor) => {
                  var _a4;
                  return {
                    factorName: factor.factorName || "",
                    score: factor.score || 0,
                    status: factor.status,
                    suggestions: factor.suggestions ? {
                      elements: ((_a4 = factor.suggestions.elements) == null ? void 0 : _a4.map((suggestion) => ({
                        title: suggestion.title || "",
                        description: suggestion.description || ""
                      }))) || []
                    } : void 0
                  };
                })) || []
              }
            };
          })) || []
        }
      } : void 0,
      isLoading
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx(GutenbergSidebar, { ...SEOOptimiserProps });
  }
};
function initializeApp() {
  const CONTAINERS = {
    edit: document.getElementById("edit-rankingcoach-react"),
    float: document.getElementById("seo-optimiser-rankingcoach-react"),
    activation: document.getElementById("activation-rankingcoach-page"),
    onboarding: document.getElementById("onboarding-rankingcoach-page"),
    registration: document.getElementById("registration-rankingcoach-page"),
    upsell: document.getElementById("upsell-rankingcoach-page"),
    generalSettings: document.getElementById("generalSettings-rankingcoach-page"),
    gutenbergSidebar: document.getElementById("rankingcoach-sidebar-content"),
    elementor: document.getElementById("rankingcoach-elementor-content"),
    postlist: document.getElementById("rc-postlist-container"),
    scoreOrbHeaderButton: document.getElementById("rc-aiorb-header-button-container")
  };
  Object.entries(CONTAINERS).forEach(([key, container2]) => {
    if (container2 && componentsToLoad.includes(key)) {
      renderWithProviders(container2, COMPONENTS_MAP[key]);
    }
  });
}
const MAX_SEO_SCORE_CELLS = 20;
function initializePostCells() {
  const renderPostCells = async () => {
    const postCellElements = document.querySelectorAll(".rc-react-postcell");
    const elementsToRender = Array.from(postCellElements).slice(0, MAX_SEO_SCORE_CELLS);
    for (const div of elementsToRender) {
      await new Promise((resolve) => {
        const postId = parseInt(div.getAttribute("data-id") || "0");
        const SeoScoreCellWrapper = () => /* @__PURE__ */ jsxRuntimeExports.jsx(SeoScoreCell, { postId, onDataLoaded: resolve });
        renderWithProviders(div, SeoScoreCellWrapper);
      });
    }
  };
  if (document.readyState === "complete" || document.readyState === "interactive") {
    setTimeout(renderPostCells, 0);
  } else {
    document.addEventListener("DOMContentLoaded", () => {
      setTimeout(renderPostCells, 0);
    });
  }
}
function initializeScoreHeaderButton() {
  const renderScoreHeaderButton = () => {
    if (!document.getElementById("rc-aiorb-header-button-container")) {
      const editorHeaderSettings = document.querySelector(".editor-header__settings");
      let container2 = null;
      if (editorHeaderSettings) {
        container2 = document.createElement("div");
        container2.id = "rc-aiorb-header-button-container";
        editorHeaderSettings.insertBefore(container2, editorHeaderSettings.firstChild);
      }
      renderWithProviders(container2, ScoreButtonHeader);
    }
  };
  if (document.readyState === "complete" || document.readyState === "interactive") {
    setTimeout(renderScoreHeaderButton, 1e3);
  } else {
    document.addEventListener("DOMContentLoaded", renderScoreHeaderButton);
  }
}
function initializeGutenbergSidebar() {
  const sidebarContainer = document.getElementById("rankingcoach-sidebar-content");
  if (sidebarContainer) {
    while (sidebarContainer.firstChild) {
      sidebarContainer.removeChild(sidebarContainer.firstChild);
    }
    renderWithProviders(sidebarContainer, COMPONENTS_MAP.gutenbergSidebar);
    return true;
  } else {
    return false;
  }
}
const isTrashedPostList = params.get("post_status") === "trash" && (params.get("post_type") === "post" || params.get("post_type") === "page");
initializeApp();
if (!isTrashedPostList) {
  initializePostCells();
  initializeScoreHeaderButton();
  initializeGutenbergSidebar();
}
window.initializeApp = initializeApp;
window.initializePostCells = initializePostCells;
window.initializeAIOrbHeaderButton = initializeScoreHeaderButton;
window.initializeGutenbergSidebar = initializeGutenbergSidebar;
