@bigbinary/neeto-molecules 1.2.4 → 1.2.5-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Sidebar.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import React, { useState, forwardRef, useEffect } from 'react';
2
2
  import classnames from 'classnames';
3
+ import { capitalize, truncate, isPresent, findBy, notEquals, isNotPresent } from '@bigbinary/neeto-cist';
3
4
  import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
4
5
  import { useFetchNeetoApps, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
5
6
  import { Typography, Input, Tooltip, Spinner, Avatar, Button } from '@bigbinary/neetoui';
6
- import { toLower, all, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
7
+ import { toLower, curry, is, includes, __, all, equals, mergeDeepLeft, omit, inc, not } from 'ramda';
7
8
  import { useTranslation } from 'react-i18next';
8
- import { Link, useLocation, NavLink } from 'react-router-dom';
9
- import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
10
- import { capitalize, truncate, isPresent, findBy, isNotPresent } from '@bigbinary/neeto-cist';
11
- import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
9
+ import { Link, NavLink, useLocation } from 'react-router-dom';
12
10
  import { t as t$1 } from 'i18next';
11
+ import { ChatEmpty, Book, Gift, Keyboard, NeetoIcon, Search, AppSwitcher as AppSwitcher$1, User, Settings, LeftArrow, Help, Down, Left } from '@bigbinary/neeto-icons';
12
+ import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
13
13
  import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
14
14
  import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
15
15
  import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
@@ -83,6 +83,42 @@ var Chevron = function Chevron(_ref) {
83
83
  }));
84
84
  };
85
85
 
86
+ var MY_PROFILE_URL = "/auth/profile/edit";
87
+ var MY_ORGANIZATION_URL = "/auth/organization/edit";
88
+ var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
89
+ var DEFAULT_HELP_LINK_PROPS = {
90
+ liveChatProps: {
91
+ label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
92
+ icon: ChatEmpty,
93
+ "data-cy": "help-link-live-chat-button",
94
+ onClick: function onClick() {
95
+ var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
96
+ (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
97
+ (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
98
+ }
99
+ },
100
+ helpCenterProps: {
101
+ label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
102
+ icon: Book,
103
+ "data-cy": "help-link-help-center-button",
104
+ href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
105
+ target: "_blank"
106
+ },
107
+ changelogProps: {
108
+ id: CHANGELOG_WIDGET_TRIGGER_ID,
109
+ label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
110
+ icon: Gift,
111
+ "data-cy": "help-link-changelog-button"
112
+ },
113
+ keyboardShortcutProps: {
114
+ label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
115
+ icon: Keyboard,
116
+ "data-cy": "help-link-keyboard-shortcut-button"
117
+ }
118
+ };
119
+ var NAVLINK_KEYS_TO_OMIT = ["Component", "component"];
120
+ var SETTINGS = "Settings";
121
+
86
122
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
87
123
 
88
124
  var css$1 = ".neeto-molecules-app-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:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}@media screen and (max-width:768px){.neeto-molecules-app-switcher__wrapper{padding:16px}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-app-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-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:24px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}";
@@ -197,7 +233,7 @@ var AppSwitcher = function AppSwitcher() {
197
233
  }, /*#__PURE__*/React.createElement(Body, null));
198
234
  };
199
235
 
200
- var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}";
236
+ var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:240px;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-1)}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode{padding-top:0}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__header{padding-top:24px}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__links{margin-bottom:0}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink-wrapper{margin:0!important;padding:0!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link{--neeto-ui-text-body2:16px;gap:4px;padding:12px 4px;position:sticky;top:0;z-index:1}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:15px;border-top:1px solid rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);margin-bottom:0!important;padding-bottom:8px!important;padding-top:8px!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:13px;padding-left:40px!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink{margin-bottom:4px;padding:4px 4px 4px 30px!important;position:relative}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink:hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active{background-color:rgb(var(--neeto-ui-primary-100))!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active:before{background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded);content:\"\";height:100%;left:-1px;position:absolute;top:0;width:3px}";
201
237
  n(css,{});
202
238
 
203
239
  var AppSwitcherButton = function AppSwitcherButton() {
@@ -248,41 +284,10 @@ var AppSwitcherButton = function AppSwitcherButton() {
248
284
  }, t("neetoMolecules.sidebar.productSwitcher"))));
249
285
  };
250
286
 
251
- var MY_PROFILE_URL = "/auth/profile/edit";
252
- var MY_ORGANIZATION_URL = "/auth/organization/edit";
253
- var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
254
- var DEFAULT_HELP_LINK_PROPS = {
255
- liveChatProps: {
256
- label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
257
- icon: ChatEmpty,
258
- "data-cy": "help-link-live-chat-button",
259
- onClick: function onClick() {
260
- var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
261
- (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
262
- (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
263
- }
264
- },
265
- helpCenterProps: {
266
- label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
267
- icon: Book,
268
- "data-cy": "help-link-help-center-button",
269
- href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
270
- target: "_blank"
271
- },
272
- changelogProps: {
273
- id: CHANGELOG_WIDGET_TRIGGER_ID,
274
- label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
275
- icon: Gift,
276
- "data-cy": "help-link-changelog-button"
277
- },
278
- keyboardShortcutProps: {
279
- label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
280
- icon: Keyboard,
281
- "data-cy": "help-link-keyboard-shortcut-button"
282
- }
283
- };
284
-
285
- var isSubRouteActive = function isSubRouteActive(subRoute, location) {
287
+ var isSubRouteActive = function isSubRouteActive(_ref) {
288
+ var subRoute = _ref.subRoute,
289
+ location = _ref.location,
290
+ isSettingsItems = _ref.isSettingsItems;
286
291
  var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
287
292
  var targetUrl = new URL(subRoute, window.location.origin);
288
293
  if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
@@ -290,15 +295,28 @@ var isSubRouteActive = function isSubRouteActive(subRoute, location) {
290
295
  }
291
296
  var targetSearchParams = targetUrl.searchParams;
292
297
  var targetSearchKeys = Array.from(targetSearchParams.keys());
293
- return all(function (key) {
298
+ var targetUrlWithSearch = targetUrl.pathname + targetUrl.search;
299
+ var currentUrlWithSearch = currentBrowserUrl.pathname + currentBrowserUrl.search;
300
+ var isLinkActive = all(function (key) {
294
301
  return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
295
302
  }, targetSearchKeys);
303
+ if (isSettingsItems) {
304
+ return isLinkActive && equals(currentUrlWithSearch, targetUrlWithSearch);
305
+ }
306
+ return isLinkActive;
296
307
  };
297
308
  var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
298
309
  var _globalProps$user, _globalProps$user2;
299
310
  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);
300
311
  return "sidebarState-".concat(user);
301
312
  };
313
+ var filterByPermissions = curry(function (_ref2) {
314
+ var permissions = _ref2.permissions;
315
+ if (permissions) {
316
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
317
+ }
318
+ return true;
319
+ });
302
320
 
303
321
  var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
304
322
  var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
@@ -457,9 +475,9 @@ function _objectWithoutProperties(source, excluded) {
457
475
  return target;
458
476
  }
459
477
 
460
- var _excluded$2 = ["onClick", "label", "icon"];
461
- 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; }
462
- 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), !0).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; }
478
+ var _excluded$4 = ["onClick", "label", "icon"];
479
+ 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; }
480
+ 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), !0).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; }
463
481
  var LinkSection = function LinkSection(_ref) {
464
482
  var links = _ref.links;
465
483
  return /*#__PURE__*/React.createElement("ul", {
@@ -469,7 +487,7 @@ var LinkSection = function LinkSection(_ref) {
469
487
  label = _ref2.label,
470
488
  _ref2$icon = _ref2.icon,
471
489
  icon = _ref2$icon === void 0 ? null : _ref2$icon,
472
- otherProps = _objectWithoutProperties(_ref2, _excluded$2);
490
+ otherProps = _objectWithoutProperties(_ref2, _excluded$4);
473
491
  return /*#__PURE__*/React.createElement("li", {
474
492
  className: "neeto-molecules-profile-sublist__item",
475
493
  key: idx
@@ -479,7 +497,7 @@ var LinkSection = function LinkSection(_ref) {
479
497
  iconPosition: "left",
480
498
  iconSize: 18,
481
499
  style: "text"
482
- }, _objectSpread$2({
500
+ }, _objectSpread$3({
483
501
  icon: icon,
484
502
  label: label,
485
503
  onClick: onClick
@@ -582,9 +600,9 @@ var HelpSection = function HelpSection(_ref, ref) {
582
600
  };
583
601
  var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
584
602
 
585
- var _excluded$1 = ["label"];
586
- 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; }
587
- 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), !0).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; }
603
+ var _excluded$3 = ["label"];
604
+ 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; }
605
+ 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), !0).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; }
588
606
  var HelpSectionMenu = function HelpSectionMenu(_ref) {
589
607
  var helpLinkOverrides = _ref.helpLinkOverrides,
590
608
  changesCount = _ref.changesCount;
@@ -592,7 +610,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
592
610
  _KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
593
611
  setIsOpen = _KeyboardShortcuts$us2[1];
594
612
  var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).map(function (key) {
595
- return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
613
+ return _objectSpread$2(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
596
614
  onClick: function onClick() {
597
615
  return setIsOpen(true);
598
616
  }
@@ -607,7 +625,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
607
625
  className: "neeto-molecules-help-sublist"
608
626
  }, helpLinks.map(function (_ref3, idx) {
609
627
  var label = _ref3.label,
610
- buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
628
+ buttonProps = _objectWithoutProperties(_ref3, _excluded$3);
611
629
  return /*#__PURE__*/React.createElement("li", {
612
630
  className: "neeto-molecules-help-sublist__item",
613
631
  key: idx
@@ -699,26 +717,74 @@ var Header = function Header(_ref) {
699
717
  };
700
718
  var Header$1 = /*#__PURE__*/React.memo(Header);
701
719
 
702
- var _excluded = ["label", "to", "icon", "items"],
703
- _excluded2 = ["label", "to", "count", "data-cy"];
704
- 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; }
705
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).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; }
720
+ var _excluded$2 = ["label", "to", "count", "dataCy", "items"];
721
+ var Items = function Items(_ref) {
722
+ var items = _ref.items,
723
+ _ref$level = _ref.level,
724
+ level = _ref$level === void 0 ? 0 : _ref$level,
725
+ _ref$isSettingsItems = _ref.isSettingsItems,
726
+ isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems;
727
+ return /*#__PURE__*/React.createElement("div", {
728
+ className: "neeto-molecules-sidebar__sublink-wrapper ml-".concat(level * 2),
729
+ "data-cy": "sidebar-sub-link-wrapper"
730
+ }, items.filter(filterByPermissions).map(function (_ref2, index) {
731
+ var label = _ref2.label,
732
+ to = _ref2.to,
733
+ count = _ref2.count,
734
+ dataCy = _ref2.dataCy,
735
+ subItems = _ref2.items,
736
+ otherProps = _objectWithoutProperties(_ref2, _excluded$2);
737
+ return /*#__PURE__*/React.createElement(React.Fragment, {
738
+ key: index
739
+ }, /*#__PURE__*/React.createElement(NavLink, _extends({
740
+ to: to,
741
+ activeClassName: "active",
742
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-select-none neeto-molecules-sidebar__sublink",
743
+ "data-cy": "".concat(dataCy, "-sub-link"),
744
+ key: index,
745
+ isActive: function isActive() {
746
+ return isSubRouteActive({
747
+ subRoute: to,
748
+ location: location,
749
+ isSettingsItems: isSettingsItems
750
+ });
751
+ }
752
+ }, omit(NAVLINK_KEYS_TO_OMIT, otherProps)), /*#__PURE__*/React.createElement(Typography, {
753
+ className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
754
+ component: "span",
755
+ "data-cy": "".concat(dataCy, "-sub-link-label"),
756
+ style: "body2"
757
+ }, label), /*#__PURE__*/React.createElement(Typography, {
758
+ className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
759
+ component: "span",
760
+ "data-cy": "".concat(dataCy, "-sub-link-count"),
761
+ style: "body2"
762
+ }, count > 999 ? "999+" : count)), isPresent(subItems) && /*#__PURE__*/React.createElement(Items, {
763
+ isSettingsItems: isSettingsItems,
764
+ items: subItems,
765
+ level: inc(level)
766
+ }));
767
+ }));
768
+ };
769
+
770
+ var _excluded$1 = ["label", "to", "icon", "items"];
771
+ 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; }
772
+ 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), !0).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; }
706
773
  var Links = function Links(_ref) {
707
- var navLinks = _ref.navLinks;
708
- var location = useLocation();
774
+ var navLinks = _ref.navLinks,
775
+ setSelectedNavLink = _ref.setSelectedNavLink;
709
776
  var _useState = useState(true),
710
777
  _useState2 = _slicedToArray(_useState, 2),
711
778
  isActiveLinkExpanded = _useState2[0],
712
779
  setIsActiveLinkExpanded = _useState2[1];
713
- var filterByPermissions = curry(function (_ref2) {
714
- var permissions = _ref2.permissions;
715
- if (permissions) {
716
- return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
717
- }
718
- return true;
719
- });
720
- var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
780
+ var location = useLocation();
781
+ var handleNavLinkClick = function handleNavLinkClick(_ref2) {
782
+ var event = _ref2.event,
783
+ isActive = _ref2.isActive,
784
+ items = _ref2.items,
785
+ navLink = _ref2.navLink;
721
786
  if (isNotPresent(items)) return;
787
+ equals(navLink.label, SETTINGS) && setSelectedNavLink(navLink);
722
788
  if (isActive()) {
723
789
  setIsActiveLinkExpanded(not);
724
790
  event.preventDefault();
@@ -728,12 +794,12 @@ var Links = function Links(_ref) {
728
794
  };
729
795
  return /*#__PURE__*/React.createElement("div", {
730
796
  className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
731
- }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
732
- var label = _ref3.label,
733
- to = _ref3.to,
734
- icon = _ref3.icon,
735
- items = _ref3.items,
736
- otherProps = _objectWithoutProperties(_ref3, _excluded);
797
+ }, navLinks.filter(filterByPermissions).map(function (navLink, index) {
798
+ var label = navLink.label,
799
+ to = navLink.to,
800
+ icon = navLink.icon,
801
+ items = navLink.items,
802
+ otherProps = _objectWithoutProperties(navLink, _excluded$1);
737
803
  var IconSVG = icon;
738
804
  var url = new URL(to, window.location.href);
739
805
  var isActive = function isActive() {
@@ -741,14 +807,19 @@ var Links = function Links(_ref) {
741
807
  };
742
808
  var isMenuExpanded = isActive() && isActiveLinkExpanded;
743
809
  return /*#__PURE__*/React.createElement(React.Fragment, {
744
- key: mainIndex
810
+ key: index
745
811
  }, /*#__PURE__*/React.createElement(NavLink, _extends({
746
812
  activeClassName: "active",
747
813
  className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
748
814
  onClick: function onClick(event) {
749
- return handleNavLinkClick(event, isActive, items);
815
+ return handleNavLinkClick({
816
+ event: event,
817
+ isActive: isActive,
818
+ items: items,
819
+ navLink: navLink
820
+ });
750
821
  }
751
- }, _objectSpread({
822
+ }, _objectSpread$1({
752
823
  isActive: isActive,
753
824
  to: to
754
825
  }, otherProps)), icon && /*#__PURE__*/React.createElement("span", {
@@ -759,42 +830,62 @@ var Links = function Links(_ref) {
759
830
  component: "span",
760
831
  style: "body2",
761
832
  weight: "normal"
762
- }, label), items && /*#__PURE__*/React.createElement("span", {
833
+ }, label), items && notEquals(label, SETTINGS) && /*#__PURE__*/React.createElement("span", {
763
834
  className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
764
835
  "neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
765
836
  })
766
837
  }, /*#__PURE__*/React.createElement(Down, {
767
838
  size: 16
768
- }))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
769
- className: "neeto-molecules-sidebar__sublink-wrapper",
770
- "data-cy": "sidebar-sub-link-wrapper"
771
- }, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
772
- var subLabel = _ref4.label,
773
- subRoute = _ref4.to,
774
- count = _ref4.count,
775
- dataCy = _ref4["data-cy"],
776
- otherProps = _objectWithoutProperties(_ref4, _excluded2);
777
- return /*#__PURE__*/React.createElement(NavLink, _extends({
778
- activeClassName: "active",
779
- className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
780
- "data-cy": "".concat(dataCy, "-sub-link"),
781
- isActive: function isActive() {
782
- return isSubRouteActive(subRoute, location);
783
- },
784
- key: subIndex,
785
- to: subRoute
786
- }, otherProps), /*#__PURE__*/React.createElement(Typography, {
787
- className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
788
- component: "span",
789
- "data-cy": "".concat(dataCy, "-sub-link-label"),
790
- style: "body2"
791
- }, subLabel), /*#__PURE__*/React.createElement(Typography, {
792
- className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
793
- component: "span",
794
- "data-cy": "".concat(dataCy, "-sub-link-count"),
795
- style: "body2"
796
- }, count > 999 ? "999+" : count));
797
- })));
839
+ }))), items && notEquals(label, SETTINGS) && isMenuExpanded && /*#__PURE__*/React.createElement(Items, {
840
+ items: items
841
+ }));
842
+ }));
843
+ };
844
+
845
+ var _excluded = ["label", "to", "items"];
846
+ 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; }
847
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).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; }
848
+ var SelectedLink = function SelectedLink(_ref) {
849
+ var navLink = _ref.navLink,
850
+ setSelectedNavLink = _ref.setSelectedNavLink;
851
+ var location = useLocation();
852
+ var _useTranslation = useTranslation(),
853
+ t = _useTranslation.t;
854
+ var label = navLink.label,
855
+ to = navLink.to,
856
+ items = navLink.items,
857
+ otherProps = _objectWithoutProperties(navLink, _excluded);
858
+ var url = new URL(to, window.location.href);
859
+ var isActive = function isActive() {
860
+ return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
861
+ };
862
+ var handleGoBack = function handleGoBack(event) {
863
+ event.preventDefault();
864
+ setSelectedNavLink({});
865
+ };
866
+ return /*#__PURE__*/React.createElement("div", {
867
+ className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable"
868
+ }, /*#__PURE__*/React.createElement(NavLink, _extends({
869
+ activeClassName: "active",
870
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link"
871
+ }, _objectSpread({
872
+ isActive: isActive,
873
+ to: to
874
+ }, otherProps)), /*#__PURE__*/React.createElement(Tooltip, {
875
+ content: t("neetoMolecules.sidebar.goBack"),
876
+ position: "top"
877
+ }, /*#__PURE__*/React.createElement("span", {
878
+ className: "neeto-molecules-sidebar__link-icon",
879
+ "data-testid": "".concat(label, "-go-back-button"),
880
+ onClick: handleGoBack
881
+ }, /*#__PURE__*/React.createElement(Left, null))), /*#__PURE__*/React.createElement(Typography, {
882
+ className: "neeto-molecules-sidebar__link-label",
883
+ component: "span",
884
+ style: "body2",
885
+ weight: "normal"
886
+ }, label)), items && /*#__PURE__*/React.createElement(Items, {
887
+ items: items,
888
+ isSettingsItems: true
798
889
  }));
799
890
  };
800
891
 
@@ -813,10 +904,14 @@ var Sidebar = function Sidebar(_ref) {
813
904
  _useState2 = _slicedToArray(_useState, 2),
814
905
  isAppSwitcherOpen = _useState2[0],
815
906
  setIsAppSwitcherOpen = _useState2[1];
816
- var _useState3 = useState(false),
907
+ var _useState3 = useState({}),
817
908
  _useState4 = _slicedToArray(_useState3, 2),
818
- isSidebarPaneOpen = _useState4[0],
819
- setIsSidebarPaneOpen = _useState4[1];
909
+ selectedNavLink = _useState4[0],
910
+ setSelectedNavLink = _useState4[1];
911
+ var _useState5 = useState(false),
912
+ _useState6 = _slicedToArray(_useState5, 2),
913
+ isSidebarPaneOpen = _useState6[0],
914
+ setIsSidebarPaneOpen = _useState6[1];
820
915
  var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
821
916
  _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
822
917
  isSidebarCollapsed = _useLocalStorage2[0],
@@ -844,6 +939,17 @@ var Sidebar = function Sidebar(_ref) {
844
939
  };
845
940
  }, []);
846
941
  var productName = globalProps$1.appName.substr(5).toLowerCase();
942
+ useEffect(function () {
943
+ var currentLink = navLinks.find(function (_ref2) {
944
+ var to = _ref2.to,
945
+ isActive = _ref2.isActive;
946
+ var url = new URL(to, window.location.href);
947
+ return is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
948
+ });
949
+ if (isPresent(currentLink) && equals(currentLink.label, SETTINGS)) {
950
+ setSelectedNavLink(currentLink);
951
+ }
952
+ }, []);
847
953
  return /*#__PURE__*/React.createElement("div", {
848
954
  "data-testid": "sidebar-container",
849
955
  className: classnames("neeto-molecules-sidebar__wrapper", {
@@ -855,14 +961,20 @@ var Sidebar = function Sidebar(_ref) {
855
961
  setIsSidebarPaneOpen(false);
856
962
  }
857
963
  }), /*#__PURE__*/React.createElement("div", {
858
- className: "neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden",
859
964
  "data-cy": "sidebar-wrapper",
860
- "data-testid": "sidebar"
965
+ "data-testid": "sidebar",
966
+ className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
967
+ "neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLink)
968
+ })
861
969
  }, /*#__PURE__*/React.createElement(Header$1, {
862
970
  customLogo: customLogo
863
- }), /*#__PURE__*/React.createElement(Links, {
864
- navLinks: navLinks
865
- }), /*#__PURE__*/React.createElement(Footer, {
971
+ }), isPresent(selectedNavLink) ? /*#__PURE__*/React.createElement(SelectedLink, {
972
+ setSelectedNavLink: setSelectedNavLink,
973
+ navLink: selectedNavLink
974
+ }) : /*#__PURE__*/React.createElement(Links, {
975
+ navLinks: navLinks,
976
+ setSelectedNavLink: setSelectedNavLink
977
+ }), isNotPresent(selectedNavLink) && /*#__PURE__*/React.createElement(Footer, {
866
978
  extraTopLinks: extraTopLinks,
867
979
  helpLinkOverrides: helpLinkOverrides,
868
980
  profileInfoOverrides: profileInfoOverrides,