import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { memo, useState, useRef, useEffect, useMemo, forwardRef } from 'react';
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import { isNotEmpty, isNotPresent, isPresent, truncate, humanize, noop } from '@bigbinary/neeto-cist';
import useHotkeys from '@bigbinary/neeto-hotkeys';
import Help from '@bigbinary/neeto-icons/Help';
import Profile from '@bigbinary/neeto-team-members-frontend/Profile';
import Avatar from '@bigbinary/neetoui/Avatar';
import Dropdown$1 from '@bigbinary/neetoui/Dropdown';
import { isEmpty, toLower, mergeDeepLeft, not } from 'ramda';
import KeyboardShortcuts from './KeyboardShortcuts.js';
import SubscriptionUpgradeRequestModal from './SubscriptionUpgradeRequestModal.js';
import Modal$1 from '@bigbinary/neetoui/Modal';
import classnames from 'classnames';
import Search from '@bigbinary/neeto-icons/Search';
import Input from '@bigbinary/neetoui/Input';
import Typography from '@bigbinary/neetoui/Typography';
import { useTranslation } from 'react-i18next';
import Spinner from '@bigbinary/neetoui/Spinner';
import Neeto from '@bigbinary/neeto-icons/typeface-logos/Neeto';
import * as AppIcons from '@bigbinary/neeto-icons/typeface-logos';
import { n } from './inject-css-C2dztUxs.js';
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
import { useQuery } from '@tanstack/react-query';
import axios from 'axios';
import Crown from '@bigbinary/neeto-icons/Crown';
import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
import Book from '@bigbinary/neeto-icons/Book';
import ChatQuestions from '@bigbinary/neeto-icons/ChatQuestions';
import Community from '@bigbinary/neeto-icons/Community';
import Status from '@bigbinary/neeto-icons/Status';
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
import Right from '@bigbinary/neeto-icons/Right';
import CheckCircle from '@bigbinary/neeto-icons/CheckCircle';
import Tag from '@bigbinary/neetoui/Tag';
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
import CloseCircle from '@bigbinary/neeto-icons/CloseCircle';
import User from '@bigbinary/neeto-icons/User';
import { t } from 'i18next';
import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
import Moon from '@bigbinary/neeto-icons/Moon';
import Sun from '@bigbinary/neeto-icons/Sun';
import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
import Logout from '@bigbinary/neeto-icons/Logout';
import CopyToClipboardButton from './CopyToClipboardButton.js';
import './useKeyboardShortcutsPaneState-C_eLceJQ.js';
import 'zustand/shallow';
import '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
import 'zustand';
import '@bigbinary/neeto-icons/Close';
import '@bigbinary/neetoui/Button';
import '@bigbinary/neetoui/managers';
import '@bigbinary/neetoui/Kbd';
import './ua-parser-rRwDJPFB.js';
import '@bigbinary/neeto-icons/Copy';
import '@bigbinary/neeto-icons/Check';

var QUERY_KEYS$1 = {
  NEETO_APPS_LIST: "neeto-apps-list"
};
var SPECIAL_APP_NAMES = {
  bugwatch: "BugWatch"
};

var css$1 = ".neeto-molecules-product-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:24px;position:relative;transition:all .3s;width:100%}@media (prefers-reduced-motion:reduce){.neeto-molecules-product-switcher__wrapper{transition:none}}@media screen and (max-width:768px){.neeto-molecules-product-switcher__wrapper{padding:16px}}.neeto-molecules-product-switcher__grid{grid-gap:12px;display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-product-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-product-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-product-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-product-switcher__header{align-items:flex-start;flex-direction:column;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-product-switcher__header h1{font-size:24px}}@media only screen and (max-width:768px){.neeto-molecules-product-switcher_modal-container .neeto-molecules-product-switcher__header-mobile{align-items:flex-start;margin-bottom:24px}}.neeto-molecules-product-switcher_modal-container .neeto-molecules-product-switcher__wrapper{padding:0}.neeto-molecules-product-switcher__close-btn{inset-inline-end:12px;position:absolute;top:12px}.neeto-molecules-product-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-product-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-product-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-product-switcher-link{background-color:rgb(var(--neeto-ui-white));border-color:rgb(var(--neeto-ui-gray-200));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:1px;cursor:pointer;display:flex;flex-direction:column;gap:16px;max-width:100%;padding:10px 8px;text-decoration:none;transition:all .3s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.neeto-molecules-product-switcher-link{transition:none}}.neeto-molecules-product-switcher-link:focus,.neeto-molecules-product-switcher-link:focus-visible{outline:none}.neeto-molecules-product-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-product-switcher-link:not(.neeto-molecules-product-switcher-link--active):hover{border-color:rgb(var(--neeto-ui-primary-500))}.neeto-molecules-product-switcher-link--active{background-color:rgb(var(--neeto-ui-primary-50));border-color:rgb(var(--neeto-ui-primary-500))}.neeto-molecules-product-switcher-link--highlighted{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-product-switcher-link__icon-holder{flex-grow:1;flex-shrink:0}.neeto-molecules-product-switcher-link__icon-holder svg{height:36px;width:auto}.neeto-molecules-product-switcher-link__icon-holder .neeto-molecules-product-switcher-link__icon-default{height:24px}.neeto-molecules-product-switcher-link__content{flex-shrink:0}.neeto-molecules-product-switcher-link__content span{display:block}.neeto-molecules-product-switcher_modal{z-index:100000}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen{display:flex;flex-direction:column;height:100dvh!important;width:100vw!important}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen .neeto-ui-modal__header{flex-shrink:0}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen .neeto-ui-modal__body{--neeto-ui-modal-body-padding-top:24px;flex-grow:1;min-height:0;overflow-y:auto}.neeto-ui-theme--dark .neeto-molecules-product-switcher__wrapper [data-dark-mode-color=true]{fill:rgb(var(--neeto-ui-black))}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal{--neeto-molecules-product-switcher-modal-padding-y:24px;align-items:flex-start;padding-bottom:var(--neeto-molecules-product-switcher-modal-padding-y);padding-top:var(--neeto-molecules-product-switcher-modal-padding-y)}@media only screen and (min-width:1024px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal{--neeto-molecules-product-switcher-modal-padding-y:40px}}@media only screen and (min-width:1536px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal{--neeto-molecules-product-switcher-modal-padding-y:80px}}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large{--neeto-ui-modal-body-padding-top:24px;--neeto-ui-modal-body-padding-bottom:24px;--neeto-ui-modal-close-btn-top:12px;--neeto-ui-modal-close-btn-right:12px;--neeto-ui-modal-body-padding-x:0;--neeto-ui-text-h1:24px}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher-link__icon-holder svg{height:32px}@media only screen and (min-width:1024px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large{--neeto-ui-modal-wrapper-width:960px}}@media only screen and (min-width:1280px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large{--neeto-ui-modal-wrapper-width:1024px}}@media only screen and (min-width:1536px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large{--neeto-ui-modal-wrapper-width:1280px}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher-link__icon-holder svg{height:36px}}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__header{background-color:rgb(var(--neeto-ui-white));margin-bottom:32px;padding-inline-end:56px;padding-inline-start:24px}@media only screen and (max-width:768px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__header{gap:16px;margin-bottom:16px}}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__body{height:calc(100dvh - var(--neeto-molecules-product-switcher-modal-padding-y)*2 - 124px);margin-bottom:0;overflow-y:auto;padding-inline-end:24px;padding-inline-start:24px}@media only screen and (max-width:768px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__body{height:calc(90dvh - var(--neeto-molecules-product-switcher-modal-padding-y)*2 - 124px)}}.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-ui-modal__close{z-index:2}@media only screen and (min-width:1280px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__search-wrapper{width:420px}}@media only screen and (min-width:1536px){.neeto-ui-modal__backdrop.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper.neeto-ui-modal__wrapper--large .neeto-molecules-product-switcher__search-wrapper{width:500px}}";
n(css$1,{});

var _excluded$4 = ["name", "description", "url", "isHighlighted"];
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var ProductLink = function ProductLink(_ref) {
  var name = _ref.name,
    description = _ref.description,
    url = _ref.url,
    _ref$isHighlighted = _ref.isHighlighted,
    isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
    props = _objectWithoutProperties(_ref, _excluded$4);
  var normalizedName = (name || "").toLowerCase();
  var specialCase = SPECIAL_APP_NAMES[normalizedName];
  var appName = "Neeto".concat(name.charAt(0)).concat(name.slice(1).toLowerCase());
  var AppIcon = specialCase ? AppIcons["Neeto".concat(specialCase)] : AppIcons[appName];
  return /*#__PURE__*/jsxs("a", _objectSpread$9(_objectSpread$9({
    "data-testid": "".concat(normalizedName, "-app-link"),
    href: url,
    rel: "noreferrer",
    target: "_blank",
    className: classnames("neeto-molecules-product-switcher-link", {
      "neeto-molecules-product-switcher-link--active": globalProps.appName.includes(name),
      "neeto-molecules-product-switcher-link--highlighted": isHighlighted
    })
  }, props), {}, {
    children: [/*#__PURE__*/jsx("div", {
      className: "neeto-molecules-product-switcher-link__icon-holder",
      children: AppIcon ? /*#__PURE__*/jsx(AppIcon, {}) : /*#__PURE__*/jsx(Neeto, {
        className: "neeto-molecules-product-switcher-link__icon-default"
      })
    }), /*#__PURE__*/jsx("div", {
      className: "neeto-molecules-product-switcher-link__content",
      children: /*#__PURE__*/jsx(Typography, {
        className: "neeto-ui-text-gray-600",
        component: "span",
        style: "body3",
        weight: "normal",
        children: description
      })
    })]
  }));
};
var ProductLink$1 = /*#__PURE__*/memo(ProductLink);

function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var Content = function Content(_ref) {
  var highlightedIndex = _ref.highlightedIndex,
    filteredApps = _ref.filteredApps,
    isLoading = _ref.isLoading;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  if (isLoading) {
    return /*#__PURE__*/jsx("div", {
      className: "flex items-center justify-center py-8",
      children: /*#__PURE__*/jsx(Spinner, {})
    });
  }
  return (filteredApps === null || filteredApps === void 0 ? void 0 : filteredApps.length) > 0 ? /*#__PURE__*/jsx("div", {
    className: "neeto-molecules-product-switcher__grid",
    children: filteredApps.map(function (app, index) {
      return /*#__PURE__*/jsx(ProductLink$1, _objectSpread$8(_objectSpread$8({}, app), {}, {
        "data-highlighted-index": index,
        isHighlighted: index === highlightedIndex
      }), app.name);
    })
  }) : /*#__PURE__*/jsx(Typography, {
    className: "neeto-ui-text-center",
    "data-testid": "no-apps-found-title",
    style: "body1",
    children: t("neetoMolecules.productSwitcher.noApps")
  });
};

var fetch$1 = function fetch() {
  return axios.get("/api/v1/neeto_apps");
};
var neetoAppsApi = {
  fetch: fetch$1
};

function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var useFetchNeetoApps = function useFetchNeetoApps(options) {
  return useQuery(_objectSpread$7({
    queryKey: [QUERY_KEYS$1.NEETO_APPS_LIST],
    queryFn: neetoAppsApi.fetch
  }, options));
};

var useProductSwitcherNavigation = function useProductSwitcherNavigation() {
  var filteredApps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  var _useState = useState(0),
    _useState2 = _slicedToArray(_useState, 2),
    highlightedIndex = _useState2[0],
    setHighlightedIndex = _useState2[1];
  var scrollContainerRef = useRef(null);
  useEffect(function () {
    return setHighlightedIndex(0);
  }, [filteredApps]);
  useEffect(function () {
    if (!scrollContainerRef.current || isEmpty(filteredApps)) return;
    var container = scrollContainerRef.current;
    var highlightedElement = container.querySelector("[data-highlighted-index=\"".concat(highlightedIndex, "\"]"));
    if (!highlightedElement) return;
    var containerRect = container.getBoundingClientRect();
    var elRect = highlightedElement.getBoundingClientRect();
    if (elRect.top < containerRect.top) {
      container.scrollTop += elRect.top - containerRect.top;
    } else if (elRect.bottom > containerRect.bottom) {
      container.scrollTop += elRect.bottom - containerRect.bottom;
    }
  }, [highlightedIndex, filteredApps]);
  var getColumnsPerRow = function getColumnsPerRow() {
    var width = window.innerWidth;
    if (width < 768) return 1;
    if (width < 1024) return 2;
    if (width < 1536) return 3;
    return 4;
  };
  var handleOpenHighlightedApp = function handleOpenHighlightedApp() {
    var app = filteredApps[highlightedIndex];
    if (!(app !== null && app !== void 0 && app.url)) return;
    window.open(app.url, "_blank", "noopener,noreferrer");
  };
  var navigationHandlers = {
    left: function left(prev) {
      return prev === 0 ? filteredApps.length - 1 : prev - 1;
    },
    right: function right(prev) {
      return prev === filteredApps.length - 1 ? 0 : prev + 1;
    },
    up: function up(prev) {
      var columnsPerRow = getColumnsPerRow();
      var newIndex = prev - columnsPerRow;
      if (newIndex >= 0) return newIndex;
      var currentCol = prev % columnsPerRow;
      var lastIndex = filteredApps.length - 1;
      return lastIndex - (lastIndex - currentCol) % columnsPerRow;
    },
    down: function down(prev) {
      var columnsPerRow = getColumnsPerRow();
      var newIndex = prev + columnsPerRow;
      if (newIndex < filteredApps.length) return newIndex;
      return prev % columnsPerRow;
    }
  };
  var keyActions = {
    Enter: handleOpenHighlightedApp,
    ArrowLeft: function ArrowLeft() {
      return setHighlightedIndex(navigationHandlers["left"]);
    },
    ArrowRight: function ArrowRight() {
      return setHighlightedIndex(navigationHandlers["right"]);
    },
    ArrowUp: function ArrowUp() {
      return setHighlightedIndex(navigationHandlers["up"]);
    },
    ArrowDown: function ArrowDown() {
      return setHighlightedIndex(navigationHandlers["down"]);
    },
    Tab: function Tab(e) {
      return setHighlightedIndex(navigationHandlers[e.shiftKey ? "left" : "right"]);
    }
  };
  var handleKeyDown = function handleKeyDown(e) {
    var action = keyActions[e.key];
    if (!action) return;
    e.preventDefault();
    e.stopPropagation();
    if (isNotEmpty(filteredApps)) action(e);
  };
  return {
    highlightedIndex: highlightedIndex,
    handleKeyDown: handleKeyDown,
    scrollContainerRef: scrollContainerRef
  };
};

var Menu$5 = function Menu(_ref) {
  var _ref$isMobile = _ref.isMobile,
    isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile,
    initialFocusRef = _ref.initialFocusRef;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useState = useState(""),
    _useState2 = _slicedToArray(_useState, 2),
    searchTerm = _useState2[0],
    setSearchTerm = _useState2[1];
  var _useFetchNeetoApps = useFetchNeetoApps(),
    data = _useFetchNeetoApps.data,
    isLoading = _useFetchNeetoApps.isLoading;
  var substring = searchTerm.replace(/ /g, "").toLowerCase();
  var filteredApps = useMemo(function () {
    if (!data) return [];
    return data === null || data === void 0 ? void 0 : data.neetoApps.filter(function (_ref2) {
      var name = _ref2.name;
      var nameLower = name.toLowerCase();
      var searchTermLower = substring.toLowerCase();
      var isNeetoPrefixMatch = searchTermLower.length <= 4 && "neeto".startsWith(searchTermLower);
      if (isNeetoPrefixMatch) return true;
      var productName = searchTermLower.startsWith("neeto") ? searchTermLower.replace("neeto", "") : searchTermLower;
      return nameLower.includes(productName);
    });
  }, [data, substring]);
  var _useProductSwitcherNa = useProductSwitcherNavigation(filteredApps),
    highlightedIndex = _useProductSwitcherNa.highlightedIndex,
    handleKeyDown = _useProductSwitcherNa.handleKeyDown,
    scrollContainerRef = _useProductSwitcherNa.scrollContainerRef;
  return /*#__PURE__*/jsxs("div", {
    className: "neeto-molecules-product-switcher__wrapper",
    "data-testid": "switcher-wrapper",
    children: [/*#__PURE__*/jsxs("div", {
      "data-testid": "product-switcher-body-wrapper",
      className: classnames("neeto-molecules-product-switcher__header pt-1", {
        "neeto-molecules-product-switcher__header-mobile": isMobile
      }),
      children: [!isMobile && /*#__PURE__*/jsx(Typography, {
        style: "h1",
        children: t("neetoMolecules.productSwitcher.chooseNeetoProduct")
      }), /*#__PURE__*/jsx("div", {
        className: "neeto-molecules-product-switcher__search-wrapper",
        children: /*#__PURE__*/jsx(Input, {
          autoFocus: true,
          "data-testid": "product-switcher-search-input",
          placeholder: t("neetoMolecules.productSwitcher.searchProducts"),
          prefix: /*#__PURE__*/jsx(Search, {}),
          ref: initialFocusRef,
          size: "large",
          type: "search",
          value: searchTerm,
          onChange: function onChange(e) {
            return setSearchTerm(e.target.value);
          },
          onKeyDown: handleKeyDown
        })
      })]
    }), /*#__PURE__*/jsx("div", {
      ref: scrollContainerRef,
      className: classnames("neeto-molecules-product-switcher__body", _defineProperty({}, "neeto-molecules-product-switcher__body-mobile", isMobile)),
      children: /*#__PURE__*/jsx(Content, {
        filteredApps: filteredApps,
        highlightedIndex: highlightedIndex,
        isLoading: isLoading
      })
    })]
  }, "switcher-wrapper");
};

var Modal = function Modal(_ref) {
  var isOpen = _ref.isOpen,
    onClose = _ref.onClose;
  var initialFocusRef = useRef(null);
  return /*#__PURE__*/jsx(Modal$1, {
    initialFocusRef: initialFocusRef,
    isOpen: isOpen,
    onClose: onClose,
    backdropClassName: "neeto-molecules-product-switcher_modal",
    size: "large",
    children: /*#__PURE__*/jsx(Modal$1.Body, {
      children: /*#__PURE__*/jsx("div", {
        className: "neeto-molecules-product-switcher_modal-container",
        "data-testid": "product-switcher-modal",
        children: /*#__PURE__*/jsx(Menu$5, {
          initialFocusRef: initialFocusRef
        })
      })
    })
  });
};

var _excluded$3 = ["t", "tReady"];
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var MenuItem$9 = Dropdown$1.MenuItem;
var MenuButton$4 = withT(function (_ref) {
  var t = _ref.t;
    _ref.tReady;
    var otherProps = _objectWithoutProperties(_ref, _excluded$3);
  return /*#__PURE__*/jsx(MenuItem$9.Button, _objectSpread$6(_objectSpread$6({
    className: "neeto-molecules-menu-sublist__item-btn",
    "data-testid": "help-menu-button",
    prefix: /*#__PURE__*/jsx(Help, {
      size: 18
    }),
    style: "text",
    suffix: /*#__PURE__*/jsx(Right, {
      className: "rtl:scale-x-[-1]",
      size: 18
    })
  }, otherProps), {}, {
    children: t("neetoMolecules.sidebar.help")
  }));
});

var Menu$4 = Dropdown$1.Menu,
  MenuItem$8 = Dropdown$1.MenuItem;
var HelpMenu = function HelpMenu() {
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useBreakpoints = useBreakpoints(),
    isSize = _useBreakpoints.isSize;
  var isMobile = isSize("mobile");
  return /*#__PURE__*/jsx(Dropdown$1, {
    closeOnSelect: false,
    customTarget: /*#__PURE__*/jsx(MenuButton$4, {}),
    interactiveDebounce: 30,
    offset: [0, 5],
    position: isMobile ? "bottom" : "right",
    trigger: "all",
    zIndex: 99999,
    children: /*#__PURE__*/jsxs(Menu$4, {
      children: [/*#__PURE__*/jsx(MenuItem$8.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "help-link-help-articles-button",
        href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
        prefix: /*#__PURE__*/jsx(Book, {
          size: 18
        }),
        rel: "noreferrer",
        target: "_blank",
        children: t("neetoMolecules.sidebar.helpLinks.helpArticles")
      }), /*#__PURE__*/jsx(MenuItem$8.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "help-link-live-chat-button",
        prefix: /*#__PURE__*/jsx(ChatQuestions, {
          size: 18
        }),
        onClick: function onClick() {
          var _window$NeetoChat, _window$NeetoChat2;
          (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
          (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
        },
        children: t("neetoMolecules.sidebar.helpLinks.liveChat")
      }), /*#__PURE__*/jsx(MenuItem$8.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "help-link-community-button",
        href: "https://www.launchpass.com/neetohq",
        prefix: /*#__PURE__*/jsx(Community, {
          size: 18
        }),
        rel: "noreferrer",
        target: "_blank",
        children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
      }), /*#__PURE__*/jsx(MenuItem$8.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "help-link-status-button",
        href: "https://neetostatus.com/",
        prefix: /*#__PURE__*/jsx(Status, {
          size: 18
        }),
        rel: "noreferrer",
        target: "_blank",
        children: t("neetoMolecules.sidebar.helpLinks.systemStatus")
      })]
    })
  });
};

var _excluded$2 = ["label", "icon", "changesCount"];
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var LinkSection = function LinkSection(_ref) {
  var links = _ref.links;
  var MenuItem = Dropdown$1.MenuItem;
  if (isNotPresent(links)) return null;
  return /*#__PURE__*/jsx(Fragment, {
    children: links.map(function (_ref2, idx) {
      var label = _ref2.label,
        Icon = _ref2.icon,
        changesCount = _ref2.changesCount,
        otherProps = _objectWithoutProperties(_ref2, _excluded$2);
      return /*#__PURE__*/jsxs(MenuItem.Button, _objectSpread$5(_objectSpread$5({
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "floating-action-menu-link-section",
        prefix: Icon && /*#__PURE__*/jsx(Icon, {
          size: 18
        }),
        style: "text"
      }, otherProps), {}, {
        children: [label, isPresent(changesCount) && /*#__PURE__*/jsx("span", {
          className: "neeto-molecules-menu-list__item-btn-count",
          "data-testid": "help-section-menu-changes-count",
          children: changesCount
        })]
      }), idx);
    })
  });
};

var fetch = function fetch(email) {
  return axios.get("/logged_in_organizations", {
    params: {
      email: email
    }
  });
};
var loggedInOrganizationsApi = {
  fetch: fetch
};

var QUERY_KEYS = {
  LOGGED_IN_ORGANIZATIONS_LIST: "logged-in-organizations-list"
};

var LOGGED_IN_ORGANIZATIONS_LIST = QUERY_KEYS.LOGGED_IN_ORGANIZATIONS_LIST;
var useFetchLoggedInOrganizations = function useFetchLoggedInOrganizations(email) {
  return useQuery({
    queryKey: [LOGGED_IN_ORGANIZATIONS_LIST],
    queryFn: function queryFn() {
      return loggedInOrganizationsApi.fetch(email);
    }
  });
};

var MenuItem$7 = Dropdown$1.MenuItem;
var MenuButton$3 = withT(function (_ref) {
  var t = _ref.t;
  return /*#__PURE__*/jsx(MenuItem$7.Button, {
    className: "neeto-molecules-menu-sublist__item-btn",
    "data-testid": "organization-switcher-button",
    style: "text",
    suffix: /*#__PURE__*/jsx(Right, {
      className: "rtl:scale-x-[-1]",
      size: 18
    }),
    children: t("neetoMolecules.sidebar.organizationSwitcher.label")
  });
});

var Menu$3 = Dropdown$1.Menu,
  MenuItem$6 = Dropdown$1.MenuItem;
var OrganizationSwitcher = function OrganizationSwitcher() {
  var _globalProps$user;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useBreakpoints = useBreakpoints(),
    isSize = _useBreakpoints.isSize;
  var _useFetchLoggedInOrga = useFetchLoggedInOrganizations(globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email),
    _useFetchLoggedInOrga2 = _useFetchLoggedInOrga.data,
    _useFetchLoggedInOrga3 = _useFetchLoggedInOrga2 === void 0 ? {} : _useFetchLoggedInOrga2,
    organizations = _useFetchLoggedInOrga3.organizations,
    authAppUrl = _useFetchLoggedInOrga3.authAppUrl;
  var isMobile = isSize("mobile");
  var isCurrentSubdomain = function isCurrentSubdomain(link) {
    var currentSubdomain = window.location.hostname.split(".")[0];
    var linkSubdomain = new URL(link).hostname.split(".")[0];
    return currentSubdomain === linkSubdomain;
  };
  return /*#__PURE__*/jsx(Dropdown$1, {
    className: "neeto-molecules-organization-switcher-menu-popup-wrapper",
    closeOnSelect: false,
    customTarget: /*#__PURE__*/jsx(MenuButton$3, {}),
    interactiveDebounce: 30,
    offset: [0, 5],
    position: isMobile ? "bottom" : "right",
    trigger: "all",
    zIndex: 99999,
    children: /*#__PURE__*/jsxs(Menu$3, {
      children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
        return /*#__PURE__*/jsxs(MenuItem$6.Button, {
          href: organization.organizationUrl,
          rel: "noreferrer",
          style: "text",
          target: "_blank",
          className: classnames({
            "neeto-molecules-organization-switcher-active-button": isCurrentSubdomain(organization.organizationUrl)
          }),
          children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsx(Tag, {
            icon: function icon() {
              return /*#__PURE__*/jsx(CheckCircle, {
                size: 12
              });
            },
            size: "small",
            style: "primary",
            type: "solid",
            children: t("neetoMolecules.sidebar.organizationSwitcher.signedin")
          })]
        }, organization.userId);
      }), /*#__PURE__*/jsx(MenuItem$6.Button, {
        href: authAppUrl,
        rel: "noreferrer",
        target: "_blank",
        children: t("neetoMolecules.sidebar.organizationSwitcher.addAccount")
      })]
    })
  });
};

function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var MenuButton$2 = function MenuButton(_ref) {
  var otherProps = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var MenuItem = Dropdown$1.MenuItem;
  return /*#__PURE__*/jsx(MenuItem.Button, _objectSpread$4(_objectSpread$4({
    className: "neeto-molecules-menu-sublist__item-btn",
    "data-testid": "product-switcher-button",
    label: t("neetoMolecules.sidebar.productSwitcher"),
    style: "text",
    suffix: /*#__PURE__*/jsx(Right, {
      className: "rtl:scale-x-[-1]",
      size: 18
    })
  }, otherProps), {}, {
    children: t("neetoMolecules.sidebar.productSwitcher")
  }));
};

var Menu$2 = Dropdown$1.Menu,
  MenuItem$5 = Dropdown$1.MenuItem;
var Dropdown = function Dropdown() {
  return /*#__PURE__*/jsx(Dropdown$1, {
    appendTo: "parent",
    className: "neeto-molecules-product-switcher-menu-popup-wrapper",
    closeOnSelect: false,
    customTarget: /*#__PURE__*/jsx(MenuButton$2, {}),
    interactiveDebounce: 30,
    offset: [0, 5],
    position: "right",
    trigger: "all",
    zIndex: 99999,
    dropdownProps: {
      classNames: "neeto-molecules-product-switcher-menu-popup__dropdown"
    },
    children: /*#__PURE__*/jsx(Menu$2, {
      children: /*#__PURE__*/jsx(MenuItem$5, {
        children: /*#__PURE__*/jsx(Menu$5, {})
      })
    })
  });
};

var ProductSwitcher = function ProductSwitcher(_ref) {
  var toggleModal = _ref.toggleModal;
  var _useBreakpoints = useBreakpoints(),
    isSize = _useBreakpoints.isSize;
  var isMobile = isSize("mobile");
  return isMobile ? /*#__PURE__*/jsx(MenuButton$2, {
    onClick: function onClick() {
      return toggleModal(true);
    }
  }) : /*#__PURE__*/jsx(Dropdown, {});
};

var ProfileHeader = function ProfileHeader(_ref) {
  var profileInfo = _ref.profileInfo;
  var name = profileInfo.name,
    email = profileInfo.email;
  return /*#__PURE__*/jsxs("span", {
    className: "flex w-full min-w-0 items-center gap-2 text-start",
    "data-testid": "floating-action-menu-profile-header",
    children: [/*#__PURE__*/jsx(Avatar, {
      "data-testid": "floating-action-menu-header-profile-icon",
      size: "medium",
      user: profileInfo
    }), /*#__PURE__*/jsxs("span", {
      className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-grow neeto-ui-min-w-0 gap-1",
      children: [/*#__PURE__*/jsx(Typography, {
        className: "neeto-ui-m-0",
        component: "span",
        "data-testid": "floating-action-menu-header-user-name",
        lineHeight: "tight",
        style: "h5",
        title: name,
        weight: "semibold",
        children: truncate(name, 18)
      }), email && /*#__PURE__*/jsx(Typography, {
        className: "neeto-ui-w-full neeto-ui-truncate neeto-ui-text-gray-500",
        component: "span",
        "data-testid": "floating-action-menu-header-user-email",
        lineHeight: "tight",
        style: "body3",
        children: email
      })]
    })]
  });
};

var _excluded$1 = ["profileInfo"];
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var MenuItem$4 = Dropdown$1.MenuItem;
var MenuButton$1 = function MenuButton(_ref) {
  var profileInfo = _ref.profileInfo,
    otherProps = _objectWithoutProperties(_ref, _excluded$1);
  return /*#__PURE__*/jsx(MenuItem$4.Button, _objectSpread$3(_objectSpread$3({
    className: "neeto-molecules-profile-popup",
    "data-testid": "profile-expand-menu-button",
    suffix: /*#__PURE__*/jsx(Right, {
      className: "rtl:scale-x-[-1]",
      size: 18
    })
  }, otherProps), {}, {
    children: /*#__PURE__*/jsx(ProfileHeader, {
      profileInfo: profileInfo
    })
  }));
};

var MY_ORGANIZATION_URL = "/auth/organization/edit";
var DELETE_WORKSPACE_URL = "/auth/organization/delete";
var ENGAGE_WIDGET_TRIGGER_ID = "neetoengage-trigger";
var DEFAULT_MENU_LINK_PROPS = {
  engageProps: {
    id: ENGAGE_WIDGET_TRIGGER_ID,
    label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
    "data-testid": "help-link-engage-button"
  },
  keyboardShortcutProps: {
    label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
    "data-testid": "help-link-keyboard-shortcut-button"
  }
};

// Theme switcher
var APP_THEME_LOCALSTORAGE_KEY = "appTheme";
var THEMES = {
  LIGHT: "neeto-ui-theme--light",
  DARK: "neeto-ui-theme--dark"
};
var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";

var Menu$1 = Dropdown$1.Menu,
  MenuItem$3 = Dropdown$1.MenuItem;
var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
  var _window$globalProps;
  var profileInfo = _ref.profileInfo;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useBreakpoints = useBreakpoints(),
    isSize = _useBreakpoints.isSize;
  var _Profile$usePaneState = Profile.usePaneState(),
    _Profile$usePaneState2 = _slicedToArray(_Profile$usePaneState, 2),
    setIsProfilePaneOpen = _Profile$usePaneState2[1];
  var isMobile = isSize("mobile");
  return /*#__PURE__*/jsx(Dropdown$1, {
    closeOnSelect: false,
    customTarget: /*#__PURE__*/jsx(MenuButton$1, {
      profileInfo: profileInfo
    }),
    interactiveDebounce: 30,
    offset: [0, 5],
    position: isMobile ? "bottom" : "right",
    trigger: "all",
    zIndex: 99999,
    children: /*#__PURE__*/jsxs(Menu$1, {
      children: [/*#__PURE__*/jsx(MenuItem$3.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "profile-my-profile-button",
        prefix: /*#__PURE__*/jsx(User, {
          size: 18
        }),
        onClick: function onClick() {
          return setIsProfilePaneOpen(true);
        },
        children: t("neetoMolecules.sidebar.myProfile")
      }), ((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 || (_window$globalProps = _window$globalProps.user) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.isOwner) && /*#__PURE__*/jsx(MenuItem$3.Button, {
        className: "neeto-molecules-menu-sublist__item-btn",
        "data-testid": "profile-cancel-account-button",
        href: DELETE_WORKSPACE_URL,
        prefix: /*#__PURE__*/jsx(CloseCircle, {
          size: 18
        }),
        rel: "noreferrer",
        style: "text",
        target: "_blank",
        children: t("neetoMolecules.sidebar.cancelAccount")
      })]
    })
  });
};

var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
  var _globalProps$user, _globalProps$user2;
  var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
  return "sidebarState-".concat(user);
};
var getUserProfileInfo = function getUserProfileInfo() {
  var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
  return {
    name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
    imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
    email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
    isAuthenticated: globalProps.authenticated
  };
};
var getConsumerProfileInfo = function getConsumerProfileInfo() {
  var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
  return {
    name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
    imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
    email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
    isAuthenticated: globalProps.isConsumer
  };
};
var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
  return [isAuthenticated ? {
    label: t("neetoMolecules.sidebar.logout"),
    icon: Logout,
    onClick: function onClick() {
      resetAuthTokens();
      removeFromLocalStorage(getSidebarStateLocalStorageKey());
      isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
    },
    "data-testid": "profile-logout-button"
  } : {
    label: t("neetoMolecules.sidebar.login"),
    onClick: function onClick() {
      window.location.href = "/login";
    },
    "data-testid": "profile-login-button"
  }];
};
var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
  return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
};

// Theme switcher utils.
var setDarkTheme = function setDarkTheme() {
  if (!document.body) return;
  document.body.classList.remove(THEMES.LIGHT);
  document.body.classList.add(THEMES.DARK);
};
var setLightTheme = function setLightTheme() {
  if (!document.body) return;
  document.body.classList.remove(THEMES.DARK);
  document.body.classList.add(THEMES.LIGHT);
};
var setAppTheme = function setAppTheme() {
  var isDarkTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY) === THEMES.DARK;
  isDarkTheme ? setDarkTheme() : setLightTheme();
};

var MenuItem$2 = Dropdown$1.MenuItem;
var ThemeSwitcher = function ThemeSwitcher() {
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useLocalStorage = useLocalStorage(APP_THEME_LOCALSTORAGE_KEY, THEMES.LIGHT),
    _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
    appTheme = _useLocalStorage2[0],
    setAppTheme = _useLocalStorage2[1];
  var isDarkThemeSelected = appTheme === THEMES.DARK;
  var switchTheme = function switchTheme(theme) {
    theme === THEMES.LIGHT ? setLightTheme() : setDarkTheme();
    setAppTheme(theme);
  };
  return /*#__PURE__*/jsxs(MenuItem$2, {
    className: "neeto-molecules-theme-switcher flex items-center justify-between gap-2 px-5 py-3",
    children: [/*#__PURE__*/jsx("div", {
      className: "neeto-molecules-theme-switcher__label",
      children: t("neetoMolecules.sidebar.themeSwitcher.label")
    }), /*#__PURE__*/jsxs("div", {
      className: "neeto-molecules-theme-switcher__segmented-control",
      "data-testid": "theme-switcher-button",
      children: [/*#__PURE__*/jsxs("button", {
        "data-testid": "theme-switcher-light-button",
        type: "button",
        className: classnames("neeto-molecules-theme-switcher__option", {
          "neeto-molecules-theme-switcher__option--active": !isDarkThemeSelected
        }),
        onClick: function onClick() {
          return switchTheme(THEMES.LIGHT);
        },
        children: [/*#__PURE__*/jsx(Sun, {
          size: 18
        }), t("neetoMolecules.sidebar.themeSwitcher.light")]
      }), /*#__PURE__*/jsxs("button", {
        "data-testid": "theme-switcher-dark-button",
        type: "button",
        className: classnames("neeto-molecules-theme-switcher__option", {
          "neeto-molecules-theme-switcher__option--active": isDarkThemeSelected
        }),
        onClick: function onClick() {
          return switchTheme(THEMES.DARK);
        },
        children: [/*#__PURE__*/jsx(Moon, {
          size: 18
        }), t("neetoMolecules.sidebar.themeSwitcher.dark")]
      })]
    })]
  });
};

var MenuItem$1 = Dropdown$1.MenuItem;
var MenuButton = withT(function (_ref) {
  var _globalProps$organiza;
  var t = _ref.t;
  return /*#__PURE__*/jsx(MenuItem$1.Button, {
    className: "neeto-molecules-workspace-display",
    "data-testid": "workspace-display",
    style: "text",
    suffix: /*#__PURE__*/jsx(Right, {
      className: "rtl:scale-x-[-1]",
      size: 18
    }),
    children: /*#__PURE__*/jsxs("span", {
      className: "neeto-molecules-workspace-display__content flex flex-col gap-1.5 text-start",
      children: [/*#__PURE__*/jsx(Typography, {
        className: "neeto-molecules-workspace-display__label",
        component: "span",
        style: "body2",
        weight: "medium",
        children: t("neetoMolecules.sidebar.workspace")
      }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsx(Typography, {
        className: "neeto-molecules-workspace-display__name neeto-ui-text-gray-500",
        component: "span",
        style: "body3",
        children: globalProps$1.organization.name
      })]
    })
  });
});

var Menu = Dropdown$1.Menu,
  MenuItem = Dropdown$1.MenuItem;
var WorkspaceMenu = function WorkspaceMenu() {
  var _globalProps$organiza;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useBreakpoints = useBreakpoints(),
    isSize = _useBreakpoints.isSize;
  var isMobile = isSize("mobile");
  return /*#__PURE__*/jsx(Dropdown$1, {
    className: "neeto-molecules-organization-menu-popup-wrapper",
    closeOnSelect: false,
    customTarget: /*#__PURE__*/jsx(MenuButton, {}),
    interactiveDebounce: 30,
    offset: [0, 5],
    position: isMobile ? "bottom" : "right",
    trigger: "all",
    zIndex: 99999,
    children: /*#__PURE__*/jsxs(Menu, {
      children: [/*#__PURE__*/jsx(MenuItem.Button, {
        "data-testid": "profile-organization-settings-button",
        href: MY_ORGANIZATION_URL,
        rel: "noreferrer",
        target: "_blank",
        children: t("neetoMolecules.sidebar.workspaceMenu.settings")
      }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain) && /*#__PURE__*/jsx(MenuItem, {
        className: "px-6 py-2",
        children: /*#__PURE__*/jsxs("span", {
          className: "neeto-molecules-workspace-display__content flex flex-col gap-0.5 text-start",
          children: [/*#__PURE__*/jsx(Typography, {
            className: "neeto-molecules-workspace-display__label",
            component: "span",
            style: "body2",
            weight: "medium",
            children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
          }), /*#__PURE__*/jsxs(Typography, {
            className: "neeto-molecules-workspace-display__name neeto-ui-text-gray-500 flex items-center gap-1",
            component: "span",
            style: "body3",
            children: [/*#__PURE__*/jsx("span", {
              className: "min-w-0 truncate",
              children: globalProps$1.organization.subdomain
            }), /*#__PURE__*/jsx(CopyToClipboardButton, {
              className: "flex-shrink-0",
              size: "small",
              style: "text",
              value: globalProps$1.organization.subdomain
            })]
          })]
        })
      })]
    })
  });
};

function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var ProfileMenu = function ProfileMenu(_ref) {
  var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4;
  var profileInfo = _ref.profileInfo,
    showProductSwitcher = _ref.showProductSwitcher,
    defaultLinks = _ref.defaultLinks,
    topLinks = _ref.topLinks,
    bottomLinks = _ref.bottomLinks,
    customContent = _ref.customContent,
    toggleModal = _ref.toggleModal,
    isThemeSwitcherEnabled = _ref.isThemeSwitcherEnabled,
    isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
    isConsumer = _ref.isConsumer,
    enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest,
    openUpgradeModal = _ref.openUpgradeModal;
  var Menu = Dropdown$1.Menu,
    MenuItem = Dropdown$1.MenuItem,
    Divider = Dropdown$1.Divider;
  var isAuthenticated = profileInfo.isAuthenticated;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var normalizedPlan = (((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan) || "").toLowerCase();
  var isFreePlan = normalizedPlan === "free";
  var showUpgradeAction = isFreePlan && enableSubscriptionUpgradeRequest;
  var subscriptionPlanLink = _objectSpread$2({
    label: /*#__PURE__*/jsxs(Fragment, {
      children: [globalProps.appName, " ", /*#__PURE__*/jsx("span", {
        className: classnames("neeto-molecules-subscription-plan-badge flex items-center gap-1", {
          "neeto-molecules-subscription-plan-badge--pro": normalizedPlan === "pro",
          "neeto-molecules-subscription-plan-badge--free": isFreePlan
        }),
        children: normalizedPlan === "pro" ? humanize((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.subscriptionPlan) : /*#__PURE__*/jsxs(Fragment, {
          children: [/*#__PURE__*/jsx(Crown, {
            size: 12
          }), t("neetoMolecules.sidebar.upgradePlan")]
        })
      })]
    }),
    "data-testid": "subscription-plan"
  }, showUpgradeAction ? {
    onClick: openUpgradeModal
  } : {
    href: NEETO_AUTH_BILLING_INFO_URL
  });
  return /*#__PURE__*/jsxs(Menu, {
    className: "pb-1",
    children: [!isConsumer && /*#__PURE__*/jsxs(Fragment, {
      children: [/*#__PURE__*/jsx(LinkSection, {
        links: defaultLinks
      }), isNotEmpty(topLinks) && /*#__PURE__*/jsxs(Fragment, {
        children: [/*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(LinkSection, {
          links: topLinks
        })]
      }), isPresent(customContent) && /*#__PURE__*/jsxs(Fragment, {
        children: [/*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(MenuItem, {
          className: "neeto-molecules-floating-action-button__profile-wrapper-custom-content",
          children: customContent
        })]
      }), /*#__PURE__*/jsx(Divider, {}), ((_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.isOwner) && /*#__PURE__*/jsx(WorkspaceMenu, {}), isOrganizationSwitcherEnabled && /*#__PURE__*/jsx(OrganizationSwitcher, {}), /*#__PURE__*/jsx(Divider, {}), isPresent((_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.subscriptionPlan) && /*#__PURE__*/jsx(LinkSection, {
        links: [subscriptionPlanLink]
      }), showProductSwitcher && /*#__PURE__*/jsx(ProductSwitcher, {
        toggleModal: toggleModal
      }), /*#__PURE__*/jsx(HelpMenu, {}), /*#__PURE__*/jsx(Divider, {})]
    }), isAuthenticated && /*#__PURE__*/jsx(ProfileExpandMenu, {
      profileInfo: profileInfo
    }), /*#__PURE__*/jsx(LinkSection, {
      links: bottomLinks
    }), isThemeSwitcherEnabled && /*#__PURE__*/jsxs(Fragment, {
      children: [/*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(ThemeSwitcher, {})]
    })]
  });
};

function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var ProfileButton = function ProfileButton(_ref) {
  var profileInfoOverrides = _ref.profileInfoOverrides,
    showProductSwitcher = _ref.showProductSwitcher,
    bottomLinks = _ref.bottomLinks,
    topLinks = _ref.topLinks,
    customContent = _ref.customContent,
    isThemeSwitcherEnabled = _ref.isThemeSwitcherEnabled,
    isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
    profilePopoverProps = _ref.profilePopoverProps,
    isConsumer = _ref.isConsumer,
    enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest;
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    isModalOpen = _useState2[0],
    setIsModalOpen = _useState2[1];
  var _useState3 = useState(false),
    _useState4 = _slicedToArray(_useState3, 2),
    isUpgradeModalOpen = _useState4[0],
    setIsUpgradeModalOpen = _useState4[1];
  var _useState5 = useState(false),
    _useState6 = _slicedToArray(_useState5, 2),
    isBackdropVisible = _useState6[0],
    setIsBackdropVisible = _useState6[1];
  var _useState7 = useState(null),
    _useState8 = _slicedToArray(_useState7, 2),
    changesCount = _useState8[0],
    setChangesCount = _useState8[1];
  var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
    _KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
    setIsOpen = _KeyboardShortcuts$us2[1];
  useHotkeys(["ctrl+u", "command+u"], function () {
    return setIsModalOpen(not);
  }, {
    mode: "global"
  });
  var profileInfo = getProfileInfo(profileInfoOverrides, isConsumer);
  useEffect(function () {
    var Nv = {
      onReceiveData: function onReceiveData(data) {
        if (!data.unreadCount) return;
        setChangesCount(data.unreadCount);
      },
      onShow: function onShow() {
        setChangesCount(null);
      }
    };
    window.Nv = window.Nv ? Object.assign(window.Nv, Nv) : Nv;
  }, []);
  var newBottomLinks = [].concat(_toConsumableArray(getDefaultBottomLinks(profileInfo.isAuthenticated, isConsumer)), _toConsumableArray(bottomLinks));
  var defaultLinks = Object.keys(DEFAULT_MENU_LINK_PROPS).map(function (key) {
    return _objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_MENU_LINK_PROPS[key]), key === "keyboardShortcutProps" && {
      onClick: function onClick() {
        return setIsOpen(function (prev) {
          return !prev;
        });
      }
    }), key === "engageProps" && changesCount && {
      changesCount: changesCount
    });
  }).filter(function (_ref2) {
    var hide = _ref2.hide;
    return !hide;
  });
  return /*#__PURE__*/jsxs(Fragment, {
    children: [/*#__PURE__*/jsx(Profile.Pane, {
      popoverProps: profilePopoverProps
    }), isBackdropVisible && /*#__PURE__*/jsx("div", {
      className: "neeto-molecules-floating-action-button__backdrop"
    }), /*#__PURE__*/jsx(Dropdown$1, {
      appendTo: function appendTo() {
        return document.body;
      },
      buttonStyle: "link",
      closeOnSelect: false,
      icon: noop,
      interactiveDebounce: 30,
      offset: [4, 4],
      position: "right-end",
      strategy: "fixed",
      theme: "light neeto-molecules-floating-action-outer-dropdown-wrapper",
      trigger: "all",
      zIndex: 99999,
      customTarget: /*#__PURE__*/jsxs("button", {
        className: "neeto-molecules-floating-action-button",
        type: "button",
        children: [/*#__PURE__*/jsx(Avatar, {
          className: "neeto-ui-flex-shrink-0 neeto-molecules-floating-action-button__profile-avatar",
          "data-testid": "profile-avatar",
          size: "medium",
          user: profileInfo
        }), /*#__PURE__*/jsx("span", {
          className: "neeto-molecules-floating-action-button__help-icon",
          children: /*#__PURE__*/jsx(Help, {
            size: 20
          })
        })]
      }),
      dropdownProps: {
        classNames: "neeto-molecules-floating-action-button__dropdown"
      },
      onHide: function onHide() {
        return setIsBackdropVisible(false);
      },
      onShow: function onShow() {
        return setIsBackdropVisible(true);
      },
      children: /*#__PURE__*/jsx(ProfileMenu, {
        customContent: customContent,
        defaultLinks: defaultLinks,
        enableSubscriptionUpgradeRequest: enableSubscriptionUpgradeRequest,
        isConsumer: isConsumer,
        isOrganizationSwitcherEnabled: isOrganizationSwitcherEnabled,
        isThemeSwitcherEnabled: isThemeSwitcherEnabled,
        profileInfo: profileInfo,
        showProductSwitcher: showProductSwitcher,
        topLinks: topLinks,
        bottomLinks: newBottomLinks,
        openUpgradeModal: function openUpgradeModal() {
          return setIsUpgradeModalOpen(true);
        },
        toggleModal: setIsModalOpen
      })
    }), isPresent(changesCount) && /*#__PURE__*/jsx("span", {
      className: "neeto-molecules-menu__notif-count",
      "data-testid": "help-icon-changes-count",
      children: changesCount
    }), /*#__PURE__*/jsx(Modal, {
      isOpen: isModalOpen,
      onClose: function onClose() {
        return setIsModalOpen(false);
      }
    }), enableSubscriptionUpgradeRequest && /*#__PURE__*/jsx(SubscriptionUpgradeRequestModal, {
      isOpen: isUpgradeModalOpen,
      onClose: function onClose() {
        return setIsUpgradeModalOpen(false);
      }
    })]
  });
};

var css = ":root{--neeto-molecules-floating-menu-z-index:99999}.neeto-molecules-floating-action-menu__container{background-color:rgb(var(--neeto-ui-white));border:1px solid rgb(var(--neeto-ui-white));border-end-end-radius:1.0625rem;border-inline-start:none;border-start-end-radius:1.0625rem;bottom:16px;inset-inline-start:0;position:fixed;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-color:rgb(var(--neeto-ui-primary-500));border-end-end-radius:1rem;border-start-end-radius:1rem;display:flex;flex-direction:column;gap:.375rem;justify-content:center;padding:.25rem}.neeto-molecules-floating-action-button__help-icon{align-items:center;background-color:#fff;border-radius:6.25rem;display:flex;height:1.625rem;justify-content:center;width:1.625rem}.neeto-molecules-floating-action-button__profile-avatar{--neeto-ui-avatar-container-width:1.625rem;--neeto-ui-avatar-container-height:1.625rem;border:2px solid #fff;border-radius:6.25rem}.neeto-molecules-floating-action-button__profile-avatar>div{height:100%;width:100%}.neeto-molecules-floating-action-button__profile-avatar .neeto-ui-avatar{height:100%!important;width:100%!important}.neeto-molecules-floating-action-button__dropdown{--neeto-ui-dropdown-divider-margin:0.5rem;--neeto-ui-dropdown-item-border-radius:0.25rem;flex-shrink:0;max-height:95vh!important;max-width:none;width:16rem;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button__dropdown .neeto-ui-dropdown__popup-menu{padding-bottom:.75rem!important;padding-top:.75rem!important}.neeto-molecules-floating-action-button__dropdown.neeto-ui-dropdown__popup .neeto-ui-dropdown__popup-menu-item{background-color:transparent!important;padding-left:.75rem;padding-right:.75rem}.neeto-molecules-floating-action-button__backdrop{background-color:rgba(var(--neeto-ui-black),.27);height:100%;left:0;pointer-events:none;position:fixed;top:0;width:100%;z-index:99998;z-index:calc(var(--neeto-molecules-floating-menu-z-index) - 1)}.neeto-molecules-product-switcher-menu-popup__dropdown{max-height:none!important;max-width:none}.neeto-molecules-menu__notif-count{border:1px solid #fff;height:.9375rem;inset-inline-end:0;min-width:.9375rem;pointer-events:none;position:absolute;top:0;z-index:3}.neeto-molecules-menu-list__item-btn-count,.neeto-molecules-menu__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-accent-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);justify-content:center;padding-inline-end:.25rem;padding-inline-start:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.neeto-molecules-menu-list__item-btn-count{height:1.125rem;min-width:1.125rem}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:.75rem!important;min-width:15rem}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-content{padding:0}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-radius:.25rem;transition:var(--neeto-ui-transition)}@media (prefers-reduced-motion:reduce){.neeto-molecules-profile-popup__top-section{transition:none}}.neeto-molecules-profile-popup__top-section:hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-menu-sublist__item-btn{font-weight:500!important;height:2.5rem}.neeto-molecules-menu-sublist__item-btn[data-btn-weight=bold]{font-weight:700!important}.neeto-molecules-menu-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-menu-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-menu-sublist__item-btn span{align-items:center;display:flex;gap:.5rem}.neeto-molecules-product-switcher-menu-popup-wrapper{height:95vh;overflow-y:auto;width:calc(100vw - 25rem)}.neeto-molecules-floating-action-button__profile-wrapper-custom-content:hover{background-color:rgb(var(--neeto-ui-white))!important}.neeto-molecules-organization-switcher-active-button,.neeto-molecules-theme-switcher-active-button{color:rgb(var(--neeto-ui-success-600))!important}.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper]{--neeto-ui-dropdown-box-shadow:0 0 0 0;--neeto-ui-dropdown-border-radius:0.75rem;--neeto-ui-dropdown-popup-border-radius:0.75rem;--neeto-ui-dropdown-margin-y:0;--neeto-ui-dropdown-margin-x:0;transition:var(--neeto-ui-transition)}@media (prefers-reduced-motion:reduce){.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper]{transition:none}}.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper] .neeto-ui-dropdown__popup{--neeto-ui-dropdown-border-radius:0.75rem;transition:var(--neeto-ui-transition)}@media (prefers-reduced-motion:reduce){.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper] .neeto-ui-dropdown__popup{transition:none}}.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper] .neeto-ui-dropdown__popup .neeto-ui-dropdown__popup-divider{transition:var(--neeto-ui-transition)}@media (prefers-reduced-motion:reduce){.tippy-box[data-theme~=neeto-molecules-floating-action-outer-dropdown-wrapper] .neeto-ui-dropdown__popup .neeto-ui-dropdown__popup-divider{transition:none}}.neeto-molecules-subscription-plan-badge{border-radius:9999px;display:inline-block;font-size:.625rem;font-weight:600;line-height:1.1;padding:.25rem .625rem}.neeto-molecules-subscription-plan-badge--pro{background-color:#ffe44a;color:#000}.neeto-molecules-subscription-plan-badge--free{background-color:rgb(var(--neeto-ui-primary-500));color:rgb(var(--neeto-ui-white))}.neeto-molecules-theme-switcher{border-bottom-left-radius:.75rem;border-bottom-right-radius:.75rem}.neeto-molecules-theme-switcher__label{color:rgb(var(--neeto-ui-gray-800));font-size:.875rem;font-weight:500}.neeto-molecules-theme-switcher__segmented-control{background-color:rgb(var(--neeto-ui-gray-200));border-radius:9999px;display:flex;gap:.25rem;padding:.0625rem}.neeto-molecules-theme-switcher__option{align-items:center;background-color:transparent;border:1px solid transparent;border-radius:9999px;color:rgb(var(--neeto-ui-gray-700));cursor:pointer;display:flex;flex:1;font-size:.75rem;font-weight:500;gap:.125rem;padding:.25rem .375rem;transition:all .2s ease;white-space:nowrap}@media (prefers-reduced-motion:reduce){.neeto-molecules-theme-switcher__option{transition:none}}.neeto-molecules-theme-switcher__option:hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-theme-switcher__option--active{background-color:rgb(var(--neeto-ui-white));border-color:rgb(var(--neeto-ui-gray-300));box-shadow:0 1px 2px rgba(0,0,0,.05);color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-theme-switcher__option svg{flex-shrink:0}";
n(css,{});

var _excluded = ["profileInfoOverrides", "topLinks", "bottomLinks", "showProductSwitcher", "isThemeSwitcherEnabled", "isOrganizationSwitcherEnabled", "customContent", "profilePopoverProps", "isConsumer", "enableSubscriptionUpgradeRequest"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var _globalProps$user;
  var _ref$profileInfoOverr = _ref.profileInfoOverrides,
    profileInfoOverrides = _ref$profileInfoOverr === void 0 ? {} : _ref$profileInfoOverr,
    _ref$topLinks = _ref.topLinks,
    topLinks = _ref$topLinks === void 0 ? [] : _ref$topLinks,
    _ref$bottomLinks = _ref.bottomLinks,
    bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
    _ref$showProductSwitc = _ref.showProductSwitcher,
    showProductSwitcher = _ref$showProductSwitc === void 0 ? true : _ref$showProductSwitc,
    _ref$isThemeSwitcherE = _ref.isThemeSwitcherEnabled,
    isThemeSwitcherEnabled = _ref$isThemeSwitcherE === void 0 ? false : _ref$isThemeSwitcherE,
    _ref$isOrganizationSw = _ref.isOrganizationSwitcherEnabled,
    isOrganizationSwitcherEnabled = _ref$isOrganizationSw === void 0 ? false : _ref$isOrganizationSw,
    customContent = _ref.customContent,
    _ref$profilePopoverPr = _ref.profilePopoverProps,
    profilePopoverProps = _ref$profilePopoverPr === void 0 ? {} : _ref$profilePopoverPr,
    _ref$isConsumer = _ref.isConsumer,
    isConsumer = _ref$isConsumer === void 0 ? false : _ref$isConsumer,
    _ref$enableSubscripti = _ref.enableSubscriptionUpgradeRequest,
    enableSubscriptionUpgradeRequest = _ref$enableSubscripti === void 0 ? true : _ref$enableSubscripti,
    otherProps = _objectWithoutProperties(_ref, _excluded);
  useEffect(function () {
    isThemeSwitcherEnabled && setAppTheme();
  }, []);
  var isBigBinaryEmail = globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 || (_globalProps$user = _globalProps$user.email) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.endsWith("@bigbinary.com");
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
    ref: ref,
    className: "neeto-molecules-floating-action-menu__container",
    "data-testid": "floating-action-menu-container"
  }, otherProps), {}, {
    children: /*#__PURE__*/jsx(ProfileButton, _defineProperty({
      bottomLinks: bottomLinks,
      customContent: customContent,
      enableSubscriptionUpgradeRequest: enableSubscriptionUpgradeRequest,
      isConsumer: isConsumer,
      isOrganizationSwitcherEnabled: isOrganizationSwitcherEnabled,
      isThemeSwitcherEnabled: isThemeSwitcherEnabled,
      profileInfoOverrides: profileInfoOverrides,
      profilePopoverProps: profilePopoverProps,
      showProductSwitcher: showProductSwitcher,
      topLinks: topLinks
    }, "isOrganizationSwitcherEnabled", isBigBinaryEmail || isOrganizationSwitcherEnabled))
  }));
});
FloatingActionMenu.displayName = "FloatingActionMenu";

export { FloatingActionMenu as default };
//# sourceMappingURL=FloatingActionMenu.js.map
