@jetbrains/ring-ui-built 7.0.66 → 7.0.70

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.
Files changed (231) hide show
  1. package/components/_helpers/anchor.js +12 -17
  2. package/components/_helpers/avatar-info.js +4 -5
  3. package/components/_helpers/button.classes.js +20 -21
  4. package/components/_helpers/caption.js +3 -3
  5. package/components/_helpers/card.js +26 -32
  6. package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
  7. package/components/_helpers/icon-svg.js +9 -12
  8. package/components/_helpers/input.js +78 -86
  9. package/components/_helpers/loader-core.js +260 -0
  10. package/components/_helpers/query-assist-suggestions.js +0 -1
  11. package/components/_helpers/select-filter.js +19 -26
  12. package/components/_helpers/services-link.js +9 -12
  13. package/components/_helpers/sidebar.js +36 -44
  14. package/components/_helpers/tab-link.js +9 -11
  15. package/components/_helpers/theme.js +20 -24
  16. package/components/_helpers/title.js +12 -17
  17. package/components/alert/alert.js +41 -49
  18. package/components/alert/container.js +9 -12
  19. package/components/alert-service/alert-service.js +23 -32
  20. package/components/analytics/analytics-custom-plugin.js +12 -17
  21. package/components/analytics/analytics.js +1 -3
  22. package/components/auth/auth-core.js +128 -170
  23. package/components/auth/auth.js +3 -10
  24. package/components/auth/background-flow.js +5 -8
  25. package/components/auth/down-notification.js +9 -17
  26. package/components/auth/iframe-flow.js +13 -19
  27. package/components/auth/request-builder.js +4 -9
  28. package/components/auth/response-parser.js +9 -12
  29. package/components/auth/storage.js +12 -18
  30. package/components/auth/token-validator.js +19 -30
  31. package/components/auth/window-flow.js +22 -27
  32. package/components/auth-dialog/auth-dialog.js +40 -48
  33. package/components/auth-dialog-service/auth-dialog-service.js +10 -13
  34. package/components/avatar/avatar.figma.js +6 -6
  35. package/components/avatar/avatar.js +58 -59
  36. package/components/avatar/fallback-avatar.js +8 -11
  37. package/components/avatar-stack/avatar-stack.figma.js +10 -11
  38. package/components/avatar-stack/avatar-stack.js +25 -31
  39. package/components/banner/banner.js +0 -6
  40. package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
  41. package/components/breadcrumbs/breadcrumbs.js +4 -5
  42. package/components/button/button.figma.js +15 -10
  43. package/components/button/button.js +59 -64
  44. package/components/button-group/button-group.js +11 -15
  45. package/components/button-group/caption.js +0 -1
  46. package/components/button-set/button-set.js +9 -12
  47. package/components/button-toolbar/button-toolbar.js +8 -11
  48. package/components/caret/caret.js +20 -28
  49. package/components/checkbox/checkbox-group.figma.js +8 -10
  50. package/components/checkbox/checkbox.figma.js +5 -5
  51. package/components/checkbox/checkbox.js +27 -35
  52. package/components/clipboard/clipboard-fallback.js +3 -3
  53. package/components/clipboard/clipboard.js +3 -16
  54. package/components/code/code.js +8 -14
  55. package/components/collapse/collapse-content.js +10 -15
  56. package/components/collapse/collapse-control.js +5 -7
  57. package/components/collapse/collapse.js +9 -11
  58. package/components/collapse/utils.js +1 -1
  59. package/components/confirm/confirm.js +17 -26
  60. package/components/confirm-service/confirm-service.js +30 -31
  61. package/components/content-layout/content-layout.js +21 -28
  62. package/components/content-layout/sidebar.js +0 -2
  63. package/components/contenteditable/contenteditable.js +23 -28
  64. package/components/control-help/control-help.js +8 -10
  65. package/components/control-label/control-label.js +12 -17
  66. package/components/data-list/data-list.js +57 -65
  67. package/components/data-list/data-list.mock.js +0 -4
  68. package/components/data-list/item.js +65 -72
  69. package/components/data-list/selection.js +11 -19
  70. package/components/data-list/title.js +0 -4
  71. package/components/date-picker/consts.js +3 -4
  72. package/components/date-picker/date-input.js +25 -33
  73. package/components/date-picker/date-picker.js +179 -193
  74. package/components/date-picker/date-popup.js +135 -127
  75. package/components/date-picker/day.d.ts +1 -1
  76. package/components/date-picker/day.js +24 -30
  77. package/components/date-picker/month-names.js +7 -12
  78. package/components/date-picker/month-slider.js +16 -22
  79. package/components/date-picker/month.js +3 -5
  80. package/components/date-picker/months.js +6 -6
  81. package/components/date-picker/weekdays.js +0 -1
  82. package/components/date-picker/years.js +20 -26
  83. package/components/dialog/dialog-body-scroll-preventer.js +0 -1
  84. package/components/dialog/dialog.js +73 -83
  85. package/components/dropdown/anchor.js +0 -4
  86. package/components/dropdown/dropdown.js +98 -114
  87. package/components/dropdown-menu/dropdown-menu.js +80 -79
  88. package/components/editable-heading/editable-heading.js +48 -54
  89. package/components/error-bubble/error-bubble.figma.js +4 -4
  90. package/components/error-bubble/error-bubble.js +9 -13
  91. package/components/error-message/error-message.js +1 -6
  92. package/components/footer/footer.js +11 -15
  93. package/components/global/compose-refs.js +1 -4
  94. package/components/global/compose.js +1 -4
  95. package/components/global/configuration.js +3 -3
  96. package/components/global/controls-height.js +0 -1
  97. package/components/global/create-stateful-context.js +10 -14
  98. package/components/global/data-tests.js +2 -10
  99. package/components/global/dom.js +6 -19
  100. package/components/global/focus-sensor-hoc.js +74 -87
  101. package/components/global/fuzzy-highlight.js +3 -8
  102. package/components/global/get-uid.js +1 -1
  103. package/components/global/inject-styles.js +5 -6
  104. package/components/global/listeners.js +2 -11
  105. package/components/global/memoize.js +0 -2
  106. package/components/global/normalize-indent.js +2 -6
  107. package/components/global/promise-with-timeout.js +4 -5
  108. package/components/global/react-dom-renderer.js +4 -9
  109. package/components/global/rerender-hoc.js +8 -11
  110. package/components/global/schedule-raf.js +1 -2
  111. package/components/global/theme.js +0 -5
  112. package/components/global/trivial-template-tag.js +1 -6
  113. package/components/global/url.js +2 -6
  114. package/components/global/use-event-callback.js +2 -3
  115. package/components/grid/col.js +7 -18
  116. package/components/grid/grid.js +9 -14
  117. package/components/grid/row.js +7 -11
  118. package/components/group/group.js +9 -12
  119. package/components/header/header-icon.js +8 -13
  120. package/components/header/header.js +16 -27
  121. package/components/header/links.js +7 -10
  122. package/components/header/logo.js +12 -16
  123. package/components/header/profile.js +73 -83
  124. package/components/header/services-link.js +0 -2
  125. package/components/header/services.js +32 -43
  126. package/components/header/smart-profile.js +44 -59
  127. package/components/header/smart-services.js +33 -45
  128. package/components/header/tray.js +8 -10
  129. package/components/heading/heading.js +27 -27
  130. package/components/http/http.js +120 -125
  131. package/components/http/http.mock.js +6 -10
  132. package/components/hub-source/hub-source-user.js +6 -13
  133. package/components/hub-source/hub-source-users-groups.js +8 -12
  134. package/components/hub-source/hub-source.js +8 -10
  135. package/components/i18n/i18n-context.js +4 -7
  136. package/components/i18n/i18n.js +5 -5
  137. package/components/icon/icon-svg.js +0 -4
  138. package/components/icon/icon.js +28 -32
  139. package/components/icon/index.js +0 -4
  140. package/components/input/input.figma.js +8 -8
  141. package/components/input/input.js +0 -4
  142. package/components/island/adaptive-island-hoc.js +19 -23
  143. package/components/island/content.js +70 -75
  144. package/components/island/header.js +21 -21
  145. package/components/island/island.js +11 -14
  146. package/components/link/clickable-link.js +30 -37
  147. package/components/link/link.js +27 -29
  148. package/components/list/list-custom.js +6 -11
  149. package/components/list/list-item.js +49 -56
  150. package/components/list/list-separator.js +0 -1
  151. package/components/list/list-title.js +0 -1
  152. package/components/list/list-users-groups-source.js +14 -22
  153. package/components/list/list.classes.js +8 -9
  154. package/components/list/list.js +387 -404
  155. package/components/loader/loader-core.js +2 -265
  156. package/components/loader/loader.d.ts +8 -0
  157. package/components/loader/loader.js +43 -29
  158. package/components/loader-inline/loader-inline.js +9 -12
  159. package/components/loader-screen/loader-screen.js +10 -14
  160. package/components/login-dialog/login-dialog.js +46 -54
  161. package/components/login-dialog/service.js +13 -15
  162. package/components/message/message.js +65 -79
  163. package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
  164. package/components/old-browsers-message/old-browsers-message.js +1 -4
  165. package/components/old-browsers-message/white-list.js +5 -7
  166. package/components/pager/pager.js +73 -88
  167. package/components/panel/panel.js +9 -12
  168. package/components/permissions/permissions-cache.js +6 -8
  169. package/components/permissions/permissions.js +19 -21
  170. package/components/popup/popup.js +136 -145
  171. package/components/popup/popup.target.js +8 -10
  172. package/components/popup/position-css.js +19 -27
  173. package/components/popup/position.js +22 -28
  174. package/components/popup-menu/popup-menu.js +27 -37
  175. package/components/progress-bar/progress-bar.js +26 -32
  176. package/components/query-assist/query-assist-suggestions.js +0 -6
  177. package/components/query-assist/query-assist.js +432 -468
  178. package/components/radio/radio-item.js +30 -40
  179. package/components/radio/radio.js +6 -10
  180. package/components/scrollable-section/scrollable-section.js +7 -10
  181. package/components/select/select-filter.js +0 -6
  182. package/components/select/select-popup.js +155 -174
  183. package/components/select/select.js +464 -479
  184. package/components/shortcuts/core.js +40 -45
  185. package/components/shortcuts/shortcut-title.js +0 -1
  186. package/components/shortcuts/shortcuts-hoc.js +9 -15
  187. package/components/shortcuts/shortcuts.js +3 -5
  188. package/components/slider/slider.js +53 -66
  189. package/components/slider/slider.utils.js +1 -4
  190. package/components/storage/storage-local.js +2 -8
  191. package/components/storage/storage.js +0 -5
  192. package/components/style.css +1 -1
  193. package/components/tab-trap/tab-trap.js +21 -30
  194. package/components/table/cell.js +3 -4
  195. package/components/table/disable-hover-hoc.js +24 -28
  196. package/components/table/header-cell.js +30 -38
  197. package/components/table/header.js +20 -28
  198. package/components/table/multitable.js +81 -101
  199. package/components/table/row-with-focus-sensor.js +17 -28
  200. package/components/table/row.js +89 -99
  201. package/components/table/selection-adapter.js +0 -2
  202. package/components/table/selection-shortcuts-hoc.js +159 -161
  203. package/components/table/selection.js +23 -31
  204. package/components/table/simple-table.js +16 -22
  205. package/components/table/smart-table.js +19 -26
  206. package/components/table/table.js +137 -146
  207. package/components/tabs/collapsible-more.js +34 -47
  208. package/components/tabs/collapsible-tab.js +28 -33
  209. package/components/tabs/collapsible-tabs.js +16 -24
  210. package/components/tabs/custom-item.js +3 -6
  211. package/components/tabs/dumb-tabs.js +48 -64
  212. package/components/tabs/smart-tabs.js +14 -23
  213. package/components/tabs/tab-link.js +0 -2
  214. package/components/tabs/tab.js +0 -1
  215. package/components/tabs/tabs.js +0 -7
  216. package/components/tag/tag.js +30 -35
  217. package/components/tags-input/tags-input.js +192 -218
  218. package/components/tags-list/tags-list.js +26 -31
  219. package/components/text/text.js +16 -19
  220. package/components/toggle/toggle.js +19 -23
  221. package/components/tooltip/tooltip.js +110 -121
  222. package/components/upload/upload.js +19 -28
  223. package/components/user-agreement/service.js +247 -252
  224. package/components/user-agreement/toolbox.eula.js +160 -1
  225. package/components/user-agreement/user-agreement.js +23 -32
  226. package/components/user-card/card.js +0 -5
  227. package/components/user-card/smart-user-card-tooltip.js +41 -50
  228. package/components/user-card/tooltip.js +32 -38
  229. package/components/user-card/user-card.js +0 -5
  230. package/package.json +9 -3
  231. package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
@@ -1,10 +1,3 @@
1
- import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.regexp.exec.js';
3
- import 'core-js/modules/es.string.replace.js';
4
- import 'core-js/modules/web.dom-collections.iterator.js';
5
- import 'core-js/modules/web.url.js';
6
- import 'core-js/modules/web.url.to-json.js';
7
- import 'core-js/modules/web.url-search-params.js';
8
1
  import { getAbsoluteBaseURL, fixUrl } from '../global/url.js';
9
2
  import Listeners from '../global/listeners.js';
10
3
  import HTTP from '../http/http.js';
@@ -15,7 +8,6 @@ import AuthResponseParser from './response-parser.js';
15
8
  import AuthRequestBuilder from './request-builder.js';
16
9
  import BackgroundFlow from './background-flow.js';
17
10
  import TokenValidator from './token-validator.js';
18
- import 'core-js/modules/es.array.sort.js';
19
11
  import '../storage/storage-local.js';
20
12
  import '../alert-service/alert-service.js';
21
13
  import 'react/jsx-runtime';
@@ -98,24 +90,32 @@ const DEFAULT_CONFIG = {
98
90
  translations: null
99
91
  };
100
92
  class Auth {
93
+ static DEFAULT_CONFIG = DEFAULT_CONFIG;
94
+ static API_PATH = 'api/rest/';
95
+ static API_AUTH_PATH = 'oauth2/auth';
96
+ static API_PROFILE_PATH = 'users/me';
97
+ static CLOSE_BACKEND_DOWN_MESSAGE = 'backend-check-succeeded';
98
+ static CLOSE_WINDOW_MESSAGE = 'close-login-window';
99
+ static shouldRefreshToken = TokenValidator.shouldRefreshToken;
100
+ static storageIsUnavailable = !navigator.cookieEnabled;
101
+ config;
102
+ listeners = new Listeners();
103
+ http;
104
+ _service = {};
105
+ _storage;
106
+ _responseParser = new AuthResponseParser();
107
+ _requestBuilder = null;
108
+ _backgroundFlow;
109
+ _embeddedFlow = null;
110
+ _tokenValidator = null;
111
+ _postponed = false;
112
+ _backendCheckPromise = null;
113
+ _authDialogService = undefined;
114
+ _domainStorage;
115
+ user = null;
116
+ _initDeferred;
117
+ _isLoginWindowOpen;
101
118
  constructor(config) {
102
- _defineProperty(this, "config", void 0);
103
- _defineProperty(this, "listeners", new Listeners());
104
- _defineProperty(this, "http", void 0);
105
- _defineProperty(this, "_service", {});
106
- _defineProperty(this, "_storage", void 0);
107
- _defineProperty(this, "_responseParser", new AuthResponseParser());
108
- _defineProperty(this, "_requestBuilder", null);
109
- _defineProperty(this, "_backgroundFlow", void 0);
110
- _defineProperty(this, "_embeddedFlow", null);
111
- _defineProperty(this, "_tokenValidator", null);
112
- _defineProperty(this, "_postponed", false);
113
- _defineProperty(this, "_backendCheckPromise", null);
114
- _defineProperty(this, "_authDialogService", undefined);
115
- _defineProperty(this, "_domainStorage", void 0);
116
- _defineProperty(this, "user", null);
117
- _defineProperty(this, "_initDeferred", void 0);
118
- _defineProperty(this, "_isLoginWindowOpen", void 0);
119
119
  if (!config) {
120
120
  throw new Error('Config is required');
121
121
  }
@@ -124,10 +124,13 @@ class Auth {
124
124
  }
125
125
  const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param => Object.prototype.hasOwnProperty.call(config, param));
126
126
  if (unsupportedParams.length !== 0) {
127
- throw new Error("The following parameters are no longer supported: ".concat(unsupportedParams.join(', '), ". Please change them from snake_case to camelCase."));
127
+ throw new Error(`The following parameters are no longer supported: ${unsupportedParams.join(', ')}. Please change them from snake_case to camelCase.`);
128
128
  }
129
129
  config.userFields = config.userFields || [];
130
- this.config = _objectSpread2(_objectSpread2({}, Auth.DEFAULT_CONFIG), config);
130
+ this.config = {
131
+ ...Auth.DEFAULT_CONFIG,
132
+ ...config
133
+ };
131
134
  const {
132
135
  clientId,
133
136
  redirect,
@@ -148,10 +151,10 @@ class Auth {
148
151
  scope.push(Auth.DEFAULT_CONFIG.clientId);
149
152
  }
150
153
  this._storage = new AuthStorage({
151
- messagePrefix: "".concat(clientId, "-message-"),
152
- stateKeyPrefix: "".concat(clientId, "-states-"),
153
- tokenKey: "".concat(clientId, "-token"),
154
- userKey: "".concat(clientId, "-user-")
154
+ messagePrefix: `${clientId}-message-`,
155
+ stateKeyPrefix: `${clientId}-states-`,
156
+ tokenKey: `${clientId}-token`,
157
+ userKey: `${clientId}-user-`
155
158
  });
156
159
  this._domainStorage = new AuthStorage({
157
160
  messagePrefix: 'domain-message-'
@@ -204,20 +207,13 @@ class Auth {
204
207
  }
205
208
  });
206
209
  if (this.config.cacheCurrentUser) {
207
- this.addListener(LOGOUT_EVENT, () => {
208
- var _this$_storage;
209
- return (_this$_storage = this._storage) === null || _this$_storage === void 0 ? void 0 : _this$_storage.wipeCachedCurrentUser();
210
- });
211
- this.addListener(USER_CHANGED_EVENT, () => {
212
- var _this$_storage2;
213
- return (_this$_storage2 = this._storage) === null || _this$_storage2 === void 0 ? void 0 : _this$_storage2.onUserChanged();
214
- });
210
+ this.addListener(LOGOUT_EVENT, () => this._storage?.wipeCachedCurrentUser());
211
+ this.addListener(USER_CHANGED_EVENT, () => this._storage?.onUserChanged());
215
212
  }
216
213
  this._createInitDeferred();
217
214
  this.setUpPreconnect(config.serverUri);
218
215
  }
219
- _setPostponed() {
220
- let postponed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
216
+ _setPostponed(postponed = false) {
221
217
  this._postponed = postponed;
222
218
  }
223
219
  _updateDomainUser(userID) {
@@ -252,8 +248,7 @@ class Auth {
252
248
  */
253
249
  // eslint-disable-next-line complexity
254
250
  async init() {
255
- var _this$_storage3;
256
- (_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 || _this$_storage3.onTokenChange(async token => {
251
+ this._storage?.onTokenChange(async token => {
257
252
  const isGuest = this.user ? this.user.guest : false;
258
253
  if (isGuest && !token) {
259
254
  return;
@@ -301,18 +296,16 @@ class Auth {
301
296
  return new Promise(noop);
302
297
  }
303
298
  try {
304
- var _this$_tokenValidator, _this$_initDeferred, _this$_initDeferred$r, _state;
305
299
  // Check if there is a valid token
306
- await ((_this$_tokenValidator = this._tokenValidator) === null || _this$_tokenValidator === void 0 ? void 0 : _this$_tokenValidator.validateToken());
300
+ await this._tokenValidator?.validateToken();
307
301
  // Checking if there is a message left by another app on this domain
308
- const message = await this._domainStorage._messagesStorage.get("domain-message-".concat(DOMAIN_USER_CHANGED_EVENT));
302
+ const message = await this._domainStorage._messagesStorage.get(`domain-message-${DOMAIN_USER_CHANGED_EVENT}`);
309
303
  if (message) {
310
- var _this$user;
311
304
  const {
312
305
  userID,
313
306
  serviceID
314
307
  } = message;
315
- if (serviceID !== this.config.clientId && (!userID || ((_this$user = this.user) === null || _this$user === void 0 ? void 0 : _this$user.id) !== userID)) {
308
+ if (serviceID !== this.config.clientId && (!userID || this.user?.id !== userID)) {
316
309
  this.forceTokenUpdate();
317
310
  }
318
311
  }
@@ -322,12 +315,11 @@ class Auth {
322
315
  // Check if we have requested to restore state anyway
323
316
  state = await this._checkForStateRestoration();
324
317
  }
325
- (_this$_initDeferred = this._initDeferred) === null || _this$_initDeferred === void 0 || (_this$_initDeferred$r = _this$_initDeferred.resolve) === null || _this$_initDeferred$r === void 0 || _this$_initDeferred$r.call(_this$_initDeferred, state && state.restoreLocation);
326
- return (_state = state) === null || _state === void 0 ? void 0 : _state.restoreLocation;
318
+ this._initDeferred?.resolve?.(state && state.restoreLocation);
319
+ return state?.restoreLocation;
327
320
  } catch (error) {
328
321
  if (Auth.storageIsUnavailable) {
329
- var _this$_initDeferred2, _this$_initDeferred2$;
330
- (_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 || (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0 || _this$_initDeferred2$.call(_this$_initDeferred2); // No way to handle if cookies are disabled
322
+ this._initDeferred?.resolve?.(); // No way to handle if cookies are disabled
331
323
  await this.requestUser(); // Someone may expect user to be loaded as a part of token validation
332
324
  return null;
333
325
  }
@@ -335,8 +327,7 @@ class Auth {
335
327
  }
336
328
  }
337
329
  async sendRedirect(error) {
338
- var _this$_requestBuilder;
339
- const authRequest = await ((_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder === void 0 ? void 0 : _this$_requestBuilder.prepareAuthRequest());
330
+ const authRequest = await this._requestBuilder?.prepareAuthRequest();
340
331
  if (authRequest) {
341
332
  this._redirectCurrentPage(authRequest.url);
342
333
  }
@@ -349,12 +340,10 @@ class Auth {
349
340
  async handleInitError(error) {
350
341
  if ('stateId' in error && error.stateId) {
351
342
  try {
352
- var _this$_storage4;
353
- const state = await ((_this$_storage4 = this._storage) === null || _this$_storage4 === void 0 ? void 0 : _this$_storage4.getState(error.stateId));
343
+ const state = await this._storage?.getState(error.stateId);
354
344
  if (state && state.nonRedirect) {
355
- var _this$_storage5;
356
345
  state.error = error;
357
- (_this$_storage5 = this._storage) === null || _this$_storage5 === void 0 || _this$_storage5.saveState(error.stateId, state);
346
+ this._storage?.saveState(error.stateId, state);
358
347
  // Return endless promise in the background to avoid service start
359
348
  return new Promise(noop);
360
349
  }
@@ -365,8 +354,7 @@ class Auth {
365
354
  throw error;
366
355
  }
367
356
  async handleInitValidationError(error) {
368
- var _error$cause, _this$_initDeferred4, _this$_initDeferred4$;
369
- if ('cause' in error && error.cause instanceof Error && ((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.message) === 'invalid_client') {
357
+ if ('cause' in error && error.cause instanceof Error && error.cause?.message === 'invalid_client') {
370
358
  // eslint-disable-next-line no-console
371
359
  console.error('RingUI Auth: invalid client detected. Logging out', error);
372
360
  await this.logout();
@@ -379,17 +367,16 @@ class Auth {
379
367
  // Background flow
380
368
  if ('authRedirect' in error && error.authRedirect && !this.config.redirect) {
381
369
  try {
382
- var _this$_backgroundFlow, _this$_tokenValidator2, _this$_initDeferred3, _this$_initDeferred3$;
383
- await ((_this$_backgroundFlow = this._backgroundFlow) === null || _this$_backgroundFlow === void 0 ? void 0 : _this$_backgroundFlow.authorize());
384
- await ((_this$_tokenValidator2 = this._tokenValidator) === null || _this$_tokenValidator2 === void 0 ? void 0 : _this$_tokenValidator2.validateToken());
385
- (_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 || (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0 || _this$_initDeferred3$.call(_this$_initDeferred3);
370
+ await this._backgroundFlow?.authorize();
371
+ await this._tokenValidator?.validateToken();
372
+ this._initDeferred?.resolve?.();
386
373
  return undefined;
387
374
  } catch (validationError) {
388
375
  // Fallback to redirect flow
389
376
  return validationError instanceof Error ? this.sendRedirect(validationError) : undefined;
390
377
  }
391
378
  }
392
- (_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 === void 0 || (_this$_initDeferred4$ = _this$_initDeferred4.reject) === null || _this$_initDeferred4$ === void 0 || _this$_initDeferred4$.call(_this$_initDeferred4, error);
379
+ this._initDeferred?.reject?.(error);
393
380
  throw error;
394
381
  }
395
382
  /**
@@ -402,12 +389,12 @@ class Auth {
402
389
  throw new Error('You should log in to be able to make requests');
403
390
  }
404
391
  try {
405
- var _this$_initDeferred5, _await$this$_tokenVal, _this$_tokenValidator3;
406
- await ((_this$_initDeferred5 = this._initDeferred) === null || _this$_initDeferred5 === void 0 ? void 0 : _this$_initDeferred5.promise);
392
+ var _await$this$_tokenVal;
393
+ await this._initDeferred?.promise;
407
394
  if (Auth.storageIsUnavailable) {
408
395
  return null; // Forever guest if storage is unavailable
409
396
  }
410
- return (_await$this$_tokenVal = await ((_this$_tokenValidator3 = this._tokenValidator) === null || _this$_tokenValidator3 === void 0 ? void 0 : _this$_tokenValidator3.validateTokenLocally())) !== null && _await$this$_tokenVal !== void 0 ? _await$this$_tokenVal : null;
397
+ return (_await$this$_tokenVal = await this._tokenValidator?.validateTokenLocally()) !== null && _await$this$_tokenVal !== void 0 ? _await$this$_tokenVal : null;
411
398
  } catch (e) {
412
399
  return this.forceTokenUpdate();
413
400
  }
@@ -428,10 +415,9 @@ class Auth {
428
415
  this._backendCheckPromise = null;
429
416
  }
430
417
  try {
431
- var _await$this$_backgrou, _this$_backgroundFlow2;
432
- return (_await$this$_backgrou = await ((_this$_backgroundFlow2 = this._backgroundFlow) === null || _this$_backgroundFlow2 === void 0 ? void 0 : _this$_backgroundFlow2.authorize())) !== null && _await$this$_backgrou !== void 0 ? _await$this$_backgrou : null;
418
+ var _await$this$_backgrou;
419
+ return (_await$this$_backgrou = await this._backgroundFlow?.authorize()) !== null && _await$this$_backgrou !== void 0 ? _await$this$_backgrou : null;
433
420
  } catch (error) {
434
- var _this$_requestBuilder2;
435
421
  if (!(error instanceof Error)) {
436
422
  return null;
437
423
  }
@@ -439,8 +425,7 @@ class Auth {
439
425
  return new Promise(resolve => {
440
426
  const onTryAgain = async () => {
441
427
  try {
442
- var _this$_backgroundFlow3;
443
- const result = await ((_this$_backgroundFlow3 = this._backgroundFlow) === null || _this$_backgroundFlow3 === void 0 ? void 0 : _this$_backgroundFlow3.authorize());
428
+ const result = await this._backgroundFlow?.authorize();
444
429
  resolve(result !== null && result !== void 0 ? result : null);
445
430
  } catch (retryError) {
446
431
  if (retryError instanceof Error) {
@@ -460,7 +445,7 @@ class Auth {
460
445
  });
461
446
  });
462
447
  }
463
- const authRequest = await ((_this$_requestBuilder2 = this._requestBuilder) === null || _this$_requestBuilder2 === void 0 ? void 0 : _this$_requestBuilder2.prepareAuthRequest());
448
+ const authRequest = await this._requestBuilder?.prepareAuthRequest();
464
449
  if (authRequest) {
465
450
  this._redirectCurrentPage(authRequest.url);
466
451
  }
@@ -475,7 +460,7 @@ class Auth {
475
460
  const {
476
461
  serviceName,
477
462
  iconUrl: serviceImage
478
- } = (await this.http.get("oauth2/interactive/login/settings?client_id=".concat(this.config.clientId))) || {};
463
+ } = (await this.http.get(`oauth2/interactive/login/settings?client_id=${this.config.clientId}`)) || {};
479
464
  this.setCurrentService({
480
465
  serviceImage,
481
466
  serviceName
@@ -492,8 +477,7 @@ class Auth {
492
477
  */
493
478
  getUser(accessToken) {
494
479
  if (this.config.cacheCurrentUser) {
495
- var _this$_storage6;
496
- return (_this$_storage6 = this._storage) === null || _this$_storage6 === void 0 ? void 0 : _this$_storage6.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
480
+ return this._storage?.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
497
481
  }
498
482
  return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
499
483
  }
@@ -514,10 +498,9 @@ class Auth {
514
498
  return user;
515
499
  }
516
500
  async updateUser() {
517
- var _this$_storage7;
518
501
  this._setPostponed(false);
519
502
  const accessToken = await this.requestToken();
520
- (_this$_storage7 = this._storage) === null || _this$_storage7 === void 0 || _this$_storage7.wipeCachedCurrentUser();
503
+ this._storage?.wipeCachedCurrentUser();
521
504
  const user = await this.getUser(accessToken);
522
505
  this.user = user;
523
506
  this.listeners.trigger(USER_CHANGED_EVENT, user);
@@ -557,27 +540,25 @@ class Auth {
557
540
  }
558
541
  this.logout();
559
542
  }
560
- _showAuthDialog() {
561
- var _this$user2, _this$_authDialogServ, _this$_storage9, _this$_storage0;
562
- let {
563
- nonInteractive,
564
- error,
565
- canCancel,
566
- onTryAgain
567
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
543
+ _showAuthDialog({
544
+ nonInteractive,
545
+ error,
546
+ canCancel,
547
+ onTryAgain
548
+ } = {}) {
568
549
  const {
569
550
  embeddedLogin,
570
551
  onPostponeLogout,
571
552
  translations
572
553
  } = this.config;
573
- const cancelable = ((_this$user2 = this.user) === null || _this$user2 === void 0 ? void 0 : _this$user2.guest) || canCancel;
554
+ const cancelable = this.user?.guest || canCancel;
574
555
  const actualTranslations = translations !== null && translations !== void 0 ? translations : getTranslations();
575
556
  this._createInitDeferred();
576
557
  const closeDialog = () => {
577
558
  /* eslint-disable @typescript-eslint/no-use-before-define */
578
- stopTokenListening === null || stopTokenListening === void 0 || stopTokenListening();
579
- stopMessageListening === null || stopMessageListening === void 0 || stopMessageListening();
580
- hide === null || hide === void 0 || hide();
559
+ stopTokenListening?.();
560
+ stopMessageListening?.();
561
+ hide?.();
581
562
  /* eslint-enable @typescript-eslint/no-use-before-define */
582
563
  };
583
564
  const onConfirm = () => {
@@ -589,29 +570,27 @@ class Auth {
589
570
  this._runEmbeddedLogin();
590
571
  };
591
572
  const onCancel = () => {
592
- var _this$_embeddedFlow, _this$_storage8, _this$user3;
593
- (_this$_embeddedFlow = this._embeddedFlow) === null || _this$_embeddedFlow === void 0 || _this$_embeddedFlow.stop();
594
- (_this$_storage8 = this._storage) === null || _this$_storage8 === void 0 || _this$_storage8.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
573
+ this._embeddedFlow?.stop();
574
+ this._storage?.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
595
575
  closeDialog();
596
576
  if (!cancelable) {
597
- var _this$_initDeferred6, _this$_initDeferred6$;
598
- (_this$_initDeferred6 = this._initDeferred) === null || _this$_initDeferred6 === void 0 || (_this$_initDeferred6$ = _this$_initDeferred6.resolve) === null || _this$_initDeferred6$ === void 0 || _this$_initDeferred6$.call(_this$_initDeferred6);
577
+ this._initDeferred?.resolve?.();
599
578
  this.listeners.trigger(LOGOUT_POSTPONED_EVENT);
600
579
  onPostponeLogout();
601
580
  return;
602
581
  }
603
- if ((_this$user3 = this.user) !== null && _this$user3 !== void 0 && _this$user3.guest && nonInteractive) {
582
+ if (this.user?.guest && nonInteractive) {
604
583
  this.forceTokenUpdate();
605
584
  } else {
606
- var _this$_initDeferred7, _this$_initDeferred7$;
607
- (_this$_initDeferred7 = this._initDeferred) === null || _this$_initDeferred7 === void 0 || (_this$_initDeferred7$ = _this$_initDeferred7.resolve) === null || _this$_initDeferred7$ === void 0 || _this$_initDeferred7$.call(_this$_initDeferred7);
585
+ this._initDeferred?.resolve?.();
608
586
  }
609
587
  };
610
588
  const onTryAgainClick = async () => {
611
- await (onTryAgain === null || onTryAgain === void 0 ? void 0 : onTryAgain());
589
+ await onTryAgain?.();
612
590
  closeDialog();
613
591
  };
614
- const hide = (_this$_authDialogServ = this._authDialogService) === null || _this$_authDialogServ === void 0 ? void 0 : _this$_authDialogServ.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
592
+ const hide = this._authDialogService?.({
593
+ ...this._service,
615
594
  loginCaption: actualTranslations.login,
616
595
  loginToCaption: actualTranslations.loginTo,
617
596
  confirmLabel: actualTranslations.login,
@@ -621,43 +600,38 @@ class Auth {
621
600
  onConfirm,
622
601
  onCancel,
623
602
  onTryAgain: onTryAgain ? onTryAgainClick : undefined
624
- }));
625
- const stopTokenListening = (_this$_storage9 = this._storage) === null || _this$_storage9 === void 0 ? void 0 : _this$_storage9.onTokenChange(token => {
603
+ });
604
+ const stopTokenListening = this._storage?.onTokenChange(token => {
626
605
  if (token) {
627
- var _this$_initDeferred8, _this$_initDeferred8$;
628
606
  closeDialog();
629
- (_this$_initDeferred8 = this._initDeferred) === null || _this$_initDeferred8 === void 0 || (_this$_initDeferred8$ = _this$_initDeferred8.resolve) === null || _this$_initDeferred8$ === void 0 || _this$_initDeferred8$.call(_this$_initDeferred8);
607
+ this._initDeferred?.resolve?.();
630
608
  }
631
609
  });
632
- const stopMessageListening = (_this$_storage0 = this._storage) === null || _this$_storage0 === void 0 ? void 0 : _this$_storage0.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => {
633
- var _this$_embeddedFlow2;
634
- return (_this$_embeddedFlow2 = this._embeddedFlow) === null || _this$_embeddedFlow2 === void 0 ? void 0 : _this$_embeddedFlow2.stop();
635
- });
636
- }
637
- _showUserChangedDialog(_ref) {
638
- var _this$_authDialogServ2, _translations$youHave, _newUser$name, _newUser$name2, _translations$login, _translations$loginTo, _translations$applyCh, _translations$tryAgai, _translations$postpon;
639
- let {
640
- newUser,
641
- onApply,
642
- onPostpone
643
- } = _ref;
610
+ const stopMessageListening = this._storage?.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => this._embeddedFlow?.stop());
611
+ }
612
+ _showUserChangedDialog({
613
+ newUser,
614
+ onApply,
615
+ onPostpone
616
+ }) {
617
+ var _translations$youHave, _newUser$name, _newUser$name2, _translations$login, _translations$loginTo, _translations$applyCh, _translations$tryAgai, _translations$postpon;
644
618
  const {
645
619
  translations
646
620
  } = this.config;
647
621
  this._createInitDeferred();
648
622
  const done = () => {
649
- var _this$_initDeferred9, _this$_initDeferred9$;
650
- (_this$_initDeferred9 = this._initDeferred) === null || _this$_initDeferred9 === void 0 || (_this$_initDeferred9$ = _this$_initDeferred9.resolve) === null || _this$_initDeferred9$ === void 0 || _this$_initDeferred9$.call(_this$_initDeferred9);
623
+ this._initDeferred?.resolve?.();
651
624
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
652
- hide === null || hide === void 0 || hide();
625
+ hide?.();
653
626
  };
654
- const hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 === void 0 ? void 0 : _this$_authDialogServ2.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
655
- title: (_translations$youHave = translations === null || translations === void 0 ? void 0 : translations.youHaveLoggedInAs) !== null && _translations$youHave !== void 0 ? _translations$youHave : translate('youHaveLoggedInAs').replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : '').replace('{{userName}}', (_newUser$name2 = newUser.name) !== null && _newUser$name2 !== void 0 ? _newUser$name2 : ''),
656
- loginCaption: (_translations$login = translations === null || translations === void 0 ? void 0 : translations.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
657
- loginToCaption: (_translations$loginTo = translations === null || translations === void 0 ? void 0 : translations.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
658
- confirmLabel: (_translations$applyCh = translations === null || translations === void 0 ? void 0 : translations.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
659
- tryAgainLabel: (_translations$tryAgai = translations === null || translations === void 0 ? void 0 : translations.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
660
- cancelLabel: (_translations$postpon = translations === null || translations === void 0 ? void 0 : translations.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
627
+ const hide = this._authDialogService?.({
628
+ ...this._service,
629
+ title: (_translations$youHave = translations?.youHaveLoggedInAs) !== null && _translations$youHave !== void 0 ? _translations$youHave : translate('youHaveLoggedInAs').replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : '').replace('{{userName}}', (_newUser$name2 = newUser.name) !== null && _newUser$name2 !== void 0 ? _newUser$name2 : ''),
630
+ loginCaption: (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
631
+ loginToCaption: (_translations$loginTo = translations?.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
632
+ confirmLabel: (_translations$applyCh = translations?.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
633
+ tryAgainLabel: (_translations$tryAgai = translations?.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
634
+ cancelLabel: (_translations$postpon = translations?.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
661
635
  onConfirm: () => {
662
636
  done();
663
637
  onApply();
@@ -666,10 +640,9 @@ class Auth {
666
640
  done();
667
641
  onPostpone();
668
642
  }
669
- }));
643
+ });
670
644
  }
671
- _extractErrorMessage(error) {
672
- let logError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
645
+ _extractErrorMessage(error, logError = false) {
673
646
  if (!error) {
674
647
  return null;
675
648
  }
@@ -682,9 +655,9 @@ class Auth {
682
655
  // https://www.jetbrains.com/help/youtrack/devportal/OAuth-2.0-Errors.html
683
656
  if ('code' in error && error.code && typeof error.code === 'object' && 'code' in error.code && typeof error.code.code === 'string') {
684
657
  const readableCode = error.code.code.split('_').join(' ');
685
- return "Authorization error: ".concat(readableCode);
658
+ return `Authorization error: ${readableCode}`;
686
659
  }
687
- } catch (_unused) {
660
+ } catch {
688
661
  // noop
689
662
  }
690
663
  return error.toString ? error.toString() : null;
@@ -697,19 +670,17 @@ class Auth {
697
670
  const REPEAT_TIMEOUT = 5000;
698
671
  let timerId;
699
672
  return new Promise((resolve, reject) => {
700
- var _this$_storage10;
701
673
  const done = () => {
702
- var _this$_storage1;
703
674
  /* eslint-disable @typescript-eslint/no-use-before-define */
704
675
  hide();
705
676
  window.removeEventListener('online', onCheckAgain);
706
- stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
677
+ stopListeningCloseMessage?.();
707
678
  /* eslint-enable @typescript-eslint/no-use-before-define */
708
- (_this$_storage1 = this._storage) === null || _this$_storage1 === void 0 || _this$_storage1.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
679
+ this._storage?.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
709
680
  clearTimeout(timerId);
710
681
  };
711
- const stopListeningCloseMessage = (_this$_storage10 = this._storage) === null || _this$_storage10 === void 0 ? void 0 : _this$_storage10.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
712
- stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
682
+ const stopListeningCloseMessage = this._storage?.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
683
+ stopListeningCloseMessage?.();
713
684
  done();
714
685
  resolve();
715
686
  });
@@ -742,26 +713,24 @@ class Auth {
742
713
  * Wipe accessToken and redirect to auth page with required authorization
743
714
  */
744
715
  async logout(extraParams) {
745
- var _this$_storage11, _this$_requestBuilder3;
746
- const requestParams = _objectSpread2({
747
- request_credentials: 'required'
748
- }, extraParams);
716
+ const requestParams = {
717
+ request_credentials: 'required',
718
+ ...extraParams
719
+ };
749
720
  await this._checkBackendsStatusesIfEnabled();
750
721
  await this.listeners.trigger('logout');
751
722
  this._updateDomainUser(null);
752
- await ((_this$_storage11 = this._storage) === null || _this$_storage11 === void 0 ? void 0 : _this$_storage11.wipeToken());
753
- const authRequest = await ((_this$_requestBuilder3 = this._requestBuilder) === null || _this$_requestBuilder3 === void 0 ? void 0 : _this$_requestBuilder3.prepareAuthRequest(requestParams));
723
+ await this._storage?.wipeToken();
724
+ const authRequest = await this._requestBuilder?.prepareAuthRequest(requestParams);
754
725
  if (authRequest) {
755
726
  this._redirectCurrentPage(authRequest.url);
756
727
  }
757
728
  }
758
729
  async _runEmbeddedLogin() {
759
- var _this$_storage12;
760
- (_this$_storage12 = this._storage) === null || _this$_storage12 === void 0 || _this$_storage12.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
730
+ this._storage?.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
761
731
  try {
762
- var _this$_embeddedFlow3;
763
732
  this._isLoginWindowOpen = true;
764
- return await ((_this$_embeddedFlow3 = this._embeddedFlow) === null || _this$_embeddedFlow3 === void 0 ? void 0 : _this$_embeddedFlow3.authorize());
733
+ return await this._embeddedFlow?.authorize();
765
734
  } finally {
766
735
  this._isLoginWindowOpen = false;
767
736
  }
@@ -777,8 +746,7 @@ class Auth {
777
746
  }
778
747
  await this._checkBackendsStatusesIfEnabled();
779
748
  try {
780
- var _this$_backgroundFlow4;
781
- const accessToken = await ((_this$_backgroundFlow4 = this._backgroundFlow) === null || _this$_backgroundFlow4 === void 0 ? void 0 : _this$_backgroundFlow4.authorize());
749
+ const accessToken = await this._backgroundFlow?.authorize();
782
750
  const user = await this.getUser(accessToken);
783
751
  if (user.guest) {
784
752
  this._beforeLogout();
@@ -809,11 +777,11 @@ class Auth {
809
777
  let urlFromState = null;
810
778
  try {
811
779
  urlFromState = new URL(state); // checking if state contains valid URL on same origin, see HUB-11514
812
- } catch (_unused2) {
780
+ } catch {
813
781
  return null;
814
782
  }
815
783
  if (urlFromState.origin !== window.location.origin) {
816
- throw new Error("State contains URL with different origin: \"".concat(state, "\""));
784
+ throw new Error(`State contains URL with different origin: "${state}"`);
817
785
  }
818
786
  return {
819
787
  restoreLocation: state,
@@ -857,30 +825,28 @@ class Auth {
857
825
  }
858
826
  }
859
827
  if (!newState) {
860
- throw new Error("Could not create state where stateId=\"".concat(stateId, "\""));
828
+ throw new Error(`Could not create state where stateId="${stateId}"`);
861
829
  }
862
830
  const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
863
831
  const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
864
832
  const expires = TokenValidator._epoch() + effectiveExpiresIn;
865
- if (accessToken) {
866
- var _this$_storage13;
867
- await ((_this$_storage13 = this._storage) === null || _this$_storage13 === void 0 ? void 0 : _this$_storage13.saveToken({
833
+ if (accessToken !== undefined) {
834
+ await this._storage?.saveToken({
868
835
  accessToken,
869
836
  scopes,
870
837
  expires,
871
838
  lifeTime: effectiveExpiresIn
872
- }));
839
+ });
873
840
  }
874
841
  return newState;
875
842
  }
876
843
  async _checkForStateRestoration() {
877
- var _this$_storage14;
878
844
  const authResponse = this._responseParser._authResponse;
879
845
  if (authResponse && this.config.cleanHash) {
880
846
  this.setHash('');
881
847
  }
882
- const stateId = authResponse === null || authResponse === void 0 ? void 0 : authResponse.restoreAuthState;
883
- return (await (stateId && ((_this$_storage14 = this._storage) === null || _this$_storage14 === void 0 ? void 0 : _this$_storage14.getState(stateId)))) || {};
848
+ const stateId = authResponse?.restoreAuthState;
849
+ return (await (stateId && this._storage?.getState(stateId))) || {};
884
850
  }
885
851
  _checkBackendsAreUp() {
886
852
  const abortCtrl = new AbortController();
@@ -954,20 +920,12 @@ class Auth {
954
920
  // NB! URL to redirect is formed manually because baseURI could be messed up,
955
921
  // in which case it's not obvious where redirect will lead.
956
922
  const cleanedUrl = [window.location.pathname, window.location.search].join('');
957
- const hashIfExist = hash ? "#".concat(hash) : '';
958
- history.replaceState(undefined, '', "".concat(cleanedUrl).concat(hashIfExist));
923
+ const hashIfExist = hash ? `#${hash}` : '';
924
+ history.replaceState(undefined, '', `${cleanedUrl}${hashIfExist}`);
959
925
  } else {
960
926
  window.location.hash = hash;
961
927
  }
962
928
  }
963
929
  }
964
- _defineProperty(Auth, "DEFAULT_CONFIG", DEFAULT_CONFIG);
965
- _defineProperty(Auth, "API_PATH", 'api/rest/');
966
- _defineProperty(Auth, "API_AUTH_PATH", 'oauth2/auth');
967
- _defineProperty(Auth, "API_PROFILE_PATH", 'users/me');
968
- _defineProperty(Auth, "CLOSE_BACKEND_DOWN_MESSAGE", 'backend-check-succeeded');
969
- _defineProperty(Auth, "CLOSE_WINDOW_MESSAGE", 'close-login-window');
970
- _defineProperty(Auth, "shouldRefreshToken", TokenValidator.shouldRefreshToken);
971
- _defineProperty(Auth, "storageIsUnavailable", !navigator.cookieEnabled);
972
930
 
973
931
  export { Auth, DEFAULT_BACKGROUND_TIMEOUT, DEFAULT_EXPIRES_TIMEOUT, DOMAIN_USER_CHANGED_EVENT, LOGOUT_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGED_EVENT, USER_CHANGE_POSTPONED_EVENT, Auth as default };
@@ -1,15 +1,11 @@
1
- import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import WindowFlow from './window-flow.js';
3
2
  import onBackendDown from './down-notification.js';
4
3
  import Auth from './auth-core.js';
5
4
  export { DEFAULT_BACKGROUND_TIMEOUT, DEFAULT_EXPIRES_TIMEOUT, DOMAIN_USER_CHANGED_EVENT, LOGOUT_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGED_EVENT, USER_CHANGE_POSTPONED_EVENT } from './auth-core.js';
6
5
  import './response-parser.js';
7
- import 'core-js/modules/es.regexp.exec.js';
8
- import 'core-js/modules/es.string.replace.js';
9
6
  import '../global/url.js';
10
7
  import 'react/jsx-runtime';
11
8
  import '../alert-service/alert-service.js';
12
- import 'core-js/modules/web.dom-collections.iterator.js';
13
9
  import 'react-dom/client';
14
10
  import '../global/get-uid.js';
15
11
  import '../alert/alert.js';
@@ -46,16 +42,12 @@ import '../global/sniffer.js';
46
42
  import 'sniffr';
47
43
  import '../tab-trap/tab-trap.js';
48
44
  import '../popup/position.js';
49
- import 'core-js/modules/es.array.sort.js';
50
45
  import '../popup/popup.consts.js';
51
46
  import '../popup/position-css.js';
52
47
  import '../alert/container.js';
53
48
  import '../link/link.js';
54
49
  import '../_helpers/link.js';
55
50
  import '../group/group.js';
56
- import 'core-js/modules/web.url.js';
57
- import 'core-js/modules/web.url.to-json.js';
58
- import 'core-js/modules/web.url-search-params.js';
59
51
  import '../global/listeners.js';
60
52
  import '../http/http.js';
61
53
  import '../global/promise-with-timeout.js';
@@ -99,9 +91,10 @@ import './token-validator.js';
99
91
  /**
100
92
  * Extend Auth config with non-required and not pure-JS stuff
101
93
  */
102
- Auth.DEFAULT_CONFIG = _objectSpread2(_objectSpread2({}, Auth.DEFAULT_CONFIG), {}, {
94
+ Auth.DEFAULT_CONFIG = {
95
+ ...Auth.DEFAULT_CONFIG,
103
96
  EmbeddedLoginFlow: WindowFlow,
104
97
  onBackendDown: onBackendDown
105
- });
98
+ };
106
99
 
107
100
  export { Auth, Auth as default };