@seamly/web-ui 22.1.0 → 22.3.0-beta.1

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 (66) hide show
  1. package/build/dist/lib/components.js +698 -318
  2. package/build/dist/lib/components.js.map +1 -1
  3. package/build/dist/lib/components.min.js +1 -1
  4. package/build/dist/lib/components.min.js.LICENSE.txt +2 -2
  5. package/build/dist/lib/components.min.js.map +1 -1
  6. package/build/dist/lib/hooks.js +301 -60
  7. package/build/dist/lib/hooks.js.map +1 -1
  8. package/build/dist/lib/hooks.min.js +1 -1
  9. package/build/dist/lib/hooks.min.js.map +1 -1
  10. package/build/dist/lib/index.debug.js +80 -58
  11. package/build/dist/lib/index.debug.js.map +1 -1
  12. package/build/dist/lib/index.debug.min.js +1 -1
  13. package/build/dist/lib/index.debug.min.js.LICENSE.txt +12 -4
  14. package/build/dist/lib/index.debug.min.js.map +1 -1
  15. package/build/dist/lib/index.js +718 -325
  16. package/build/dist/lib/index.js.map +1 -1
  17. package/build/dist/lib/index.min.js +1 -1
  18. package/build/dist/lib/index.min.js.LICENSE.txt +2 -2
  19. package/build/dist/lib/index.min.js.map +1 -1
  20. package/build/dist/lib/standalone.js +803 -348
  21. package/build/dist/lib/standalone.js.map +1 -1
  22. package/build/dist/lib/standalone.min.js +1 -1
  23. package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
  24. package/build/dist/lib/standalone.min.js.map +1 -1
  25. package/build/dist/lib/style-guide.js +830 -323
  26. package/build/dist/lib/style-guide.js.map +1 -1
  27. package/build/dist/lib/style-guide.min.js +1 -1
  28. package/build/dist/lib/style-guide.min.js.LICENSE.txt +2 -2
  29. package/build/dist/lib/style-guide.min.js.map +1 -1
  30. package/build/dist/lib/styles-default-implementation.js +1 -1
  31. package/build/dist/lib/styles.css +1 -1
  32. package/build/dist/lib/styles.js +1 -1
  33. package/build/dist/lib/utils.js +783 -360
  34. package/build/dist/lib/utils.js.map +1 -1
  35. package/build/dist/lib/utils.min.js +1 -1
  36. package/build/dist/lib/utils.min.js.LICENSE.txt +1 -1
  37. package/build/dist/lib/utils.min.js.map +1 -1
  38. package/package.json +28 -28
  39. package/src/javascripts/api/errors/seamly-api-error.ts +0 -1
  40. package/src/javascripts/api/index.ts +29 -9
  41. package/src/javascripts/domains/app/actions.ts +8 -3
  42. package/src/javascripts/domains/config/slice.ts +2 -1
  43. package/src/javascripts/domains/forms/selectors.ts +6 -8
  44. package/src/javascripts/domains/forms/slice.ts +1 -1
  45. package/src/javascripts/domains/interrupt/selectors.ts +3 -2
  46. package/src/javascripts/domains/interrupt/slice.ts +2 -0
  47. package/src/javascripts/domains/redux/create-debounced-async-thunk.ts +109 -0
  48. package/src/javascripts/domains/redux/redux.types.ts +2 -1
  49. package/src/javascripts/domains/store/actions.ts +38 -0
  50. package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +3 -1
  51. package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +62 -35
  52. package/src/javascripts/domains/translations/slice.ts +8 -1
  53. package/src/javascripts/domains/visibility/actions.ts +4 -1
  54. package/src/javascripts/lib/engine/index.tsx +3 -1
  55. package/src/javascripts/style-guide/states.js +65 -1
  56. package/src/javascripts/ui/components/conversation/event/{card-component.js → card-component.tsx} +6 -4
  57. package/src/javascripts/ui/components/conversation/event/event-participant.js +1 -1
  58. package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +14 -30
  59. package/src/javascripts/ui/components/entry/text-entry/hooks.ts +2 -2
  60. package/src/javascripts/ui/components/form-controls/wrapper.tsx +13 -3
  61. package/src/javascripts/ui/components/view/window-view/window-open-button.js +8 -3
  62. package/src/javascripts/ui/hooks/use-session-expired-command.ts +31 -2
  63. package/src/stylesheets/5-components/_input.scss +0 -5
  64. package/src/stylesheets/5-components/_message-count.scss +11 -9
  65. package/src/stylesheets/5-components/_options.scss +2 -2
  66. package/src/stylesheets/5-components/_translation-options.scss +23 -3
@@ -2686,20 +2686,87 @@ const defaultConfig = {
2686
2686
 
2687
2687
  /***/ }),
2688
2688
 
2689
- /***/ 9201:
2689
+ /***/ 526:
2690
2690
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2691
2691
 
2692
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2693
- /* harmony export */ Z: () => (/* binding */ initializeApp),
2694
- /* harmony export */ m: () => (/* binding */ resetApp)
2695
- /* harmony export */ });
2696
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
2697
- /* harmony import */ var api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6821);
2698
- /* harmony import */ var api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7265);
2699
- /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1149);
2700
- /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
2701
- /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
2702
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
2692
+
2693
+ // EXPORTS
2694
+ __webpack_require__.d(__webpack_exports__, {
2695
+ Z: () => (/* binding */ initializeApp),
2696
+ m: () => (/* binding */ resetApp)
2697
+ });
2698
+
2699
+ // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
2700
+ var redux_toolkit_esm = __webpack_require__(9639);
2701
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-session-expired-error.js
2702
+ var seamly_session_expired_error = __webpack_require__(6821);
2703
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-unavailable-error.js
2704
+ var seamly_unavailable_error = __webpack_require__(7265);
2705
+ // EXTERNAL MODULE: ./src/javascripts/ui/utils/seamly-utils.ts
2706
+ var seamly_utils = __webpack_require__(1149);
2707
+ // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
2708
+ var actions = __webpack_require__(257);
2709
+ // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
2710
+ var i18n_actions = __webpack_require__(5409);
2711
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/create-debounced-async-thunk.ts
2712
+
2713
+ /**
2714
+ * A debounced analogue of the `createAsyncThunk` from `@reduxjs/toolkit`
2715
+ * @param typePrefix - a string action type value
2716
+ * @param payloadCreator - a callback function that should return a promise containing the result of some asynchronous logic
2717
+ * @param debounceOptions - the debounce options object
2718
+ */
2719
+ const createDebouncedAsyncThunk = (typePrefix, payloadCreator, debounceOptions) => {
2720
+ const {
2721
+ wait = 300,
2722
+ maxWait = 0,
2723
+ leading = false
2724
+ } = debounceOptions !== null && debounceOptions !== void 0 ? debounceOptions : {};
2725
+ let debounceTimer = null;
2726
+ let maxWaitTimer = null;
2727
+ let resolve;
2728
+ const cancel = () => {
2729
+ if (resolve) {
2730
+ resolve(false);
2731
+ resolve = undefined;
2732
+ }
2733
+ };
2734
+ const invoke = () => {
2735
+ clearTimeout(maxWaitTimer);
2736
+ maxWaitTimer = undefined;
2737
+ if (resolve) {
2738
+ resolve(true);
2739
+ resolve = undefined;
2740
+ }
2741
+ };
2742
+ const debounceExecutionCondition = () => {
2743
+ const immediate = leading && !debounceTimer;
2744
+ // Start debounced condition resolution
2745
+ clearTimeout(debounceTimer);
2746
+ debounceTimer = setTimeout(() => {
2747
+ invoke();
2748
+ debounceTimer = null;
2749
+ }, wait);
2750
+ if (immediate) {
2751
+ return true;
2752
+ }
2753
+ cancel();
2754
+ // Start max wait condition resolution
2755
+ if (maxWait && !maxWaitTimer) {
2756
+ maxWaitTimer = setTimeout(invoke, maxWait);
2757
+ }
2758
+ return new Promise(res => {
2759
+ resolve = res;
2760
+ });
2761
+ };
2762
+ return (0,redux_toolkit_esm/* createAsyncThunk */.hg)(typePrefix, payloadCreator, {
2763
+ condition: debounceExecutionCondition
2764
+ });
2765
+ };
2766
+ /* harmony default export */ const create_debounced_async_thunk = (createDebouncedAsyncThunk);
2767
+ // EXTERNAL MODULE: ./src/javascripts/domains/visibility/actions.ts
2768
+ var visibility_actions = __webpack_require__(9586);
2769
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/app/actions.ts
2703
2770
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
2704
2771
  function adopt(value) {
2705
2772
  return value instanceof P ? value : new P(function (resolve) {
@@ -2734,7 +2801,8 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
2734
2801
 
2735
2802
 
2736
2803
 
2737
- const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('initializeApp', (_, {
2804
+
2805
+ const initializeApp = (0,redux_toolkit_esm/* createAsyncThunk */.hg)('initializeApp', (_, {
2738
2806
  extra: {
2739
2807
  api,
2740
2808
  config
@@ -2755,7 +2823,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2755
2823
  } else {
2756
2824
  if ((_c = config === null || config === void 0 ? void 0 : config.context) === null || _c === void 0 ? void 0 : _c.topic) {
2757
2825
  api.send('action', {
2758
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTopic,
2826
+ type: seamly_utils/* actionTypes */.Hp.setTopic,
2759
2827
  body: {
2760
2828
  name: config.context.topic,
2761
2829
  // Separate fallback message is not needed here. Only an attached service will use this, but none will
@@ -2767,7 +2835,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2767
2835
  if ((_d = config === null || config === void 0 ? void 0 : config.context) === null || _d === void 0 ? void 0 : _d.translationLocale) {
2768
2836
  locale = config.context.translationLocale;
2769
2837
  api.send('action', {
2770
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTranslation,
2838
+ type: seamly_utils/* actionTypes */.Hp.setTranslation,
2771
2839
  body: {
2772
2840
  enabled: true,
2773
2841
  locale
@@ -2781,8 +2849,8 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2781
2849
  };
2782
2850
  }
2783
2851
  } catch (e) {
2784
- if (e instanceof api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z) {
2785
- const err = new api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z();
2852
+ if (e instanceof seamly_session_expired_error/* default */.Z) {
2853
+ const err = new seamly_session_expired_error/* default */.Z();
2786
2854
  return rejectWithValue({
2787
2855
  name: err.name,
2788
2856
  message: err.message,
@@ -2791,7 +2859,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2791
2859
  action: err.action
2792
2860
  });
2793
2861
  }
2794
- const err = new api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z();
2862
+ const err = new seamly_unavailable_error/* default */.Z();
2795
2863
  return rejectWithValue({
2796
2864
  name: err.name,
2797
2865
  message: err.message,
@@ -2799,26 +2867,29 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2799
2867
  });
2800
2868
  }
2801
2869
  }));
2802
- const resetApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('resetApp', (_, {
2870
+ const resetApp = create_debounced_async_thunk('resetApp', (_, {
2803
2871
  dispatch,
2804
2872
  extra: {
2805
2873
  api
2806
2874
  }
2807
2875
  }) => __awaiter(void 0, void 0, void 0, function* () {
2808
2876
  yield api.disconnect();
2809
- yield api.clearStore();
2810
- dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .resetConfig */ .I)());
2811
- yield dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t)());
2877
+ api.clearStore();
2878
+ dispatch((0,actions/* resetConfig */.I)());
2879
+ yield dispatch((0,actions/* initializeConfig */.t)());
2812
2880
  try {
2813
2881
  const {
2814
2882
  locale
2815
2883
  } = yield dispatch(initializeApp()).unwrap();
2816
- yield dispatch((0,domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i)(locale));
2817
- } catch (rejectedValueOrSerializedError) {
2884
+ yield dispatch((0,i18n_actions/* setLocale */.i)(locale));
2885
+ } catch (e) {
2818
2886
  // nothing to do
2819
2887
  }
2820
- dispatch((0,domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .initializeVisibility */ .Z)());
2821
- }));
2888
+ dispatch((0,visibility_actions/* initializeVisibility */.Z)());
2889
+ }), {
2890
+ wait: 2000,
2891
+ leading: true
2892
+ });
2822
2893
 
2823
2894
  /***/ }),
2824
2895
 
@@ -2846,7 +2917,7 @@ const selectUserHasResponded = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/
2846
2917
  /* harmony export */ });
2847
2918
  /* unused harmony export appSlice */
2848
2919
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
2849
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
2920
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
2850
2921
 
2851
2922
 
2852
2923
  const initialState = {
@@ -3104,13 +3175,15 @@ const configSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .createSl
3104
3175
  preChat,
3105
3176
  agentParticipant,
3106
3177
  userParticipant,
3107
- startChatIcon
3178
+ startChatIcon,
3179
+ locale
3108
3180
  }
3109
3181
  }) => {
3110
3182
  state.preChatEvents = preChat.map(payload => ({
3111
3183
  type: 'message',
3112
3184
  payload
3113
3185
  }));
3186
+ state.context.locale = locale;
3114
3187
  state.agentParticipant = agentParticipant;
3115
3188
  state.userParticipant = userParticipant;
3116
3189
  state.startChatIcon = startChatIcon;
@@ -3216,7 +3289,7 @@ function createErrorsMiddleware({
3216
3289
 
3217
3290
  /* unused harmony exports formsSlice, registerForm, deregisterForm, registerControl, deregisterControl, updateControlValue, updateControlTouched */
3218
3291
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
3219
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
3292
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
3220
3293
 
3221
3294
 
3222
3295
  const initialFormState = {
@@ -4226,11 +4299,13 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4226
4299
  /* harmony export */ uc: () => (/* binding */ setInterrupt)
4227
4300
  /* harmony export */ });
4228
4301
  /* unused harmony exports interruptSlice, clearInterrupt */
4229
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
4230
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
4302
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4303
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
4231
4304
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
4232
4305
  /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
4233
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
4306
+ /* harmony import */ var domains_store_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2770);
4307
+ /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9586);
4308
+
4234
4309
 
4235
4310
 
4236
4311
 
@@ -4239,7 +4314,7 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4239
4314
  const initialState = {
4240
4315
  error: undefined
4241
4316
  };
4242
- const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createSlice */ .oM)({
4317
+ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__/* .createSlice */ .oM)({
4243
4318
  name: 'interrupt',
4244
4319
  initialState,
4245
4320
  reducers: {
@@ -4249,7 +4324,7 @@ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .creat
4249
4324
  clearInterrupt: () => initialState
4250
4325
  },
4251
4326
  extraReducers: builder => {
4252
- builder.addCase(domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.pending, () => initialState).addMatcher((0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .isAnyOf */ .Q)(domains_app_actions__WEBPACK_IMPORTED_MODULE_0__/* .initializeApp */ .Z.rejected, domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.rejected, domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .setVisibility */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .initializeVisibility */ .Z.rejected), (state, {
4327
+ builder.addCase(domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.pending, () => initialState).addMatcher((0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__/* .isAnyOf */ .Q)(domains_app_actions__WEBPACK_IMPORTED_MODULE_0__/* .initializeApp */ .Z.rejected, domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.rejected, domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__/* .setVisibility */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__/* .initializeVisibility */ .Z.rejected, domains_store_actions__WEBPACK_IMPORTED_MODULE_3__/* .getConversation */ .c.rejected), (state, {
4253
4328
  payload
4254
4329
  }) => {
4255
4330
  state.error = payload;
@@ -4264,6 +4339,77 @@ const {
4264
4339
 
4265
4340
  /***/ }),
4266
4341
 
4342
+ /***/ 2770:
4343
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4344
+
4345
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4346
+ /* harmony export */ c: () => (/* binding */ getConversation)
4347
+ /* harmony export */ });
4348
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9639);
4349
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4350
+ function adopt(value) {
4351
+ return value instanceof P ? value : new P(function (resolve) {
4352
+ resolve(value);
4353
+ });
4354
+ }
4355
+ return new (P || (P = Promise))(function (resolve, reject) {
4356
+ function fulfilled(value) {
4357
+ try {
4358
+ step(generator.next(value));
4359
+ } catch (e) {
4360
+ reject(e);
4361
+ }
4362
+ }
4363
+ function rejected(value) {
4364
+ try {
4365
+ step(generator["throw"](value));
4366
+ } catch (e) {
4367
+ reject(e);
4368
+ }
4369
+ }
4370
+ function step(result) {
4371
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
4372
+ }
4373
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
4374
+ });
4375
+ };
4376
+
4377
+ const getConversation = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .createAsyncThunk */ .hg)('getConversation', (_, {
4378
+ extra: {
4379
+ api
4380
+ },
4381
+ rejectWithValue
4382
+ }) => __awaiter(void 0, void 0, void 0, function* () {
4383
+ try {
4384
+ return api.getConversation();
4385
+ } catch (error) {
4386
+ return rejectWithValue({
4387
+ name: error === null || error === void 0 ? void 0 : error.name,
4388
+ message: error === null || error === void 0 ? void 0 : error.message,
4389
+ langKey: error === null || error === void 0 ? void 0 : error.langKey,
4390
+ action: error === null || error === void 0 ? void 0 : error.action,
4391
+ originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
4392
+ originalError: error === null || error === void 0 ? void 0 : error.originalError
4393
+ });
4394
+ }
4395
+ }), {
4396
+ condition(payload, {
4397
+ getState
4398
+ }) {
4399
+ var _a;
4400
+ const {
4401
+ state: {
4402
+ events
4403
+ }
4404
+ } = getState();
4405
+ const lastEvent = events[events.length - 1];
4406
+ const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
4407
+ return lastEvent && payloadLastEventId !== lastEvent.payload.id;
4408
+ }
4409
+ });
4410
+
4411
+ /***/ }),
4412
+
4267
4413
  /***/ 7271:
4268
4414
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4269
4415
 
@@ -4287,8 +4433,8 @@ var errors = __webpack_require__(9792);
4287
4433
  var forms_slice = __webpack_require__(3939);
4288
4434
  // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
4289
4435
  var redux_toolkit_esm = __webpack_require__(9639);
4290
- // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts
4291
- var actions = __webpack_require__(9201);
4436
+ // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts + 1 modules
4437
+ var actions = __webpack_require__(526);
4292
4438
  // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
4293
4439
  var config_actions = __webpack_require__(257);
4294
4440
  // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
@@ -4541,7 +4687,7 @@ const useAppDispatch = es/* useDispatch */.I0;
4541
4687
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4542
4688
  /* harmony import */ var ui_utils_general_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(822);
4543
4689
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1149);
4544
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9201);
4690
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(526);
4545
4691
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(257);
4546
4692
  /* harmony import */ var lib_id__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8527);
4547
4693
 
@@ -5372,7 +5518,7 @@ const useTranslationProposal = () => {
5372
5518
  /* harmony export */ });
5373
5519
  /* unused harmony exports translationsInitialState, translationSlice, enableEventsTranslation, disableEventsTranslation, setTranslationProposalPrompt */
5374
5520
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9639);
5375
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
5521
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
5376
5522
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
5377
5523
  /* harmony import */ var domains_store_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8801);
5378
5524
 
@@ -5476,7 +5622,13 @@ const translationSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .cre
5476
5622
  const feature = (_a = payload === null || payload === void 0 ? void 0 : payload.features) === null || _a === void 0 ? void 0 : _a.translation;
5477
5623
  if (!feature) return;
5478
5624
  state.isAvailable = feature.enabled === true;
5479
- state.languages = feature.languages;
5625
+ state.languages = [...feature.languages].sort((a, b) => {
5626
+ if (a.locale === payload.locale) return -1;
5627
+ if (b.locale === payload.locale) return 1;
5628
+ return a.nativeName.localeCompare(b.nativeName, undefined, {
5629
+ sensitivity: 'base'
5630
+ });
5631
+ });
5480
5632
  }).addCase(domains_store_slice__WEBPACK_IMPORTED_MODULE_2__/* .setHistory */ .JB, (state, {
5481
5633
  payload
5482
5634
  }) => {
@@ -5583,8 +5735,9 @@ const setVisibility = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_6__/* .create
5583
5735
  if (previousVisibility === calculatedVisibility) {
5584
5736
  return undefined;
5585
5737
  }
5738
+ const visibility = api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K);
5586
5739
  // Store the user-requested visibility in order to reinitialize after refresh
5587
- api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K) || {}), {
5740
+ api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, visibility || {}), {
5588
5741
  [layoutMode]: requestedVisibility
5589
5742
  }));
5590
5743
  if (requestedVisibility) {
@@ -6019,12 +6172,21 @@ var selectors = __webpack_require__(703);
6019
6172
  var live_region_hooks = __webpack_require__(5136);
6020
6173
  // EXTERNAL MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.ts
6021
6174
  var seamly_state_hooks = __webpack_require__(2140);
6175
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-general-error.js
6176
+ var seamly_general_error = __webpack_require__(5332);
6022
6177
  // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/hooks.ts
6023
6178
  var interrupt_hooks = __webpack_require__(5889);
6179
+ // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/slice.ts
6180
+ var slice = __webpack_require__(6160);
6181
+ // EXTERNAL MODULE: ./src/javascripts/domains/store/index.ts + 4 modules
6182
+ var store = __webpack_require__(7271);
6024
6183
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-session-expired-command.ts
6025
6184
 
6026
6185
 
6027
6186
 
6187
+
6188
+
6189
+
6028
6190
  function useSessionExpiredCommand() {
6029
6191
  const {
6030
6192
  meta: {
@@ -6032,13 +6194,35 @@ function useSessionExpiredCommand() {
6032
6194
  action
6033
6195
  }
6034
6196
  } = (0,interrupt_hooks/* useInterrupt */.i)();
6197
+ const dispatch = (0,store/* useAppDispatch */.T)();
6035
6198
  const seamlyCommands = (0,use_seamly_commands/* default */.Z)();
6036
6199
  const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
6200
+ const limit = (0,hooks_.useRef)(0);
6201
+ const limitTimer = (0,hooks_.useRef)(null);
6037
6202
  (0,hooks_.useEffect)(() => {
6038
6203
  if (isExpiredError && seamlyCommands[action]) {
6204
+ if (limit.current >= 10) {
6205
+ limitTimer.current = setTimeout(() => {
6206
+ limit.current = 0;
6207
+ }, 10000);
6208
+ const error = new seamly_general_error/* default */.Z();
6209
+ dispatch((0,slice/* setInterrupt */.uc)({
6210
+ name: error.name,
6211
+ message: error.message,
6212
+ langKey: error.langKey,
6213
+ originalEvent: error.originalEvent,
6214
+ originalError: error.originalError,
6215
+ action: error.action
6216
+ }));
6217
+ return () => {};
6218
+ }
6219
+ limit.current += 1;
6039
6220
  seamlyCommands[action]();
6040
6221
  }
6041
- }, [action, seamlyCommands, isExpiredError]);
6222
+ return () => {
6223
+ if (limitTimer.current) clearTimeout(limitTimer.current);
6224
+ };
6225
+ }, [action, seamlyCommands, isExpiredError, dispatch]);
6042
6226
  }
6043
6227
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
6044
6228
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
@@ -6709,7 +6893,7 @@ const EventParticipant = ({
6709
6893
  })
6710
6894
  }));
6711
6895
  }
6712
- if (showName) {
6896
+ if (showName && participantName) {
6713
6897
  authorInfo.push(_jsx("span", {
6714
6898
  className: className('message__author-name'),
6715
6899
  children: participantName
@@ -7390,7 +7574,7 @@ const useSeamlyActivityEventHandler = () => useContext(SeamlyActivityEventContex
7390
7574
  /* harmony import */ var config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9787);
7391
7575
  /* harmony import */ var ui_components_core_seamly_api_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2871);
7392
7576
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1149);
7393
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9201);
7577
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(526);
7394
7578
  /* harmony import */ var domains_app_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3423);
7395
7579
  /* harmony import */ var domains_app_slice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1322);
7396
7580
  /* harmony import */ var domains_config_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6134);
@@ -8207,15 +8391,52 @@ var compat_module = __webpack_require__(8661);
8207
8391
  var batch = __webpack_require__(9256);
8208
8392
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/components/Context.js
8209
8393
 
8210
- const Context_ReactReduxContext = /*#__PURE__*/(0,compat_module.createContext)(null);
8394
+ const ContextKey = Symbol.for(`react-redux-context-${compat_module.version}`);
8395
+ const gT = globalThis;
8396
+
8397
+ function getContext() {
8398
+ let realContext = gT[ContextKey];
8211
8399
 
8212
- if (false) {}
8400
+ if (!realContext) {
8401
+ realContext = (0,compat_module.createContext)(null);
8402
+
8403
+ if (false) {}
8404
+
8405
+ gT[ContextKey] = realContext;
8406
+ }
8407
+
8408
+ return realContext;
8409
+ }
8213
8410
 
8411
+ const Context_ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, {
8412
+ get(_, handler) {
8413
+ const target = getContext(); // @ts-ignore
8414
+
8415
+ return (_target, ...args) => Reflect[handler](target, ...args);
8416
+ }
8417
+
8418
+ }));
8214
8419
  /* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
8215
8420
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useReduxContext.js
8216
8421
 
8217
8422
 
8218
8423
 
8424
+ /**
8425
+ * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
8426
+ * hook that you should usually not need to call directly.
8427
+ *
8428
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
8429
+ * @returns {Function} A `useReduxContext` hook bound to the specified context.
8430
+ */
8431
+ function createReduxContextHook(context = Context_ReactReduxContext) {
8432
+ return function useReduxContext() {
8433
+ const contextValue = (0,compat_module.useContext)(context);
8434
+
8435
+ if (false) {}
8436
+
8437
+ return contextValue;
8438
+ };
8439
+ }
8219
8440
  /**
8220
8441
  * A hook to access the value of the `ReactReduxContext`. This is a low-level
8221
8442
  * hook that you should usually not need to call directly.
@@ -8232,13 +8453,8 @@ if (false) {}
8232
8453
  * return <div>{store.getState()}</div>
8233
8454
  * }
8234
8455
  */
8235
- function useReduxContext_useReduxContext() {
8236
- const contextValue = (0,compat_module.useContext)(Context_ReactReduxContext);
8237
-
8238
- if (false) {}
8239
8456
 
8240
- return contextValue;
8241
- }
8457
+ const useReduxContext_useReduxContext = /*#__PURE__*/createReduxContextHook();
8242
8458
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/utils/useSyncExternalStore.js
8243
8459
  const useSyncExternalStore_notInitialized = () => {
8244
8460
  throw new Error('uSES not initialized!');
@@ -8263,16 +8479,37 @@ const refEquality = (a, b) => a === b;
8263
8479
 
8264
8480
 
8265
8481
  function createSelectorHook(context = Context_ReactReduxContext) {
8266
- const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
8267
- return function useSelector(selector, equalityFn = refEquality) {
8482
+ const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : createReduxContextHook(context);
8483
+ return function useSelector(selector, equalityFnOrOptions = {}) {
8484
+ const {
8485
+ equalityFn = refEquality,
8486
+ stabilityCheck = undefined,
8487
+ noopCheck = undefined
8488
+ } = typeof equalityFnOrOptions === 'function' ? {
8489
+ equalityFn: equalityFnOrOptions
8490
+ } : equalityFnOrOptions;
8491
+
8268
8492
  if (false) {}
8269
8493
 
8270
8494
  const {
8271
8495
  store,
8272
8496
  subscription,
8273
- getServerState
8497
+ getServerState,
8498
+ stabilityCheck: globalStabilityCheck,
8499
+ noopCheck: globalNoopCheck
8274
8500
  } = useReduxContext();
8275
- const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);
8501
+ const firstRun = (0,compat_module.useRef)(true);
8502
+ const wrappedSelector = (0,compat_module.useCallback)({
8503
+ [selector.name](state) {
8504
+ const selected = selector(state);
8505
+
8506
+ if (false) {}
8507
+
8508
+ return selected;
8509
+ }
8510
+
8511
+ }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
8512
+ const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
8276
8513
  (0,compat_module.useDebugValue)(selectedState);
8277
8514
  return selectedState;
8278
8515
  };
@@ -8859,16 +9096,20 @@ function Provider({
8859
9096
  store,
8860
9097
  context,
8861
9098
  children,
8862
- serverState
9099
+ serverState,
9100
+ stabilityCheck = 'once',
9101
+ noopCheck = 'once'
8863
9102
  }) {
8864
9103
  const contextValue = useMemo(() => {
8865
9104
  const subscription = createSubscription(store);
8866
9105
  return {
8867
9106
  store,
8868
9107
  subscription,
8869
- getServerState: serverState ? () => serverState : undefined
9108
+ getServerState: serverState ? () => serverState : undefined,
9109
+ stabilityCheck,
9110
+ noopCheck
8870
9111
  };
8871
- }, [store, serverState]);
9112
+ }, [store, serverState, stabilityCheck, noopCheck]);
8872
9113
  const previousState = useMemo(() => store.getState(), [store]);
8873
9114
  useIsomorphicLayoutEffect(() => {
8874
9115
  const {
@@ -8897,7 +9138,6 @@ function Provider({
8897
9138
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useStore.js
8898
9139
 
8899
9140
 
8900
-
8901
9141
  /**
8902
9142
  * Hook factory, which creates a `useStore` hook bound to a given context.
8903
9143
  *
@@ -8907,7 +9147,8 @@ function Provider({
8907
9147
 
8908
9148
  function createStoreHook(context = Context_ReactReduxContext) {
8909
9149
  const useReduxContext = // @ts-ignore
8910
- context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
9150
+ context === Context_ReactReduxContext ? useReduxContext_useReduxContext : // @ts-ignore
9151
+ createReduxContextHook(context);
8911
9152
  return function useStore() {
8912
9153
  const {
8913
9154
  store