@bigbinary/neeto-molecules 1.3.18 → 1.3.19-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, noop } 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,48 @@ var Chevron = function Chevron(_ref) {
83
83
  }));
84
84
  };
85
85
 
86
+ var shouldShowWhatsNew = function shouldShowWhatsNew() {
87
+ var _window$globalProps, _window$globalProps$u;
88
+ var currentUserEmail = (_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.email;
89
+ return window.location.hostname === "localhost" || currentUserEmail === "oliver@example.com" || (currentUserEmail === null || currentUserEmail === void 0 ? void 0 : currentUserEmail.endsWith("@bigbinary.com"));
90
+ };
91
+ var MY_PROFILE_URL = "/auth/profile/edit";
92
+ var MY_ORGANIZATION_URL = "/auth/organization/edit";
93
+ var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
94
+ var DEFAULT_HELP_LINK_PROPS = {
95
+ liveChatProps: {
96
+ label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
97
+ icon: ChatEmpty,
98
+ "data-cy": "help-link-live-chat-button",
99
+ onClick: function onClick() {
100
+ var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
101
+ (_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();
102
+ (_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();
103
+ }
104
+ },
105
+ helpCenterProps: {
106
+ label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
107
+ icon: Book,
108
+ "data-cy": "help-link-help-center-button",
109
+ href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
110
+ target: "_blank"
111
+ },
112
+ changelogProps: {
113
+ id: CHANGELOG_WIDGET_TRIGGER_ID,
114
+ label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
115
+ icon: Gift,
116
+ "data-cy": "help-link-changelog-button",
117
+ isVisible: shouldShowWhatsNew
118
+ },
119
+ keyboardShortcutProps: {
120
+ label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
121
+ icon: Keyboard,
122
+ "data-cy": "help-link-keyboard-shortcut-button"
123
+ }
124
+ };
125
+ var NAVLINK_KEYS_TO_OMIT = ["Component", "component"];
126
+ var SETTINGS = "Settings";
127
+
86
128
  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
129
 
88
130
  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 +239,7 @@ var AppSwitcher = function AppSwitcher() {
197
239
  }, /*#__PURE__*/React.createElement(Body, null));
198
240
  };
199
241
 
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}}";
242
+ 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--configure-page{position:relative;transition:all .15s}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar,.neeto-molecules-sidebar__wrapper--configure-page{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;position:fixed;top:0;transition:none}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar--configure-page{max-width:100%;position:static;transition:all .15s;width:100%}}.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--configure-page{height:auto}.neeto-molecules-sidebar--configure-page .neeto-molecules-sidebar__toggler{display: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
243
  n(css,{});
202
244
 
203
245
  var AppSwitcherButton = function AppSwitcherButton() {
@@ -248,63 +290,39 @@ var AppSwitcherButton = function AppSwitcherButton() {
248
290
  }, t("neetoMolecules.sidebar.productSwitcher"))));
249
291
  };
250
292
 
251
- var shouldShowWhatsNew = function shouldShowWhatsNew() {
252
- var _window$globalProps, _window$globalProps$u;
253
- var currentUserEmail = (_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.email;
254
- return window.location.hostname === "localhost" || currentUserEmail === "oliver@example.com" || (currentUserEmail === null || currentUserEmail === void 0 ? void 0 : currentUserEmail.endsWith("@bigbinary.com"));
255
- };
256
- var MY_PROFILE_URL = "/auth/profile/edit";
257
- var MY_ORGANIZATION_URL = "/auth/organization/edit";
258
- var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
259
- var DEFAULT_HELP_LINK_PROPS = {
260
- liveChatProps: {
261
- label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
262
- icon: ChatEmpty,
263
- "data-cy": "help-link-live-chat-button",
264
- onClick: function onClick() {
265
- var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
266
- (_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();
267
- (_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();
268
- }
269
- },
270
- helpCenterProps: {
271
- label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
272
- icon: Book,
273
- "data-cy": "help-link-help-center-button",
274
- href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
275
- target: "_blank"
276
- },
277
- changelogProps: {
278
- id: CHANGELOG_WIDGET_TRIGGER_ID,
279
- label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
280
- icon: Gift,
281
- "data-cy": "help-link-changelog-button",
282
- isVisible: shouldShowWhatsNew
283
- },
284
- keyboardShortcutProps: {
285
- label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
286
- icon: Keyboard,
287
- "data-cy": "help-link-keyboard-shortcut-button"
288
- }
289
- };
290
-
291
- var isSubRouteActive = function isSubRouteActive(subRoute, location) {
292
- var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
293
+ var isSubRouteActive = function isSubRouteActive(_ref) {
294
+ var subRoute = _ref.subRoute,
295
+ location = _ref.location,
296
+ isSettingsItems = _ref.isSettingsItems;
297
+ var currentBrowserUrl = new URL(location.pathname + location.search + location.hash, window.location.origin);
293
298
  var targetUrl = new URL(subRoute, window.location.origin);
294
299
  if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
295
300
  return false;
296
301
  }
297
302
  var targetSearchParams = targetUrl.searchParams;
298
303
  var targetSearchKeys = Array.from(targetSearchParams.keys());
299
- return all(function (key) {
304
+ var targetUrlWithSearch = targetUrl.pathname + targetUrl.search + targetUrl.hash;
305
+ var currentUrlWithSearch = currentBrowserUrl.pathname + currentBrowserUrl.search + currentBrowserUrl.hash;
306
+ var isLinkActive = all(function (key) {
300
307
  return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
301
- }, targetSearchKeys);
308
+ }, targetSearchKeys) && equals(currentBrowserUrl.hash, targetUrl.hash);
309
+ if (isSettingsItems) {
310
+ return isLinkActive && equals(currentUrlWithSearch, targetUrlWithSearch);
311
+ }
312
+ return isLinkActive;
302
313
  };
303
314
  var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
304
315
  var _globalProps$user, _globalProps$user2;
305
316
  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);
306
317
  return "sidebarState-".concat(user);
307
318
  };
319
+ var filterByPermissions = curry(function (_ref2) {
320
+ var permissions = _ref2.permissions;
321
+ if (permissions) {
322
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
323
+ }
324
+ return true;
325
+ });
308
326
 
309
327
  var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
310
328
  var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
@@ -463,9 +481,9 @@ function _objectWithoutProperties(source, excluded) {
463
481
  return target;
464
482
  }
465
483
 
466
- var _excluded$2 = ["onClick", "label", "icon"];
467
- 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; }
468
- 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; }
484
+ var _excluded$4 = ["onClick", "label", "icon"];
485
+ 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; }
486
+ 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; }
469
487
  var LinkSection = function LinkSection(_ref) {
470
488
  var links = _ref.links;
471
489
  return /*#__PURE__*/React.createElement("ul", {
@@ -475,7 +493,7 @@ var LinkSection = function LinkSection(_ref) {
475
493
  label = _ref2.label,
476
494
  _ref2$icon = _ref2.icon,
477
495
  icon = _ref2$icon === void 0 ? null : _ref2$icon,
478
- otherProps = _objectWithoutProperties(_ref2, _excluded$2);
496
+ otherProps = _objectWithoutProperties(_ref2, _excluded$4);
479
497
  return /*#__PURE__*/React.createElement("li", {
480
498
  className: "neeto-molecules-profile-sublist__item",
481
499
  key: idx
@@ -485,7 +503,7 @@ var LinkSection = function LinkSection(_ref) {
485
503
  iconPosition: "left",
486
504
  iconSize: 18,
487
505
  style: "text"
488
- }, _objectSpread$2({
506
+ }, _objectSpread$3({
489
507
  icon: icon,
490
508
  label: label,
491
509
  onClick: onClick
@@ -588,9 +606,9 @@ var HelpSection = function HelpSection(_ref, ref) {
588
606
  };
589
607
  var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
590
608
 
591
- var _excluded$1 = ["label"];
592
- 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; }
593
- 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; }
609
+ var _excluded$3 = ["label"];
610
+ 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; }
611
+ 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; }
594
612
  var HelpSectionMenu = function HelpSectionMenu(_ref) {
595
613
  var helpLinkOverrides = _ref.helpLinkOverrides,
596
614
  changesCount = _ref.changesCount;
@@ -601,7 +619,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
601
619
  var _DEFAULT_HELP_LINK_PR, _DEFAULT_HELP_LINK_PR2, _DEFAULT_HELP_LINK_PR3;
602
620
  return (_DEFAULT_HELP_LINK_PR = (_DEFAULT_HELP_LINK_PR2 = (_DEFAULT_HELP_LINK_PR3 = DEFAULT_HELP_LINK_PROPS[key]).isVisible) === null || _DEFAULT_HELP_LINK_PR2 === void 0 ? void 0 : _DEFAULT_HELP_LINK_PR2.call(_DEFAULT_HELP_LINK_PR3)) !== null && _DEFAULT_HELP_LINK_PR !== void 0 ? _DEFAULT_HELP_LINK_PR : true;
603
621
  }).map(function (key) {
604
- return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
622
+ return _objectSpread$2(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
605
623
  onClick: function onClick() {
606
624
  return setIsOpen(true);
607
625
  }
@@ -616,7 +634,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
616
634
  className: "neeto-molecules-help-sublist"
617
635
  }, helpLinks.map(function (_ref3, idx) {
618
636
  var label = _ref3.label,
619
- buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
637
+ buttonProps = _objectWithoutProperties(_ref3, _excluded$3);
620
638
  return /*#__PURE__*/React.createElement("li", {
621
639
  className: "neeto-molecules-help-sublist__item",
622
640
  key: idx
@@ -708,26 +726,74 @@ var Header = function Header(_ref) {
708
726
  };
709
727
  var Header$1 = /*#__PURE__*/React.memo(Header);
710
728
 
711
- var _excluded = ["label", "to", "icon", "items"],
712
- _excluded2 = ["label", "to", "count", "data-cy"];
713
- 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; }
714
- 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; }
729
+ var _excluded$2 = ["label", "to", "count", "dataCy", "items"];
730
+ var Items = function Items(_ref) {
731
+ var items = _ref.items,
732
+ _ref$level = _ref.level,
733
+ level = _ref$level === void 0 ? 0 : _ref$level,
734
+ _ref$isSettingsItems = _ref.isSettingsItems,
735
+ isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems;
736
+ return /*#__PURE__*/React.createElement("div", {
737
+ className: "neeto-molecules-sidebar__sublink-wrapper ml-".concat(level * 2),
738
+ "data-cy": "sidebar-sub-link-wrapper"
739
+ }, items.filter(filterByPermissions).map(function (_ref2, index) {
740
+ var label = _ref2.label,
741
+ to = _ref2.to,
742
+ count = _ref2.count,
743
+ dataCy = _ref2.dataCy,
744
+ subItems = _ref2.items,
745
+ otherProps = _objectWithoutProperties(_ref2, _excluded$2);
746
+ return /*#__PURE__*/React.createElement(React.Fragment, {
747
+ key: index
748
+ }, /*#__PURE__*/React.createElement(NavLink, _extends({
749
+ to: to,
750
+ activeClassName: "active",
751
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-select-none neeto-molecules-sidebar__sublink",
752
+ "data-cy": "".concat(dataCy, "-sub-link"),
753
+ key: index,
754
+ isActive: function isActive() {
755
+ return isSubRouteActive({
756
+ subRoute: to,
757
+ location: location,
758
+ isSettingsItems: isSettingsItems
759
+ });
760
+ }
761
+ }, omit(NAVLINK_KEYS_TO_OMIT, otherProps)), /*#__PURE__*/React.createElement(Typography, {
762
+ className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
763
+ component: "span",
764
+ "data-cy": "".concat(dataCy, "-sub-link-label"),
765
+ style: "body2"
766
+ }, label), /*#__PURE__*/React.createElement(Typography, {
767
+ className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
768
+ component: "span",
769
+ "data-cy": "".concat(dataCy, "-sub-link-count"),
770
+ style: "body2"
771
+ }, count > 999 ? "999+" : count)), isPresent(subItems) && /*#__PURE__*/React.createElement(Items, {
772
+ isSettingsItems: isSettingsItems,
773
+ items: subItems,
774
+ level: inc(level)
775
+ }));
776
+ }));
777
+ };
778
+
779
+ var _excluded$1 = ["label", "to", "icon", "items"];
780
+ 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; }
781
+ 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; }
715
782
  var Links = function Links(_ref) {
716
- var navLinks = _ref.navLinks;
717
- var location = useLocation();
783
+ var navLinks = _ref.navLinks,
784
+ setSelectedNavLink = _ref.setSelectedNavLink;
718
785
  var _useState = useState(true),
719
786
  _useState2 = _slicedToArray(_useState, 2),
720
787
  isActiveLinkExpanded = _useState2[0],
721
788
  setIsActiveLinkExpanded = _useState2[1];
722
- var filterByPermissions = curry(function (_ref2) {
723
- var permissions = _ref2.permissions;
724
- if (permissions) {
725
- return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
726
- }
727
- return true;
728
- });
729
- var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
789
+ var location = useLocation();
790
+ var handleNavLinkClick = function handleNavLinkClick(_ref2) {
791
+ var event = _ref2.event,
792
+ isActive = _ref2.isActive,
793
+ items = _ref2.items,
794
+ navLink = _ref2.navLink;
730
795
  if (isNotPresent(items)) return;
796
+ equals(navLink.label, SETTINGS) && setSelectedNavLink(navLink);
731
797
  if (isActive()) {
732
798
  setIsActiveLinkExpanded(not);
733
799
  event.preventDefault();
@@ -737,12 +803,12 @@ var Links = function Links(_ref) {
737
803
  };
738
804
  return /*#__PURE__*/React.createElement("div", {
739
805
  className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
740
- }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
741
- var label = _ref3.label,
742
- to = _ref3.to,
743
- icon = _ref3.icon,
744
- items = _ref3.items,
745
- otherProps = _objectWithoutProperties(_ref3, _excluded);
806
+ }, navLinks.filter(filterByPermissions).map(function (navLink, index) {
807
+ var label = navLink.label,
808
+ to = navLink.to,
809
+ icon = navLink.icon,
810
+ items = navLink.items,
811
+ otherProps = _objectWithoutProperties(navLink, _excluded$1);
746
812
  var IconSVG = icon;
747
813
  var url = new URL(to, window.location.href);
748
814
  var isActive = function isActive() {
@@ -750,14 +816,19 @@ var Links = function Links(_ref) {
750
816
  };
751
817
  var isMenuExpanded = isActive() && isActiveLinkExpanded;
752
818
  return /*#__PURE__*/React.createElement(React.Fragment, {
753
- key: mainIndex
819
+ key: index
754
820
  }, /*#__PURE__*/React.createElement(NavLink, _extends({
755
821
  activeClassName: "active",
756
822
  className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
757
823
  onClick: function onClick(event) {
758
- return handleNavLinkClick(event, isActive, items);
824
+ return handleNavLinkClick({
825
+ event: event,
826
+ isActive: isActive,
827
+ items: items,
828
+ navLink: navLink
829
+ });
759
830
  }
760
- }, _objectSpread({
831
+ }, _objectSpread$1({
761
832
  isActive: isActive,
762
833
  to: to
763
834
  }, otherProps)), icon && /*#__PURE__*/React.createElement("span", {
@@ -768,42 +839,70 @@ var Links = function Links(_ref) {
768
839
  component: "span",
769
840
  style: "body2",
770
841
  weight: "normal"
771
- }, label), items && /*#__PURE__*/React.createElement("span", {
842
+ }, label), items && notEquals(label, SETTINGS) && /*#__PURE__*/React.createElement("span", {
772
843
  className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
773
844
  "neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
774
845
  })
775
846
  }, /*#__PURE__*/React.createElement(Down, {
776
847
  size: 16
777
- }))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
778
- className: "neeto-molecules-sidebar__sublink-wrapper",
779
- "data-cy": "sidebar-sub-link-wrapper"
780
- }, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
781
- var subLabel = _ref4.label,
782
- subRoute = _ref4.to,
783
- count = _ref4.count,
784
- dataCy = _ref4["data-cy"],
785
- otherProps = _objectWithoutProperties(_ref4, _excluded2);
786
- return /*#__PURE__*/React.createElement(NavLink, _extends({
787
- activeClassName: "active",
788
- className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
789
- "data-cy": "".concat(dataCy, "-sub-link"),
790
- isActive: function isActive() {
791
- return isSubRouteActive(subRoute, location);
792
- },
793
- key: subIndex,
794
- to: subRoute
795
- }, otherProps), /*#__PURE__*/React.createElement(Typography, {
796
- className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
797
- component: "span",
798
- "data-cy": "".concat(dataCy, "-sub-link-label"),
799
- style: "body2"
800
- }, subLabel), /*#__PURE__*/React.createElement(Typography, {
801
- className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
802
- component: "span",
803
- "data-cy": "".concat(dataCy, "-sub-link-count"),
804
- style: "body2"
805
- }, count > 999 ? "999+" : count));
806
- })));
848
+ }))), items && notEquals(label, SETTINGS) && isMenuExpanded && /*#__PURE__*/React.createElement(Items, {
849
+ items: items
850
+ }));
851
+ }));
852
+ };
853
+
854
+ var _excluded = ["label", "to", "items"];
855
+ 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; }
856
+ 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; }
857
+ var SelectedLink = function SelectedLink(_ref) {
858
+ var navLink = _ref.navLink,
859
+ _ref$setSelectedNavLi = _ref.setSelectedNavLink,
860
+ setSelectedNavLink = _ref$setSelectedNavLi === void 0 ? noop : _ref$setSelectedNavLi,
861
+ _ref$isConfigurePage = _ref.isConfigurePage,
862
+ isConfigurePage = _ref$isConfigurePage === void 0 ? false : _ref$isConfigurePage;
863
+ var location = useLocation();
864
+ var _useTranslation = useTranslation(),
865
+ t = _useTranslation.t;
866
+ var label = navLink.label,
867
+ to = navLink.to,
868
+ items = navLink.items,
869
+ otherProps = _objectWithoutProperties(navLink, _excluded);
870
+ var HeaderComponent = isPresent(to) ? NavLink : "div";
871
+ var url = new URL(to, window.location.href);
872
+ var isActive = function isActive() {
873
+ return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
874
+ };
875
+ var handleGoBack = function handleGoBack(event) {
876
+ event.preventDefault();
877
+ setSelectedNavLink({});
878
+ };
879
+ return /*#__PURE__*/React.createElement("div", {
880
+ className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable"
881
+ }, /*#__PURE__*/React.createElement(HeaderComponent, _extends({
882
+ activeClassName: "active",
883
+ className: classnames("neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link", {
884
+ active: isConfigurePage
885
+ })
886
+ }, _objectSpread({
887
+ isActive: isActive,
888
+ to: to
889
+ }, otherProps)), not(isConfigurePage) && /*#__PURE__*/React.createElement(Tooltip, {
890
+ content: t("neetoMolecules.sidebar.goBack"),
891
+ position: "top"
892
+ }, /*#__PURE__*/React.createElement("span", {
893
+ className: "neeto-molecules-sidebar__link-icon",
894
+ "data-testid": "".concat(label, "-go-back-button"),
895
+ onClick: handleGoBack
896
+ }, /*#__PURE__*/React.createElement(Left, null))), /*#__PURE__*/React.createElement(Typography, {
897
+ component: "span",
898
+ style: "body2",
899
+ weight: "normal",
900
+ className: classnames("neeto-molecules-sidebar__link-label", {
901
+ "ml-7": isConfigurePage
902
+ })
903
+ }, label)), items && /*#__PURE__*/React.createElement(Items, {
904
+ items: items,
905
+ isSettingsItems: not(isConfigurePage)
807
906
  }));
808
907
  };
809
908
 
@@ -822,10 +921,14 @@ var Sidebar = function Sidebar(_ref) {
822
921
  _useState2 = _slicedToArray(_useState, 2),
823
922
  isAppSwitcherOpen = _useState2[0],
824
923
  setIsAppSwitcherOpen = _useState2[1];
825
- var _useState3 = useState(false),
924
+ var _useState3 = useState({}),
826
925
  _useState4 = _slicedToArray(_useState3, 2),
827
- isSidebarPaneOpen = _useState4[0],
828
- setIsSidebarPaneOpen = _useState4[1];
926
+ selectedNavLink = _useState4[0],
927
+ setSelectedNavLink = _useState4[1];
928
+ var _useState5 = useState(false),
929
+ _useState6 = _slicedToArray(_useState5, 2),
930
+ isSidebarPaneOpen = _useState6[0],
931
+ setIsSidebarPaneOpen = _useState6[1];
829
932
  var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
830
933
  _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
831
934
  isSidebarCollapsed = _useLocalStorage2[0],
@@ -853,6 +956,17 @@ var Sidebar = function Sidebar(_ref) {
853
956
  };
854
957
  }, []);
855
958
  var productName = globalProps$1.appName.substr(5).toLowerCase();
959
+ useEffect(function () {
960
+ var currentLink = navLinks.find(function (_ref2) {
961
+ var to = _ref2.to,
962
+ isActive = _ref2.isActive;
963
+ var url = new URL(to, window.location.href);
964
+ return is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
965
+ });
966
+ if (isPresent(currentLink) && equals(currentLink.label, SETTINGS)) {
967
+ setSelectedNavLink(currentLink);
968
+ }
969
+ }, []);
856
970
  return /*#__PURE__*/React.createElement("div", {
857
971
  "data-testid": "sidebar-container",
858
972
  className: classnames("neeto-molecules-sidebar__wrapper", {
@@ -864,14 +978,20 @@ var Sidebar = function Sidebar(_ref) {
864
978
  setIsSidebarPaneOpen(false);
865
979
  }
866
980
  }), /*#__PURE__*/React.createElement("div", {
867
- 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",
868
981
  "data-cy": "sidebar-wrapper",
869
- "data-testid": "sidebar"
982
+ "data-testid": "sidebar",
983
+ 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", {
984
+ "neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLink)
985
+ })
870
986
  }, /*#__PURE__*/React.createElement(Header$1, {
871
987
  customLogo: customLogo
872
- }), /*#__PURE__*/React.createElement(Links, {
873
- navLinks: navLinks
874
- }), /*#__PURE__*/React.createElement(Footer, {
988
+ }), isPresent(selectedNavLink) ? /*#__PURE__*/React.createElement(SelectedLink, {
989
+ setSelectedNavLink: setSelectedNavLink,
990
+ navLink: selectedNavLink
991
+ }) : /*#__PURE__*/React.createElement(Links, {
992
+ navLinks: navLinks,
993
+ setSelectedNavLink: setSelectedNavLink
994
+ }), isNotPresent(selectedNavLink) && /*#__PURE__*/React.createElement(Footer, {
875
995
  extraTopLinks: extraTopLinks,
876
996
  helpLinkOverrides: helpLinkOverrides,
877
997
  profileInfoOverrides: profileInfoOverrides,