@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
@@ -2691,20 +2691,87 @@ const defaultConfig = {
2691
2691
 
2692
2692
  /***/ }),
2693
2693
 
2694
- /***/ 9201:
2694
+ /***/ 526:
2695
2695
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2696
2696
 
2697
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2698
- /* harmony export */ Z: () => (/* binding */ initializeApp),
2699
- /* harmony export */ m: () => (/* binding */ resetApp)
2700
- /* harmony export */ });
2701
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
2702
- /* harmony import */ var api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6821);
2703
- /* harmony import */ var api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7265);
2704
- /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1149);
2705
- /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
2706
- /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
2707
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
2697
+
2698
+ // EXPORTS
2699
+ __webpack_require__.d(__webpack_exports__, {
2700
+ Z: () => (/* binding */ initializeApp),
2701
+ m: () => (/* binding */ resetApp)
2702
+ });
2703
+
2704
+ // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
2705
+ var redux_toolkit_esm = __webpack_require__(9639);
2706
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-session-expired-error.js
2707
+ var seamly_session_expired_error = __webpack_require__(6821);
2708
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-unavailable-error.js
2709
+ var seamly_unavailable_error = __webpack_require__(7265);
2710
+ // EXTERNAL MODULE: ./src/javascripts/ui/utils/seamly-utils.ts
2711
+ var seamly_utils = __webpack_require__(1149);
2712
+ // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
2713
+ var actions = __webpack_require__(257);
2714
+ // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
2715
+ var i18n_actions = __webpack_require__(5409);
2716
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/create-debounced-async-thunk.ts
2717
+
2718
+ /**
2719
+ * A debounced analogue of the `createAsyncThunk` from `@reduxjs/toolkit`
2720
+ * @param typePrefix - a string action type value
2721
+ * @param payloadCreator - a callback function that should return a promise containing the result of some asynchronous logic
2722
+ * @param debounceOptions - the debounce options object
2723
+ */
2724
+ const createDebouncedAsyncThunk = (typePrefix, payloadCreator, debounceOptions) => {
2725
+ const {
2726
+ wait = 300,
2727
+ maxWait = 0,
2728
+ leading = false
2729
+ } = debounceOptions !== null && debounceOptions !== void 0 ? debounceOptions : {};
2730
+ let debounceTimer = null;
2731
+ let maxWaitTimer = null;
2732
+ let resolve;
2733
+ const cancel = () => {
2734
+ if (resolve) {
2735
+ resolve(false);
2736
+ resolve = undefined;
2737
+ }
2738
+ };
2739
+ const invoke = () => {
2740
+ clearTimeout(maxWaitTimer);
2741
+ maxWaitTimer = undefined;
2742
+ if (resolve) {
2743
+ resolve(true);
2744
+ resolve = undefined;
2745
+ }
2746
+ };
2747
+ const debounceExecutionCondition = () => {
2748
+ const immediate = leading && !debounceTimer;
2749
+ // Start debounced condition resolution
2750
+ clearTimeout(debounceTimer);
2751
+ debounceTimer = setTimeout(() => {
2752
+ invoke();
2753
+ debounceTimer = null;
2754
+ }, wait);
2755
+ if (immediate) {
2756
+ return true;
2757
+ }
2758
+ cancel();
2759
+ // Start max wait condition resolution
2760
+ if (maxWait && !maxWaitTimer) {
2761
+ maxWaitTimer = setTimeout(invoke, maxWait);
2762
+ }
2763
+ return new Promise(res => {
2764
+ resolve = res;
2765
+ });
2766
+ };
2767
+ return (0,redux_toolkit_esm/* createAsyncThunk */.hg)(typePrefix, payloadCreator, {
2768
+ condition: debounceExecutionCondition
2769
+ });
2770
+ };
2771
+ /* harmony default export */ const create_debounced_async_thunk = (createDebouncedAsyncThunk);
2772
+ // EXTERNAL MODULE: ./src/javascripts/domains/visibility/actions.ts
2773
+ var visibility_actions = __webpack_require__(9586);
2774
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/app/actions.ts
2708
2775
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
2709
2776
  function adopt(value) {
2710
2777
  return value instanceof P ? value : new P(function (resolve) {
@@ -2739,7 +2806,8 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
2739
2806
 
2740
2807
 
2741
2808
 
2742
- const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('initializeApp', (_, {
2809
+
2810
+ const initializeApp = (0,redux_toolkit_esm/* createAsyncThunk */.hg)('initializeApp', (_, {
2743
2811
  extra: {
2744
2812
  api,
2745
2813
  config
@@ -2760,7 +2828,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2760
2828
  } else {
2761
2829
  if ((_c = config === null || config === void 0 ? void 0 : config.context) === null || _c === void 0 ? void 0 : _c.topic) {
2762
2830
  api.send('action', {
2763
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTopic,
2831
+ type: seamly_utils/* actionTypes */.Hp.setTopic,
2764
2832
  body: {
2765
2833
  name: config.context.topic,
2766
2834
  // Separate fallback message is not needed here. Only an attached service will use this, but none will
@@ -2772,7 +2840,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2772
2840
  if ((_d = config === null || config === void 0 ? void 0 : config.context) === null || _d === void 0 ? void 0 : _d.translationLocale) {
2773
2841
  locale = config.context.translationLocale;
2774
2842
  api.send('action', {
2775
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTranslation,
2843
+ type: seamly_utils/* actionTypes */.Hp.setTranslation,
2776
2844
  body: {
2777
2845
  enabled: true,
2778
2846
  locale
@@ -2786,8 +2854,8 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2786
2854
  };
2787
2855
  }
2788
2856
  } catch (e) {
2789
- if (e instanceof api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z) {
2790
- const err = new api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z();
2857
+ if (e instanceof seamly_session_expired_error/* default */.Z) {
2858
+ const err = new seamly_session_expired_error/* default */.Z();
2791
2859
  return rejectWithValue({
2792
2860
  name: err.name,
2793
2861
  message: err.message,
@@ -2796,7 +2864,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2796
2864
  action: err.action
2797
2865
  });
2798
2866
  }
2799
- const err = new api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z();
2867
+ const err = new seamly_unavailable_error/* default */.Z();
2800
2868
  return rejectWithValue({
2801
2869
  name: err.name,
2802
2870
  message: err.message,
@@ -2804,26 +2872,29 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2804
2872
  });
2805
2873
  }
2806
2874
  }));
2807
- const resetApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('resetApp', (_, {
2875
+ const resetApp = create_debounced_async_thunk('resetApp', (_, {
2808
2876
  dispatch,
2809
2877
  extra: {
2810
2878
  api
2811
2879
  }
2812
2880
  }) => __awaiter(void 0, void 0, void 0, function* () {
2813
2881
  yield api.disconnect();
2814
- yield api.clearStore();
2815
- dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .resetConfig */ .I)());
2816
- yield dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t)());
2882
+ api.clearStore();
2883
+ dispatch((0,actions/* resetConfig */.I)());
2884
+ yield dispatch((0,actions/* initializeConfig */.t)());
2817
2885
  try {
2818
2886
  const {
2819
2887
  locale
2820
2888
  } = yield dispatch(initializeApp()).unwrap();
2821
- yield dispatch((0,domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i)(locale));
2822
- } catch (rejectedValueOrSerializedError) {
2889
+ yield dispatch((0,i18n_actions/* setLocale */.i)(locale));
2890
+ } catch (e) {
2823
2891
  // nothing to do
2824
2892
  }
2825
- dispatch((0,domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .initializeVisibility */ .Z)());
2826
- }));
2893
+ dispatch((0,visibility_actions/* initializeVisibility */.Z)());
2894
+ }), {
2895
+ wait: 2000,
2896
+ leading: true
2897
+ });
2827
2898
 
2828
2899
  /***/ }),
2829
2900
 
@@ -2851,7 +2922,7 @@ const selectUserHasResponded = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/
2851
2922
  /* harmony export */ });
2852
2923
  /* unused harmony export appSlice */
2853
2924
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
2854
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
2925
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
2855
2926
 
2856
2927
 
2857
2928
  const initialState = {
@@ -3110,13 +3181,15 @@ const configSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .createSl
3110
3181
  preChat,
3111
3182
  agentParticipant,
3112
3183
  userParticipant,
3113
- startChatIcon
3184
+ startChatIcon,
3185
+ locale
3114
3186
  }
3115
3187
  }) => {
3116
3188
  state.preChatEvents = preChat.map(payload => ({
3117
3189
  type: 'message',
3118
3190
  payload
3119
3191
  }));
3192
+ state.context.locale = locale;
3120
3193
  state.agentParticipant = agentParticipant;
3121
3194
  state.userParticipant = userParticipant;
3122
3195
  state.startChatIcon = startChatIcon;
@@ -3230,7 +3303,7 @@ function createErrorsMiddleware({
3230
3303
  /* harmony export */ });
3231
3304
  /* unused harmony export formsSlice */
3232
3305
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
3233
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
3306
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
3234
3307
 
3235
3308
 
3236
3309
  const initialFormState = {
@@ -4240,11 +4313,13 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4240
4313
  /* harmony export */ uc: () => (/* binding */ setInterrupt)
4241
4314
  /* harmony export */ });
4242
4315
  /* unused harmony exports interruptSlice, clearInterrupt */
4243
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
4244
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
4316
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4317
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
4245
4318
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
4246
4319
  /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
4247
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
4320
+ /* harmony import */ var domains_store_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2770);
4321
+ /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9586);
4322
+
4248
4323
 
4249
4324
 
4250
4325
 
@@ -4253,7 +4328,7 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4253
4328
  const initialState = {
4254
4329
  error: undefined
4255
4330
  };
4256
- const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createSlice */ .oM)({
4331
+ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__/* .createSlice */ .oM)({
4257
4332
  name: 'interrupt',
4258
4333
  initialState,
4259
4334
  reducers: {
@@ -4263,7 +4338,7 @@ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .creat
4263
4338
  clearInterrupt: () => initialState
4264
4339
  },
4265
4340
  extraReducers: builder => {
4266
- 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, {
4341
+ 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, {
4267
4342
  payload
4268
4343
  }) => {
4269
4344
  state.error = payload;
@@ -4278,6 +4353,77 @@ const {
4278
4353
 
4279
4354
  /***/ }),
4280
4355
 
4356
+ /***/ 2770:
4357
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4358
+
4359
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4360
+ /* harmony export */ c: () => (/* binding */ getConversation)
4361
+ /* harmony export */ });
4362
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9639);
4363
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4364
+ function adopt(value) {
4365
+ return value instanceof P ? value : new P(function (resolve) {
4366
+ resolve(value);
4367
+ });
4368
+ }
4369
+ return new (P || (P = Promise))(function (resolve, reject) {
4370
+ function fulfilled(value) {
4371
+ try {
4372
+ step(generator.next(value));
4373
+ } catch (e) {
4374
+ reject(e);
4375
+ }
4376
+ }
4377
+ function rejected(value) {
4378
+ try {
4379
+ step(generator["throw"](value));
4380
+ } catch (e) {
4381
+ reject(e);
4382
+ }
4383
+ }
4384
+ function step(result) {
4385
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
4386
+ }
4387
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
4388
+ });
4389
+ };
4390
+
4391
+ const getConversation = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .createAsyncThunk */ .hg)('getConversation', (_, {
4392
+ extra: {
4393
+ api
4394
+ },
4395
+ rejectWithValue
4396
+ }) => __awaiter(void 0, void 0, void 0, function* () {
4397
+ try {
4398
+ return api.getConversation();
4399
+ } catch (error) {
4400
+ return rejectWithValue({
4401
+ name: error === null || error === void 0 ? void 0 : error.name,
4402
+ message: error === null || error === void 0 ? void 0 : error.message,
4403
+ langKey: error === null || error === void 0 ? void 0 : error.langKey,
4404
+ action: error === null || error === void 0 ? void 0 : error.action,
4405
+ originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
4406
+ originalError: error === null || error === void 0 ? void 0 : error.originalError
4407
+ });
4408
+ }
4409
+ }), {
4410
+ condition(payload, {
4411
+ getState
4412
+ }) {
4413
+ var _a;
4414
+ const {
4415
+ state: {
4416
+ events
4417
+ }
4418
+ } = getState();
4419
+ const lastEvent = events[events.length - 1];
4420
+ const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
4421
+ return lastEvent && payloadLastEventId !== lastEvent.payload.id;
4422
+ }
4423
+ });
4424
+
4425
+ /***/ }),
4426
+
4281
4427
  /***/ 7271:
4282
4428
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4283
4429
 
@@ -4301,8 +4447,8 @@ var errors = __webpack_require__(9792);
4301
4447
  var forms_slice = __webpack_require__(3939);
4302
4448
  // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
4303
4449
  var redux_toolkit_esm = __webpack_require__(9639);
4304
- // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts
4305
- var actions = __webpack_require__(9201);
4450
+ // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts + 1 modules
4451
+ var actions = __webpack_require__(526);
4306
4452
  // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
4307
4453
  var config_actions = __webpack_require__(257);
4308
4454
  // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
@@ -4565,7 +4711,7 @@ const useAppDispatch = es/* useDispatch */.I0;
4565
4711
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4566
4712
  /* harmony import */ var ui_utils_general_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(822);
4567
4713
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1149);
4568
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9201);
4714
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(526);
4569
4715
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(257);
4570
4716
  /* harmony import */ var lib_id__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8527);
4571
4717
 
@@ -5398,7 +5544,7 @@ const useTranslationProposal = () => {
5398
5544
  /* harmony export */ });
5399
5545
  /* unused harmony exports translationsInitialState, translationSlice, setTranslationProposalPrompt */
5400
5546
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9639);
5401
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
5547
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
5402
5548
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
5403
5549
  /* harmony import */ var domains_store_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8801);
5404
5550
 
@@ -5502,7 +5648,13 @@ const translationSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .cre
5502
5648
  const feature = (_a = payload === null || payload === void 0 ? void 0 : payload.features) === null || _a === void 0 ? void 0 : _a.translation;
5503
5649
  if (!feature) return;
5504
5650
  state.isAvailable = feature.enabled === true;
5505
- state.languages = feature.languages;
5651
+ state.languages = [...feature.languages].sort((a, b) => {
5652
+ if (a.locale === payload.locale) return -1;
5653
+ if (b.locale === payload.locale) return 1;
5654
+ return a.nativeName.localeCompare(b.nativeName, undefined, {
5655
+ sensitivity: 'base'
5656
+ });
5657
+ });
5506
5658
  }).addCase(domains_store_slice__WEBPACK_IMPORTED_MODULE_2__/* .setHistory */ .JB, (state, {
5507
5659
  payload
5508
5660
  }) => {
@@ -5609,8 +5761,9 @@ const setVisibility = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_6__/* .create
5609
5761
  if (previousVisibility === calculatedVisibility) {
5610
5762
  return undefined;
5611
5763
  }
5764
+ const visibility = api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K);
5612
5765
  // Store the user-requested visibility in order to reinitialize after refresh
5613
- api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K) || {}), {
5766
+ api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, visibility || {}), {
5614
5767
  [layoutMode]: requestedVisibility
5615
5768
  }));
5616
5769
  if (requestedVisibility) {
@@ -6057,10 +6210,17 @@ var live_region_hooks = __webpack_require__(5136);
6057
6210
  var seamly_state_hooks = __webpack_require__(2140);
6058
6211
  // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/hooks.ts
6059
6212
  var interrupt_hooks = __webpack_require__(5889);
6213
+ // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/slice.ts
6214
+ var slice = __webpack_require__(6160);
6215
+ // EXTERNAL MODULE: ./src/javascripts/domains/store/index.ts + 4 modules
6216
+ var store = __webpack_require__(7271);
6060
6217
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-session-expired-command.ts
6061
6218
 
6062
6219
 
6063
6220
 
6221
+
6222
+
6223
+
6064
6224
  function use_session_expired_command_useSessionExpiredCommand() {
6065
6225
  const {
6066
6226
  meta: {
@@ -6068,13 +6228,35 @@ function use_session_expired_command_useSessionExpiredCommand() {
6068
6228
  action
6069
6229
  }
6070
6230
  } = useInterrupt();
6231
+ const dispatch = useAppDispatch();
6071
6232
  const seamlyCommands = useSeamlyCommands();
6072
6233
  const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
6234
+ const limit = useRef(0);
6235
+ const limitTimer = useRef(null);
6073
6236
  useEffect(() => {
6074
6237
  if (isExpiredError && seamlyCommands[action]) {
6238
+ if (limit.current >= 10) {
6239
+ limitTimer.current = setTimeout(() => {
6240
+ limit.current = 0;
6241
+ }, 10000);
6242
+ const error = new SeamlyGeneralError();
6243
+ dispatch(setInterrupt({
6244
+ name: error.name,
6245
+ message: error.message,
6246
+ langKey: error.langKey,
6247
+ originalEvent: error.originalEvent,
6248
+ originalError: error.originalError,
6249
+ action: error.action
6250
+ }));
6251
+ return () => {};
6252
+ }
6253
+ limit.current += 1;
6075
6254
  seamlyCommands[action]();
6076
6255
  }
6077
- }, [action, seamlyCommands, isExpiredError]);
6256
+ return () => {
6257
+ if (limitTimer.current) clearTimeout(limitTimer.current);
6258
+ };
6259
+ }, [action, seamlyCommands, isExpiredError, dispatch]);
6078
6260
  }
6079
6261
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
6080
6262
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
@@ -6780,7 +6962,7 @@ const EventParticipant = ({
6780
6962
  })
6781
6963
  }));
6782
6964
  }
6783
- if (showName) {
6965
+ if (showName && participantName) {
6784
6966
  authorInfo.push((0,preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
6785
6967
  className: (0,lib_css__WEBPACK_IMPORTED_MODULE_3__/* .className */ .o)('message__author-name'),
6786
6968
  children: participantName
@@ -7496,7 +7678,7 @@ const useSeamlyActivityEventHandler = () => (0,preact_hooks__WEBPACK_IMPORTED_MO
7496
7678
  /* harmony import */ var config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9787);
7497
7679
  /* harmony import */ var ui_components_core_seamly_api_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2871);
7498
7680
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1149);
7499
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9201);
7681
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(526);
7500
7682
  /* harmony import */ var domains_app_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3423);
7501
7683
  /* harmony import */ var domains_app_slice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1322);
7502
7684
  /* harmony import */ var domains_config_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6134);
@@ -8324,15 +8506,52 @@ var compat_module = __webpack_require__(8661);
8324
8506
  var batch = __webpack_require__(9256);
8325
8507
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/components/Context.js
8326
8508
 
8327
- const Context_ReactReduxContext = /*#__PURE__*/(0,compat_module.createContext)(null);
8509
+ const ContextKey = Symbol.for(`react-redux-context-${compat_module.version}`);
8510
+ const gT = globalThis;
8328
8511
 
8329
- if (false) {}
8512
+ function getContext() {
8513
+ let realContext = gT[ContextKey];
8514
+
8515
+ if (!realContext) {
8516
+ realContext = (0,compat_module.createContext)(null);
8517
+
8518
+ if (false) {}
8519
+
8520
+ gT[ContextKey] = realContext;
8521
+ }
8330
8522
 
8523
+ return realContext;
8524
+ }
8525
+
8526
+ const Context_ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, {
8527
+ get(_, handler) {
8528
+ const target = getContext(); // @ts-ignore
8529
+
8530
+ return (_target, ...args) => Reflect[handler](target, ...args);
8531
+ }
8532
+
8533
+ }));
8331
8534
  /* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
8332
8535
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useReduxContext.js
8333
8536
 
8334
8537
 
8335
8538
 
8539
+ /**
8540
+ * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
8541
+ * hook that you should usually not need to call directly.
8542
+ *
8543
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
8544
+ * @returns {Function} A `useReduxContext` hook bound to the specified context.
8545
+ */
8546
+ function createReduxContextHook(context = Context_ReactReduxContext) {
8547
+ return function useReduxContext() {
8548
+ const contextValue = (0,compat_module.useContext)(context);
8549
+
8550
+ if (false) {}
8551
+
8552
+ return contextValue;
8553
+ };
8554
+ }
8336
8555
  /**
8337
8556
  * A hook to access the value of the `ReactReduxContext`. This is a low-level
8338
8557
  * hook that you should usually not need to call directly.
@@ -8349,13 +8568,8 @@ if (false) {}
8349
8568
  * return <div>{store.getState()}</div>
8350
8569
  * }
8351
8570
  */
8352
- function useReduxContext_useReduxContext() {
8353
- const contextValue = (0,compat_module.useContext)(Context_ReactReduxContext);
8354
8571
 
8355
- if (false) {}
8356
-
8357
- return contextValue;
8358
- }
8572
+ const useReduxContext_useReduxContext = /*#__PURE__*/createReduxContextHook();
8359
8573
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/utils/useSyncExternalStore.js
8360
8574
  const useSyncExternalStore_notInitialized = () => {
8361
8575
  throw new Error('uSES not initialized!');
@@ -8380,16 +8594,37 @@ const refEquality = (a, b) => a === b;
8380
8594
 
8381
8595
 
8382
8596
  function createSelectorHook(context = Context_ReactReduxContext) {
8383
- const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
8384
- return function useSelector(selector, equalityFn = refEquality) {
8597
+ const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : createReduxContextHook(context);
8598
+ return function useSelector(selector, equalityFnOrOptions = {}) {
8599
+ const {
8600
+ equalityFn = refEquality,
8601
+ stabilityCheck = undefined,
8602
+ noopCheck = undefined
8603
+ } = typeof equalityFnOrOptions === 'function' ? {
8604
+ equalityFn: equalityFnOrOptions
8605
+ } : equalityFnOrOptions;
8606
+
8385
8607
  if (false) {}
8386
8608
 
8387
8609
  const {
8388
8610
  store,
8389
8611
  subscription,
8390
- getServerState
8612
+ getServerState,
8613
+ stabilityCheck: globalStabilityCheck,
8614
+ noopCheck: globalNoopCheck
8391
8615
  } = useReduxContext();
8392
- const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);
8616
+ const firstRun = (0,compat_module.useRef)(true);
8617
+ const wrappedSelector = (0,compat_module.useCallback)({
8618
+ [selector.name](state) {
8619
+ const selected = selector(state);
8620
+
8621
+ if (false) {}
8622
+
8623
+ return selected;
8624
+ }
8625
+
8626
+ }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
8627
+ const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
8393
8628
  (0,compat_module.useDebugValue)(selectedState);
8394
8629
  return selectedState;
8395
8630
  };
@@ -8976,16 +9211,20 @@ function Provider({
8976
9211
  store,
8977
9212
  context,
8978
9213
  children,
8979
- serverState
9214
+ serverState,
9215
+ stabilityCheck = 'once',
9216
+ noopCheck = 'once'
8980
9217
  }) {
8981
9218
  const contextValue = useMemo(() => {
8982
9219
  const subscription = createSubscription(store);
8983
9220
  return {
8984
9221
  store,
8985
9222
  subscription,
8986
- getServerState: serverState ? () => serverState : undefined
9223
+ getServerState: serverState ? () => serverState : undefined,
9224
+ stabilityCheck,
9225
+ noopCheck
8987
9226
  };
8988
- }, [store, serverState]);
9227
+ }, [store, serverState, stabilityCheck, noopCheck]);
8989
9228
  const previousState = useMemo(() => store.getState(), [store]);
8990
9229
  useIsomorphicLayoutEffect(() => {
8991
9230
  const {
@@ -9014,7 +9253,6 @@ function Provider({
9014
9253
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useStore.js
9015
9254
 
9016
9255
 
9017
-
9018
9256
  /**
9019
9257
  * Hook factory, which creates a `useStore` hook bound to a given context.
9020
9258
  *
@@ -9024,7 +9262,8 @@ function Provider({
9024
9262
 
9025
9263
  function createStoreHook(context = Context_ReactReduxContext) {
9026
9264
  const useReduxContext = // @ts-ignore
9027
- context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
9265
+ context === Context_ReactReduxContext ? useReduxContext_useReduxContext : // @ts-ignore
9266
+ createReduxContextHook(context);
9028
9267
  return function useStore() {
9029
9268
  const {
9030
9269
  store
@@ -9818,9 +10057,9 @@ var reselect_es = __webpack_require__(573);
9818
10057
  const getState = ({
9819
10058
  forms
9820
10059
  }) => forms;
9821
- const getFormById = (0,reselect_es/* createSelector */.P1)(getState, (_, {
10060
+ const getFormById = (0,reselect_es/* createSelector */.P1)([getState, (_, {
9822
10061
  formId
9823
- }) => formId, (forms, formId) => forms[formId]);
10062
+ }) => formId], (forms, formId) => forms[formId]);
9824
10063
  const getFormControlsByFormId = (0,reselect_es/* createSelector */.P1)(getFormById, form => (form === null || form === void 0 ? void 0 : form.controls) || {});
9825
10064
  const getFormValuesByFormId = (0,reselect_es/* createSelector */.P1)(getFormControlsByFormId, controls => {
9826
10065
  const valuesObj = {};
@@ -9831,15 +10070,15 @@ const getFormValuesByFormId = (0,reselect_es/* createSelector */.P1)(getFormCont
9831
10070
  });
9832
10071
  return valuesObj;
9833
10072
  });
9834
- const getControlValueByName = (0,reselect_es/* createSelector */.P1)(getFormControlsByFormId, (_, {
10073
+ const getControlValueByName = (0,reselect_es/* createSelector */.P1)([getFormControlsByFormId, (_, {
9835
10074
  name
9836
- }) => name, (controls, name) => {
10075
+ }) => name], (controls, name) => {
9837
10076
  var _a;
9838
10077
  return (_a = controls[name]) === null || _a === void 0 ? void 0 : _a.value;
9839
10078
  });
9840
- const getControlTouchedByName = (0,reselect_es/* createSelector */.P1)(getFormControlsByFormId, (_, {
10079
+ const getControlTouchedByName = (0,reselect_es/* createSelector */.P1)([getFormControlsByFormId, (_, {
9841
10080
  name
9842
- }) => name, (controls, name) => {
10081
+ }) => name], (controls, name) => {
9843
10082
  var _a;
9844
10083
  return (_a = controls[name]) === null || _a === void 0 ? void 0 : _a.touched;
9845
10084
  });
@@ -10040,7 +10279,7 @@ const useEntryTextTranslation = controlName => {
10040
10279
  text: (text === null || text === void 0 ? void 0 : text.label) || t('input.inputLabelText'),
10041
10280
  limit: !(text === null || text === void 0 ? void 0 : text.label) && hasCharacterLimit ? characterLimit : null
10042
10281
  }), [t, hasCharacterLimit, characterLimit, text === null || text === void 0 ? void 0 : text.label]);
10043
- const labelClass = (0,hooks_.useMemo)(() => (text === null || text === void 0 ? void 0 : text.label) ? 'input__label' : 'visually-hidden', [text === null || text === void 0 ? void 0 : text.label]);
10282
+ const labelClass = (0,hooks_.useMemo)(() => (text === null || text === void 0 ? void 0 : text.label) ? 'label' : 'visually-hidden', [text === null || text === void 0 ? void 0 : text.label]);
10044
10283
  return {
10045
10284
  placeholder,
10046
10285
  label,
@@ -10085,14 +10324,14 @@ function AbortTransactionButton() {
10085
10324
  });
10086
10325
  clearEntryAbortTransaction();
10087
10326
  };
10088
- return ((0,jsx_runtime_.jsx)("li", Object.assign({ className: (0,css/* className */.o)([
10327
+ return ((0,jsx_runtime_.jsx)("li", { className: (0,css/* className */.o)([
10089
10328
  'cvco-conversation__item',
10090
10329
  'cvco-conversation__item--abort-transaction',
10091
- ]) }, { children: (0,jsx_runtime_.jsx)("button", Object.assign({ className: (0,css/* className */.o)([
10330
+ ]), children: (0,jsx_runtime_.jsx)("button", { className: (0,css/* className */.o)([
10092
10331
  'button',
10093
10332
  'button--secondary',
10094
10333
  'abort-transaction__button',
10095
- ]), type: "button", onClick: handleAbortTransaction }, { children: abortTransaction.label })) })));
10334
+ ]), type: "button", onClick: handleAbortTransaction, children: abortTransaction.label }) }));
10096
10335
  }
10097
10336
 
10098
10337
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
@@ -10103,108 +10342,61 @@ const ComponentContext = (0,external_preact_.createContext)({});
10103
10342
  var message_container = __webpack_require__(2480);
10104
10343
  // EXTERNAL MODULE: ./src/javascripts/domains/translations/hooks.ts + 1 modules
10105
10344
  var translations_hooks = __webpack_require__(4398);
10106
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
10107
-
10345
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.tsx
10108
10346
 
10109
10347
 
10110
10348
 
10111
10349
 
10112
10350
 
10113
- const CardComponent = ({
10114
- id,
10115
- action,
10116
- buttonText,
10117
- description,
10118
- hasFocus,
10119
- image,
10120
- title,
10121
- isCarouselItem
10122
- }) => {
10123
- const cardRef = (0,hooks_.useRef)(null);
10124
- const {
10125
- sendMessage,
10126
- sendAction,
10127
- emitEvent
10128
- } = (0,seamly_hooks/* useSeamlyCommands */.bs)();
10129
- const descriptionId = (0,seamly_hooks/* useGeneratedId */.I8)();
10130
- const isMounted = (0,hooks_.useRef)();
10131
- const CardActionComponent = action.type === seamly_utils/* cardTypes */.wh.navigate ? 'a' : 'button';
10132
- const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${seamly_utils/* actionTypes */.Hp.clickCard}`, {
10133
- type: seamly_utils/* actionTypes */.Hp.clickCta,
10134
- originMessage: id,
10135
- action
10136
- }), [emitEvent, id, action]);
10137
- const handleClick = (0,hooks_.useCallback)(() => {
10138
- emitCardEvent();
10139
- if (action.type === seamly_utils/* cardTypes */.wh.ask) {
10140
- sendMessage({
10141
- body: action.ask
10142
- });
10143
- } else if (action.type === seamly_utils/* cardTypes */.wh.topic) {
10144
- const {
10145
- topic: name,
10146
- fallbackMessage
10147
- } = action;
10148
- sendAction({
10149
- type: seamly_utils/* actionTypes */.Hp.setTopic,
10150
- body: {
10151
- name,
10152
- fallbackMessage
10351
+ const CardComponent = ({ id, action, buttonText, description, hasFocus, image, title, isCarouselItem, }) => {
10352
+ const cardRef = (0,hooks_.useRef)(null);
10353
+ const { sendMessage, sendAction, emitEvent } = (0,seamly_hooks/* useSeamlyCommands */.bs)();
10354
+ const descriptionId = (0,seamly_hooks/* useGeneratedId */.I8)();
10355
+ const isMounted = (0,hooks_.useRef)(false);
10356
+ const CardActionComponent = action.type === seamly_utils/* cardTypes */.wh.navigate ? 'a' : 'button';
10357
+ const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${seamly_utils/* actionTypes */.Hp.clickCard}`, {
10358
+ type: seamly_utils/* actionTypes */.Hp.clickCta,
10359
+ originMessage: id,
10360
+ action,
10361
+ }), [emitEvent, id, action]);
10362
+ const handleClick = (0,hooks_.useCallback)(() => {
10363
+ emitCardEvent();
10364
+ if (action.type === seamly_utils/* cardTypes */.wh.ask) {
10365
+ sendMessage({ body: action.ask });
10153
10366
  }
10154
- });
10155
- }
10156
- }, [sendMessage, action, sendAction, emitCardEvent]);
10157
- const actionProps = (0,hooks_.useMemo)(() => action.type === seamly_utils/* cardTypes */.wh.navigate ? {
10158
- href: action.link,
10159
- rel: 'noopener noreferrer',
10160
- target: action.newTab ? '_blank' : '_self',
10161
- onClick: emitCardEvent
10162
- } : {
10163
- onClick: handleClick
10164
- }, [action, handleClick, emitCardEvent]);
10165
- (0,hooks_.useEffect)(() => {
10166
- if (isCarouselItem) {
10167
- if (hasFocus && isMounted.current) {
10168
- window.requestAnimationFrame(() => cardRef.current.focus());
10169
- } else {
10170
- cardRef.current.blur();
10171
- }
10172
- }
10173
- isMounted.current = true;
10174
- }, [hasFocus, isCarouselItem]);
10175
- return (0,jsx_runtime_.jsxs)("div", {
10176
- className: (0,css/* className */.o)('card__wrapper'),
10177
- id: id,
10178
- tabIndex: "-1" // set tabIndex of -1 so card can be focussed
10179
- ,
10180
- ref: cardRef,
10181
- children: [(0,jsx_runtime_.jsx)("img", {
10182
- className: (0,css/* className */.o)('card__image'),
10183
- src: image,
10184
- alt: ""
10185
- }), (0,jsx_runtime_.jsxs)("div", {
10186
- className: (0,css/* className */.o)('card__content'),
10187
- id: id,
10188
- children: [title && (0,jsx_runtime_.jsx)("h2", {
10189
- className: (0,css/* className */.o)('card__title'),
10190
- children: title
10191
- }), description && (0,jsx_runtime_.jsx)("div", {
10192
- className: (0,css/* className */.o)('card__description'),
10193
- dangerouslySetInnerHTML: {
10194
- __html: description
10367
+ else if (action.type === seamly_utils/* cardTypes */.wh.topic) {
10368
+ const { topic: name, fallbackMessage } = action;
10369
+ sendAction({
10370
+ type: seamly_utils/* actionTypes */.Hp.setTopic,
10371
+ body: { name, fallbackMessage },
10372
+ });
10195
10373
  }
10196
- }), (0,jsx_runtime_.jsx)(CardActionComponent, {
10197
- tabIndex: isCarouselItem && !hasFocus ? '-1' : undefined // disable to prevent tabbing through cards
10198
- ,
10199
- className: (0,css/* className */.o)('button', 'button--primary'),
10200
- "aria-describedby": descriptionId,
10201
- ...actionProps,
10202
- children: buttonText
10203
- })]
10204
- })]
10205
- });
10374
+ }, [sendMessage, action, sendAction, emitCardEvent]);
10375
+ const actionProps = (0,hooks_.useMemo)(() => action.type === seamly_utils/* cardTypes */.wh.navigate
10376
+ ? {
10377
+ href: action.link,
10378
+ rel: 'noopener noreferrer',
10379
+ target: action.newTab ? '_blank' : '_self',
10380
+ onClick: emitCardEvent,
10381
+ }
10382
+ : {
10383
+ onClick: handleClick,
10384
+ }, [action, handleClick, emitCardEvent]);
10385
+ (0,hooks_.useEffect)(() => {
10386
+ if (isCarouselItem) {
10387
+ if (hasFocus && isMounted.current) {
10388
+ window.requestAnimationFrame(() => cardRef.current.focus());
10389
+ }
10390
+ else {
10391
+ cardRef.current.blur();
10392
+ }
10393
+ }
10394
+ isMounted.current = true;
10395
+ }, [hasFocus, isCarouselItem]);
10396
+ return ((0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('card__wrapper'), id: id, tabIndex: -1, ref: cardRef, children: [image ? ((0,jsx_runtime_.jsx)("img", { className: (0,css/* className */.o)('card__image'), src: image, alt: "" })) : null, (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('card__content'), id: id, children: [title && (0,jsx_runtime_.jsx)("h2", { className: (0,css/* className */.o)('card__title'), children: title }), description && ((0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('card__description'), dangerouslySetInnerHTML: { __html: description } })), (0,jsx_runtime_.jsx)(CardActionComponent, Object.assign({ tabIndex: isCarouselItem && !hasFocus ? -1 : undefined, className: (0,css/* className */.o)('button', 'button--primary'), "aria-describedby": descriptionId }, actionProps, { children: buttonText }))] })] }));
10206
10397
  };
10207
10398
  /* harmony default export */ const card_component = (CardComponent);
10399
+
10208
10400
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-message.js
10209
10401
 
10210
10402
 
@@ -10973,7 +11165,7 @@ const TimeIndicator = ({
10973
11165
  /* harmony default export */ const time_indicator = (TimeIndicator);
10974
11166
  ;// CONCATENATED MODULE: ./node_modules/tabbable/dist/index.esm.js
10975
11167
  /*!
10976
- * tabbable 6.1.2
11168
+ * tabbable 6.2.0
10977
11169
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
10978
11170
  */
10979
11171
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -11153,7 +11345,27 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
11153
11345
  }
11154
11346
  return candidates;
11155
11347
  };
11156
- var getTabindex = function getTabindex(node, isScope) {
11348
+
11349
+ /**
11350
+ * @private
11351
+ * Determines if the node has an explicitly specified `tabindex` attribute.
11352
+ * @param {HTMLElement} node
11353
+ * @returns {boolean} True if so; false if not.
11354
+ */
11355
+ var hasTabIndex = function hasTabIndex(node) {
11356
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
11357
+ };
11358
+
11359
+ /**
11360
+ * Determine the tab index of a given node.
11361
+ * @param {HTMLElement} node
11362
+ * @returns {number} Tab order (negative, 0, or positive number).
11363
+ * @throws {Error} If `node` is falsy.
11364
+ */
11365
+ var getTabIndex = function getTabIndex(node) {
11366
+ if (!node) {
11367
+ throw new Error('No node provided');
11368
+ }
11157
11369
  if (node.tabIndex < 0) {
11158
11370
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
11159
11371
  // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
@@ -11162,16 +11374,28 @@ var getTabindex = function getTabindex(node, isScope) {
11162
11374
  // order, consider their tab index to be 0.
11163
11375
  // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
11164
11376
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
11165
- //
11166
- // isScope is positive for custom element with shadow root or slot that by default
11167
- // have tabIndex -1, but need to be sorted by document order in order for their
11168
- // content to be inserted in the correct position
11169
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
11377
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
11170
11378
  return 0;
11171
11379
  }
11172
11380
  }
11173
11381
  return node.tabIndex;
11174
11382
  };
11383
+
11384
+ /**
11385
+ * Determine the tab index of a given node __for sort order purposes__.
11386
+ * @param {HTMLElement} node
11387
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
11388
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
11389
+ * inserted into the correct sort position.
11390
+ * @returns {number} Tab order (negative, 0, or positive number).
11391
+ */
11392
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
11393
+ var tabIndex = getTabIndex(node);
11394
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
11395
+ return 0;
11396
+ }
11397
+ return tabIndex;
11398
+ };
11175
11399
  var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
11176
11400
  return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
11177
11401
  };
@@ -11414,7 +11638,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
11414
11638
  return true;
11415
11639
  };
11416
11640
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
11417
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
11641
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
11418
11642
  return false;
11419
11643
  }
11420
11644
  return true;
@@ -11439,7 +11663,7 @@ var sortByOrder = function sortByOrder(candidates) {
11439
11663
  candidates.forEach(function (item, i) {
11440
11664
  var isScope = !!item.scopeParent;
11441
11665
  var element = isScope ? item.scopeParent : item;
11442
- var candidateTabindex = getTabindex(element, isScope);
11666
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
11443
11667
  var elements = isScope ? sortByOrder(item.candidates) : element;
11444
11668
  if (candidateTabindex === 0) {
11445
11669
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
@@ -11458,32 +11682,32 @@ var sortByOrder = function sortByOrder(candidates) {
11458
11682
  return acc;
11459
11683
  }, []).concat(regularTabbables);
11460
11684
  };
11461
- var tabbable = function tabbable(el, options) {
11685
+ var tabbable = function tabbable(container, options) {
11462
11686
  options = options || {};
11463
11687
  var candidates;
11464
11688
  if (options.getShadowRoot) {
11465
- candidates = getCandidatesIteratively([el], options.includeContainer, {
11689
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
11466
11690
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
11467
11691
  flatten: false,
11468
11692
  getShadowRoot: options.getShadowRoot,
11469
11693
  shadowRootFilter: isValidShadowRootTabbable
11470
11694
  });
11471
11695
  } else {
11472
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
11696
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
11473
11697
  }
11474
11698
  return sortByOrder(candidates);
11475
11699
  };
11476
- var focusable = function focusable(el, options) {
11700
+ var focusable = function focusable(container, options) {
11477
11701
  options = options || {};
11478
11702
  var candidates;
11479
11703
  if (options.getShadowRoot) {
11480
- candidates = getCandidatesIteratively([el], options.includeContainer, {
11704
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
11481
11705
  filter: isNodeMatchingSelectorFocusable.bind(null, options),
11482
11706
  flatten: true,
11483
11707
  getShadowRoot: options.getShadowRoot
11484
11708
  });
11485
11709
  } else {
11486
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
11710
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
11487
11711
  }
11488
11712
  return candidates;
11489
11713
  };
@@ -11514,7 +11738,7 @@ var isFocusable = function isFocusable(node, options) {
11514
11738
 
11515
11739
  ;// CONCATENATED MODULE: ./node_modules/focus-trap/dist/focus-trap.esm.js
11516
11740
  /*!
11517
- * focus-trap 7.4.3
11741
+ * focus-trap 7.5.2
11518
11742
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
11519
11743
  */
11520
11744
 
@@ -11600,10 +11824,10 @@ var isSelectableInput = function isSelectableInput(node) {
11600
11824
  return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
11601
11825
  };
11602
11826
  var isEscapeEvent = function isEscapeEvent(e) {
11603
- return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
11827
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
11604
11828
  };
11605
11829
  var isTabEvent = function isTabEvent(e) {
11606
- return e.key === 'Tab' || e.keyCode === 9;
11830
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
11607
11831
  };
11608
11832
 
11609
11833
  // checks for TAB by default
@@ -11687,8 +11911,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11687
11911
  // container: HTMLElement,
11688
11912
  // tabbableNodes: Array<HTMLElement>, // empty if none
11689
11913
  // focusableNodes: Array<HTMLElement>, // empty if none
11690
- // firstTabbableNode: HTMLElement|null,
11691
- // lastTabbableNode: HTMLElement|null,
11914
+ // posTabIndexesFound: boolean,
11915
+ // firstTabbableNode: HTMLElement|undefined,
11916
+ // lastTabbableNode: HTMLElement|undefined,
11917
+ // firstDomTabbableNode: HTMLElement|undefined,
11918
+ // lastDomTabbableNode: HTMLElement|undefined,
11692
11919
  // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
11693
11920
  // }>}
11694
11921
  containerGroups: [],
@@ -11705,7 +11932,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11705
11932
  paused: false,
11706
11933
  // timer ID for when delayInitialFocus is true and initial focus in this trap
11707
11934
  // has been delayed during activation
11708
- delayInitialFocusTimer: undefined
11935
+ delayInitialFocusTimer: undefined,
11936
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
11937
+ recentNavEvent: undefined
11709
11938
  };
11710
11939
  var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
11711
11940
 
@@ -11724,7 +11953,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11724
11953
  /**
11725
11954
  * Finds the index of the container that contains the element.
11726
11955
  * @param {HTMLElement} element
11727
- * @param {Event} [event]
11956
+ * @param {Event} [event] If available, and `element` isn't directly found in any container,
11957
+ * the event's composed path is used to see if includes any known trap containers in the
11958
+ * case where the element is inside a Shadow DOM.
11728
11959
  * @returns {number} Index of the container in either `state.containers` or
11729
11960
  * `state.containerGroups` (the order/length of these lists are the same); -1
11730
11961
  * if the element isn't found.
@@ -11819,14 +12050,41 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11819
12050
  var tabbableNodes = tabbable(container, config.tabbableOptions);
11820
12051
 
11821
12052
  // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
11822
- // are a superset of tabbable nodes
12053
+ // are a superset of tabbable nodes since nodes with negative `tabindex` attributes
12054
+ // are focusable but not tabbable
11823
12055
  var focusableNodes = focusable(container, config.tabbableOptions);
12056
+ var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
12057
+ var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
12058
+ var firstDomTabbableNode = focusableNodes.find(function (node) {
12059
+ return isTabbable(node);
12060
+ });
12061
+ var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
12062
+ return isTabbable(node);
12063
+ });
12064
+ var posTabIndexesFound = !!tabbableNodes.find(function (node) {
12065
+ return getTabIndex(node) > 0;
12066
+ });
11824
12067
  return {
11825
12068
  container: container,
11826
12069
  tabbableNodes: tabbableNodes,
11827
12070
  focusableNodes: focusableNodes,
11828
- firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
11829
- lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
12071
+ /** True if at least one node with positive `tabindex` was found in this container. */
12072
+ posTabIndexesFound: posTabIndexesFound,
12073
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
12074
+ firstTabbableNode: firstTabbableNode,
12075
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
12076
+ lastTabbableNode: lastTabbableNode,
12077
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
12078
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
12079
+ // because that API doesn't work with Shadow DOM as well as it should (@see
12080
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
12081
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
12082
+ // "close enough most of the time" alternative for positive tabindexes which should generally
12083
+ // be avoided anyway...
12084
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
12085
+ firstDomTabbableNode: firstDomTabbableNode,
12086
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
12087
+ lastDomTabbableNode: lastDomTabbableNode,
11830
12088
  /**
11831
12089
  * Finds the __tabbable__ node that follows the given node in the specified direction,
11832
12090
  * in this container, if any.
@@ -11837,30 +12095,24 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11837
12095
  */
11838
12096
  nextTabbableNode: function nextTabbableNode(node) {
11839
12097
  var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
11840
- // NOTE: If tabindex is positive (in order to manipulate the tab order separate
11841
- // from the DOM order), this __will not work__ because the list of focusableNodes,
11842
- // while it contains tabbable nodes, does not sort its nodes in any order other
11843
- // than DOM order, because it can't: Where would you place focusable (but not
11844
- // tabbable) nodes in that order? They have no order, because they aren't tabbale...
11845
- // Support for positive tabindex is already broken and hard to manage (possibly
11846
- // not supportable, TBD), so this isn't going to make things worse than they
11847
- // already are, and at least makes things better for the majority of cases where
11848
- // tabindex is either 0/unset or negative.
11849
- // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
11850
- var nodeIdx = focusableNodes.findIndex(function (n) {
11851
- return n === node;
11852
- });
12098
+ var nodeIdx = tabbableNodes.indexOf(node);
11853
12099
  if (nodeIdx < 0) {
11854
- return undefined;
11855
- }
11856
- if (forward) {
11857
- return focusableNodes.slice(nodeIdx + 1).find(function (n) {
11858
- return isTabbable(n, config.tabbableOptions);
12100
+ // either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
12101
+ // since `node` should at least have been focusable, we assume that's the case and mimic
12102
+ // what browsers do, which is set focus to the next node in __document position order__,
12103
+ // regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
12104
+ // above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
12105
+ // basic DOM order
12106
+ if (forward) {
12107
+ return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
12108
+ return isTabbable(el);
12109
+ });
12110
+ }
12111
+ return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
12112
+ return isTabbable(el);
11859
12113
  });
11860
12114
  }
11861
- return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
11862
- return isTabbable(n, config.tabbableOptions);
11863
- });
12115
+ return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
11864
12116
  }
11865
12117
  };
11866
12118
  });
@@ -11873,6 +12125,19 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11873
12125
  ) {
11874
12126
  throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
11875
12127
  }
12128
+
12129
+ // NOTE: Positive tabindexes are only properly supported in single-container traps because
12130
+ // doing it across multiple containers where tabindexes could be all over the place
12131
+ // would require Tabbable to support multiple containers, would require additional
12132
+ // specialized Shadow DOM support, and would require Tabbable's multi-container support
12133
+ // to look at those containers in document position order rather than user-provided
12134
+ // order (as they are treated in Focus-trap, for legacy reasons). See discussion on
12135
+ // https://github.com/focus-trap/focus-trap/issues/375 for more details.
12136
+ if (state.containerGroups.find(function (g) {
12137
+ return g.posTabIndexesFound;
12138
+ }) && state.containerGroups.length > 1) {
12139
+ throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
12140
+ }
11876
12141
  };
11877
12142
  var tryFocus = function tryFocus(node) {
11878
12143
  if (node === false) {
@@ -11888,6 +12153,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11888
12153
  node.focus({
11889
12154
  preventScroll: !!config.preventScroll
11890
12155
  });
12156
+ // NOTE: focus() API does not trigger focusIn event so set MRU node manually
11891
12157
  state.mostRecentlyFocusedNode = node;
11892
12158
  if (isSelectableInput(node)) {
11893
12159
  node.select();
@@ -11898,64 +12164,23 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11898
12164
  return node ? node : node === false ? false : previousActiveElement;
11899
12165
  };
11900
12166
 
11901
- // This needs to be done on mousedown and touchstart instead of click
11902
- // so that it precedes the focus event.
11903
- var checkPointerDown = function checkPointerDown(e) {
11904
- var target = getActualTarget(e);
11905
- if (findContainerIndex(target, e) >= 0) {
11906
- // allow the click since it ocurred inside the trap
11907
- return;
11908
- }
11909
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
11910
- // immediately deactivate the trap
11911
- trap.deactivate({
11912
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
11913
- // which will result in the outside click setting focus to the node
11914
- // that was clicked (and if not focusable, to "nothing"); by setting
11915
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
11916
- // on activation (or the configured `setReturnFocus` node), whether the
11917
- // outside click was on a focusable node or not
11918
- returnFocus: config.returnFocusOnDeactivate
11919
- });
11920
- return;
11921
- }
11922
-
11923
- // This is needed for mobile devices.
11924
- // (If we'll only let `click` events through,
11925
- // then on mobile they will be blocked anyways if `touchstart` is blocked.)
11926
- if (valueOrHandler(config.allowOutsideClick, e)) {
11927
- // allow the click outside the trap to take place
11928
- return;
11929
- }
11930
-
11931
- // otherwise, prevent the click
11932
- e.preventDefault();
11933
- };
11934
-
11935
- // In case focus escapes the trap for some strange reason, pull it back in.
11936
- var checkFocusIn = function checkFocusIn(e) {
11937
- var target = getActualTarget(e);
11938
- var targetContained = findContainerIndex(target, e) >= 0;
11939
-
11940
- // In Firefox when you Tab out of an iframe the Document is briefly focused.
11941
- if (targetContained || target instanceof Document) {
11942
- if (targetContained) {
11943
- state.mostRecentlyFocusedNode = target;
11944
- }
11945
- } else {
11946
- // escaped! pull it back in to where it just left
11947
- e.stopImmediatePropagation();
11948
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
11949
- }
11950
- };
11951
-
11952
- // Hijack key nav events on the first and last focusable nodes of the trap,
11953
- // in order to prevent focus from escaping. If it escapes for even a
11954
- // moment it can end up scrolling the page and causing confusion so we
11955
- // kind of need to capture the action at the keydown phase.
11956
- var checkKeyNav = function checkKeyNav(event) {
11957
- var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11958
- var target = getActualTarget(event);
12167
+ /**
12168
+ * Finds the next node (in either direction) where focus should move according to a
12169
+ * keyboard focus-in event.
12170
+ * @param {Object} params
12171
+ * @param {Node} [params.target] Known target __from which__ to navigate, if any.
12172
+ * @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
12173
+ * will be used to determine the `target`). Ignored if `target` is specified.
12174
+ * @param {boolean} [params.isBackward] True if focus should move backward.
12175
+ * @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
12176
+ * determined given the current state of the trap.
12177
+ */
12178
+ var findNextNavNode = function findNextNavNode(_ref2) {
12179
+ var target = _ref2.target,
12180
+ event = _ref2.event,
12181
+ _ref2$isBackward = _ref2.isBackward,
12182
+ isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
12183
+ target = target || getActualTarget(event);
11959
12184
  updateTabbableNodes();
11960
12185
  var destinationNode = null;
11961
12186
  if (state.tabbableGroups.length > 0) {
@@ -11978,8 +12203,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11978
12203
  // REVERSE
11979
12204
 
11980
12205
  // is the target the first tabbable node in a group?
11981
- var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
11982
- var firstTabbableNode = _ref2.firstTabbableNode;
12206
+ var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
12207
+ var firstTabbableNode = _ref3.firstTabbableNode;
11983
12208
  return target === firstTabbableNode;
11984
12209
  });
11985
12210
  if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
@@ -11997,7 +12222,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
11997
12222
  // the LAST group if it's the first tabbable node of the FIRST group)
11998
12223
  var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
11999
12224
  var destinationGroup = state.tabbableGroups[destinationGroupIndex];
12000
- destinationNode = destinationGroup.lastTabbableNode;
12225
+ destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
12001
12226
  } else if (!isTabEvent(event)) {
12002
12227
  // user must have customized the nav keys so we have to move focus manually _within_
12003
12228
  // the active group: do this based on the order determined by tabbable()
@@ -12007,8 +12232,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
12007
12232
  // FORWARD
12008
12233
 
12009
12234
  // is the target the last tabbable node in a group?
12010
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
12011
- var lastTabbableNode = _ref3.lastTabbableNode;
12235
+ var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref4) {
12236
+ var lastTabbableNode = _ref4.lastTabbableNode;
12012
12237
  return target === lastTabbableNode;
12013
12238
  });
12014
12239
  if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
@@ -12026,7 +12251,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
12026
12251
  // group if it's the last tabbable node of the LAST group)
12027
12252
  var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
12028
12253
  var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
12029
- destinationNode = _destinationGroup.firstTabbableNode;
12254
+ destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
12030
12255
  } else if (!isTabEvent(event)) {
12031
12256
  // user must have customized the nav keys so we have to move focus manually _within_
12032
12257
  // the active group: do this based on the order determined by tabbable()
@@ -12038,6 +12263,153 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
12038
12263
  // NOTE: the fallbackFocus option does not support returning false to opt-out
12039
12264
  destinationNode = getNodeForOption('fallbackFocus');
12040
12265
  }
12266
+ return destinationNode;
12267
+ };
12268
+
12269
+ // This needs to be done on mousedown and touchstart instead of click
12270
+ // so that it precedes the focus event.
12271
+ var checkPointerDown = function checkPointerDown(e) {
12272
+ var target = getActualTarget(e);
12273
+ if (findContainerIndex(target, e) >= 0) {
12274
+ // allow the click since it ocurred inside the trap
12275
+ return;
12276
+ }
12277
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
12278
+ // immediately deactivate the trap
12279
+ trap.deactivate({
12280
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
12281
+ // which will result in the outside click setting focus to the node
12282
+ // that was clicked (and if not focusable, to "nothing"); by setting
12283
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
12284
+ // on activation (or the configured `setReturnFocus` node), whether the
12285
+ // outside click was on a focusable node or not
12286
+ returnFocus: config.returnFocusOnDeactivate
12287
+ });
12288
+ return;
12289
+ }
12290
+
12291
+ // This is needed for mobile devices.
12292
+ // (If we'll only let `click` events through,
12293
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
12294
+ if (valueOrHandler(config.allowOutsideClick, e)) {
12295
+ // allow the click outside the trap to take place
12296
+ return;
12297
+ }
12298
+
12299
+ // otherwise, prevent the click
12300
+ e.preventDefault();
12301
+ };
12302
+
12303
+ // In case focus escapes the trap for some strange reason, pull it back in.
12304
+ // NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
12305
+ // scrolling if the node that got focused was out of view; there's nothing we can do to
12306
+ // prevent that from happening by the time we discover that focus escaped
12307
+ var checkFocusIn = function checkFocusIn(event) {
12308
+ var target = getActualTarget(event);
12309
+ var targetContained = findContainerIndex(target, event) >= 0;
12310
+
12311
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
12312
+ if (targetContained || target instanceof Document) {
12313
+ if (targetContained) {
12314
+ state.mostRecentlyFocusedNode = target;
12315
+ }
12316
+ } else {
12317
+ // escaped! pull it back in to where it just left
12318
+ event.stopImmediatePropagation();
12319
+
12320
+ // focus will escape if the MRU node had a positive tab index and user tried to nav forward;
12321
+ // it will also escape if the MRU node had a 0 tab index and user tried to nav backward
12322
+ // toward a node with a positive tab index
12323
+ var nextNode; // next node to focus, if we find one
12324
+ var navAcrossContainers = true;
12325
+ if (state.mostRecentlyFocusedNode) {
12326
+ if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
12327
+ // MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
12328
+ var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
12329
+ // there MAY not be any tabbable nodes in the container if there are at least 2 containers
12330
+ // and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
12331
+ // with at least one tabbable node in order to function, so this could be the other container
12332
+ // with nothing tabbable in it)
12333
+ var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
12334
+ if (tabbableNodes.length > 0) {
12335
+ // MRU tab index MAY not be found if the MRU node is focusable but not tabbable
12336
+ var mruTabIdx = tabbableNodes.findIndex(function (node) {
12337
+ return node === state.mostRecentlyFocusedNode;
12338
+ });
12339
+ if (mruTabIdx >= 0) {
12340
+ if (config.isKeyForward(state.recentNavEvent)) {
12341
+ if (mruTabIdx + 1 < tabbableNodes.length) {
12342
+ nextNode = tabbableNodes[mruTabIdx + 1];
12343
+ navAcrossContainers = false;
12344
+ }
12345
+ // else, don't wrap within the container as focus should move to next/previous
12346
+ // container
12347
+ } else {
12348
+ if (mruTabIdx - 1 >= 0) {
12349
+ nextNode = tabbableNodes[mruTabIdx - 1];
12350
+ navAcrossContainers = false;
12351
+ }
12352
+ // else, don't wrap within the container as focus should move to next/previous
12353
+ // container
12354
+ }
12355
+ // else, don't find in container order without considering direction too
12356
+ }
12357
+ }
12358
+ // else, no tabbable nodes in that container (which means we must have at least one other
12359
+ // container with at least one tabbable node in it, otherwise focus-trap would've thrown
12360
+ // an error the last time updateTabbableNodes() was run): find next node among all known
12361
+ // containers
12362
+ } else {
12363
+ // check to see if there's at least one tabbable node with a positive tab index inside
12364
+ // the trap because focus seems to escape when navigating backward from a tabbable node
12365
+ // with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
12366
+ // the greatest positive tab index like it should)
12367
+ if (!state.containerGroups.some(function (g) {
12368
+ return g.tabbableNodes.some(function (n) {
12369
+ return getTabIndex(n) > 0;
12370
+ });
12371
+ })) {
12372
+ // no containers with tabbable nodes with positive tab indexes which means the focus
12373
+ // escaped for some other reason and we should just execute the fallback to the
12374
+ // MRU node or initial focus node, if any
12375
+ navAcrossContainers = false;
12376
+ }
12377
+ }
12378
+ } else {
12379
+ // no MRU node means we're likely in some initial condition when the trap has just
12380
+ // been activated and initial focus hasn't been given yet, in which case we should
12381
+ // fall through to trying to focus the initial focus node, which is what should
12382
+ // happen below at this point in the logic
12383
+ navAcrossContainers = false;
12384
+ }
12385
+ if (navAcrossContainers) {
12386
+ nextNode = findNextNavNode({
12387
+ // move FROM the MRU node, not event-related node (which will be the node that is
12388
+ // outside the trap causing the focus escape we're trying to fix)
12389
+ target: state.mostRecentlyFocusedNode,
12390
+ isBackward: config.isKeyBackward(state.recentNavEvent)
12391
+ });
12392
+ }
12393
+ if (nextNode) {
12394
+ tryFocus(nextNode);
12395
+ } else {
12396
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
12397
+ }
12398
+ }
12399
+ state.recentNavEvent = undefined; // clear
12400
+ };
12401
+
12402
+ // Hijack key nav events on the first and last focusable nodes of the trap,
12403
+ // in order to prevent focus from escaping. If it escapes for even a
12404
+ // moment it can end up scrolling the page and causing confusion so we
12405
+ // kind of need to capture the action at the keydown phase.
12406
+ var checkKeyNav = function checkKeyNav(event) {
12407
+ var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
12408
+ state.recentNavEvent = event;
12409
+ var destinationNode = findNextNavNode({
12410
+ event: event,
12411
+ isBackward: isBackward
12412
+ });
12041
12413
  if (destinationNode) {
12042
12414
  if (isTabEvent(event)) {
12043
12415
  // since tab natively moves focus, we wouldn't have a destination node unless we
@@ -12962,7 +13334,7 @@ const Event = ({ event, newParticipant }) => {
12962
13334
  if (newParticipant) {
12963
13335
  classNames.push('conversation__item--new-participant');
12964
13336
  }
12965
- return ((0,jsx_runtime_.jsxs)("li", Object.assign({ className: (0,css/* className */.o)(classNames), ref: containerRef }, { children: [event.timeIndicator && (0,jsx_runtime_.jsx)(time_indicator, { event: event }), (0,jsx_runtime_.jsx)(Component, Object.assign({ event: event }, { children: (0,jsx_runtime_.jsx)(SubComponent, { event: event }) }))] })));
13337
+ return ((0,jsx_runtime_.jsxs)("li", { className: (0,css/* className */.o)(classNames), ref: containerRef, children: [event.timeIndicator && (0,jsx_runtime_.jsx)(time_indicator, { event: event }), (0,jsx_runtime_.jsx)(Component, { event: event, children: (0,jsx_runtime_.jsx)(SubComponent, { event: event }) })] }));
12966
13338
  };
12967
13339
  /* harmony default export */ const event_event = (Event);
12968
13340
 
@@ -13049,7 +13421,7 @@ const Conversation = () => {
13049
13421
  e.preventDefault();
13050
13422
  focusSkiplinkTarget();
13051
13423
  };
13052
- return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [isOpen && ((0,jsx_runtime_.jsx)("a", Object.assign({ className: (0,css/* className */.o)('skip-link'), href: `#${skiplinkTargetId}`, onClick: onClickHandler }, { children: t('skiplinkText') }))), (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('chat__body') }, { children: (0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('conversation__container') }, { children: [(0,jsx_runtime_.jsx)(privacy_disclaimer, {}), (0,jsx_runtime_.jsxs)("ol", Object.assign({ className: (0,css/* className */.o)('conversation') }, { children: [(0,jsx_runtime_.jsx)(component_filter, { children: (0,jsx_runtime_.jsx)(Events, {}) }), debouncedIsLoading ? (0,jsx_runtime_.jsx)(loader, {}) : null, (0,jsx_runtime_.jsx)(AbortTransactionButton, {})] }))] })) }))] }));
13424
+ return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [isOpen && ((0,jsx_runtime_.jsx)("a", { className: (0,css/* className */.o)('skip-link'), href: `#${skiplinkTargetId}`, onClick: onClickHandler, children: t('skiplinkText') })), (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('chat__body'), children: (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('conversation__container'), children: [(0,jsx_runtime_.jsx)(privacy_disclaimer, {}), (0,jsx_runtime_.jsxs)("ol", { className: (0,css/* className */.o)('conversation'), children: [(0,jsx_runtime_.jsx)(component_filter, { children: (0,jsx_runtime_.jsx)(Events, {}) }), debouncedIsLoading ? (0,jsx_runtime_.jsx)(loader, {}) : null, (0,jsx_runtime_.jsx)(AbortTransactionButton, {})] })] }) })] }));
13053
13425
  };
13054
13426
  /* harmony default export */ const conversation = (Conversation);
13055
13427
 
@@ -13415,7 +13787,7 @@ function FormProvider(_a) {
13415
13787
  console.error('"onSubmit" is required.');
13416
13788
  return null;
13417
13789
  }
13418
- return ((0,jsx_runtime_.jsx)(Provider, Object.assign({}, props, { value: contextValue }, { children: children })));
13790
+ return ((0,jsx_runtime_.jsx)(Provider, Object.assign({}, props, { value: contextValue, children: children })));
13419
13791
  }
13420
13792
 
13421
13793
  // EXTERNAL MODULE: ./src/javascripts/domains/visibility/constants.ts
@@ -13483,8 +13855,8 @@ function error_Error({
13483
13855
 
13484
13856
 
13485
13857
 
13486
- const FormControlWrapper = ({ contentHint, id, labelText, labelClass = (0,css/* className */.o)('label'), validity, errorText, children, }) => {
13487
- return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [contentHint && ((0,jsx_runtime_.jsx)("span", Object.assign({ id: `${id}-content-hint`, className: (0,css/* className */.o)('input__content-hint') }, { children: contentHint }))), (0,jsx_runtime_.jsx)(error_Error, { id: `${id}-error`, error: !validity && errorText }), (0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('form-control__wrapper') }, { children: [(0,jsx_runtime_.jsx)("label", Object.assign({ htmlFor: id, className: labelClass }, { children: labelText })), children] }))] }));
13858
+ const FormControlWrapper = ({ contentHint, id, labelText, labelClass, validity, errorText, children, }) => {
13859
+ return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [contentHint && ((0,jsx_runtime_.jsx)("span", { id: `${id}-content-hint`, className: (0,css/* className */.o)('input__content-hint'), children: contentHint })), (0,jsx_runtime_.jsx)(error_Error, { id: `${id}-error`, error: !validity && errorText }), (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('form-control__wrapper'), children: [(0,jsx_runtime_.jsx)("label", { htmlFor: id, className: (0,css/* className */.o)(labelClass), children: labelText }), children] })] }));
13488
13860
  };
13489
13861
  /* harmony default export */ const wrapper = (FormControlWrapper);
13490
13862
 
@@ -13519,7 +13891,7 @@ function Input(_a) {
13519
13891
  describedByIds.push(`${id}-error`);
13520
13892
  }
13521
13893
  // todo: destructure Field
13522
- return ((0,jsx_runtime_.jsx)(wrapper, Object.assign({ id: id, contentHint: contentHint, validity: !hasError, errorText: error, labelText: labelText, labelClass: labelClass }, { children: (0,jsx_runtime_.jsx)("input", Object.assign({ id: id, name: name, type: type, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": describedByIds.join(' ') || null }, field, props)) })));
13894
+ return ((0,jsx_runtime_.jsx)(wrapper, { id: id, contentHint: contentHint, validity: !hasError, errorText: error, labelText: labelText, labelClass: labelClass, children: (0,jsx_runtime_.jsx)("input", Object.assign({ id: id, name: name, type: type, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": describedByIds.join(' ') || null }, field, props)) }));
13523
13895
  }
13524
13896
  /* harmony default export */ const input = (Input);
13525
13897
 
@@ -13564,13 +13936,13 @@ function TextEntryForm({ controlName, skipLinkId }) {
13564
13936
  // When a message is submitted, the keyboard should be prevented from closing on mobile devices
13565
13937
  event.preventDefault();
13566
13938
  };
13567
- return ((0,jsx_runtime_.jsxs)(form_controls_form, Object.assign({ className: (0,css/* className */.o)('entry-form'), disableValidationClasses: true, noValidate: "true" }, { children: [(0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)([
13939
+ return ((0,jsx_runtime_.jsxs)(form_controls_form, { className: (0,css/* className */.o)('entry-form'), disableValidationClasses: true, noValidate: "true", children: [(0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)([
13568
13940
  'input--text__container',
13569
13941
  ...(reachedCharacterWarning && !reachedCharacterLimit
13570
13942
  ? ['character-warning']
13571
13943
  : []),
13572
13944
  ...(reachedCharacterLimit ? ['character-exceeded'] : []),
13573
- ]) }, { children: [(0,jsx_runtime_.jsx)(input, { id: skipLinkId, type: "text", name: controlName, className: (0,css/* className */.o)('input__text'), autocomplete: "off", placeholder: placeholder, labelText: label, labelClass: (0,css/* className */.o)(labelClass), "aria-invalid": hasCharacterLimit ? reachedCharacterLimit : null, onKeyUp: handleKeyUp, onFocus: handleFocus }), (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('character-count') }, { children: reachedCharacterWarning && (0,jsx_runtime_.jsx)("span", { children: remainingChars }) }))] })), (0,jsx_runtime_.jsx)("button", Object.assign({ className: (0,css/* className */.o)('button', 'input__submit'), type: "submit", onPointerDown: handlePointerDown, "aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null }, { children: (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "send", size: "32", alt: t('input.sendMessage') }) }))] })));
13945
+ ]), children: [(0,jsx_runtime_.jsx)(input, { id: skipLinkId, type: "text", name: controlName, className: (0,css/* className */.o)('input__text'), autocomplete: "off", placeholder: placeholder, labelText: label, labelClass: (0,css/* className */.o)(labelClass), "aria-invalid": hasCharacterLimit ? reachedCharacterLimit : null, onKeyUp: handleKeyUp, onFocus: handleFocus }), (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('character-count'), children: reachedCharacterWarning && (0,jsx_runtime_.jsx)("span", { children: remainingChars }) })] }), (0,jsx_runtime_.jsx)("button", { className: (0,css/* className */.o)('button', 'input__submit'), type: "submit", onPointerDown: handlePointerDown, "aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null, children: (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "send", size: "32", alt: t('input.sendMessage') }) })] }));
13574
13946
  }
13575
13947
 
13576
13948
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/entry/text-entry/index.js
@@ -14677,16 +15049,16 @@ const OptionsFrame = ({ className: givenClassName, children, onCancel, headingTe
14677
15049
  (0,hooks_.useEffect)(() => {
14678
15050
  (0,general_utils/* focusElement */.C5)(container.current);
14679
15051
  }, [container]);
14680
- return ((0,jsx_runtime_.jsx)("section", Object.assign({ className: (0,css/* className */.o)('options', {
15052
+ return ((0,jsx_runtime_.jsx)("section", { className: (0,css/* className */.o)('options', {
14681
15053
  'options--right': position.horizontal === 'right',
14682
15054
  'options--left': position.horizontal === 'left',
14683
15055
  'options--top': position.vertical === 'top',
14684
15056
  'options--bottom': position.vertical === 'bottom',
14685
- }, givenClassName), "aria-labelledby": mainHeadingId, tabIndex: -1, ref: container }, { children: (0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('options__body') }, { children: [(0,jsx_runtime_.jsx)("h2", Object.assign({ id: mainHeadingId, className: (0,css/* className */.o)('options__title') }, { children: headingText })), (0,jsx_runtime_.jsxs)("button", Object.assign({ type: "button", onClick: onCancelHandler, "aria-describedby": mainHeadingId, className: (0,css/* className */.o)('button', 'options__close'), ref: (btn) => {
15057
+ }, givenClassName), "aria-labelledby": mainHeadingId, tabIndex: -1, ref: container, children: (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('options__body'), children: [(0,jsx_runtime_.jsx)("h2", { id: mainHeadingId, className: (0,css/* className */.o)('options__title'), children: headingText }), (0,jsx_runtime_.jsxs)("button", { type: "button", onClick: onCancelHandler, "aria-describedby": mainHeadingId, className: (0,css/* className */.o)('button', 'options__close'), ref: (btn) => {
14686
15058
  if (cancelButtonRef) {
14687
15059
  cancelButtonRef.current = btn;
14688
15060
  }
14689
- } }, { children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "close", size: "16", alt: "" }), (0,jsx_runtime_.jsx)("span", { children: cancelButtonText })] })), description ? ((0,jsx_runtime_.jsx)("p", Object.assign({ className: (0,css/* className */.o)('options__description'), id: descriptionId }, { children: description }))) : null, (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('options__wrapper') }, { children: children }))] })) })));
15061
+ }, children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "close", size: "16", alt: "" }), (0,jsx_runtime_.jsx)("span", { children: cancelButtonText })] }), description ? ((0,jsx_runtime_.jsx)("p", { className: (0,css/* className */.o)('options__description'), id: descriptionId, children: description })) : null, (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('options__wrapper'), children: children })] }) }));
14690
15062
  };
14691
15063
  /* harmony default export */ const options_frame = (OptionsFrame);
14692
15064
 
@@ -15034,14 +15406,14 @@ const OptionsButton = () => {
15034
15406
 
15035
15407
 
15036
15408
 
15037
- const TranslationOption = ({ label, checked, description, onChange, id, }) => {
15409
+ const TranslationOption = ({ label, checked, description, onChange, id, itemClassName, }) => {
15038
15410
  const onKeyDown = (e) => {
15039
15411
  if (e.code === 'Space' || e.code === 'Enter') {
15040
15412
  e.preventDefault();
15041
15413
  onChange();
15042
15414
  }
15043
15415
  };
15044
- return ((0,jsx_runtime_.jsxs)("li", Object.assign({ className: (0,css/* className */.o)('translation-options__item'), "aria-selected": checked, role: "option", tabIndex: 0, onClick: onChange, onKeyDown: onKeyDown, id: id }, { children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { alt: "", name: "check", size: "16" }), label, " ", description && (0,jsx_runtime_.jsxs)("span", { children: ["(", description, ")"] })] })));
15416
+ return ((0,jsx_runtime_.jsxs)("li", { className: (0,css/* className */.o)([itemClassName, 'translation-options__item']), "aria-selected": checked, role: "option", tabIndex: 0, onClick: onChange, onKeyDown: onKeyDown, id: id, children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { alt: "", name: "check", size: "16" }), label, " ", description && (0,jsx_runtime_.jsxs)("span", { children: ["(", description, ")"] })] }));
15045
15417
  };
15046
15418
  /* harmony default export */ const translation_option = (TranslationOption);
15047
15419
 
@@ -15053,12 +15425,13 @@ const TranslationOption = ({ label, checked, description, onChange, id, }) => {
15053
15425
 
15054
15426
 
15055
15427
 
15428
+ const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
15056
15429
  const TranslationOptions = ({ onChange, describedById, }) => {
15057
15430
  const { context: { locale: defaultLocale }, } = (0,hooks/* useConfig */.ZR)();
15058
15431
  const { t } = (0,i18n_hooks/* useI18n */.Q)();
15059
15432
  const { focusContainer } = (0,translations_hooks/* useTranslationsContainer */.a5)();
15060
15433
  const { languages, currentLocale, enableTranslations, disableTranslations } = (0,translations_hooks/* useTranslations */.T_)();
15061
- const handleChange = ({ locale }) => () => {
15434
+ const handleChange = (locale) => () => {
15062
15435
  if (locale === currentLocale || defaultLocale === locale) {
15063
15436
  disableTranslations();
15064
15437
  }
@@ -15068,22 +15441,25 @@ const TranslationOptions = ({ onChange, describedById, }) => {
15068
15441
  onChange();
15069
15442
  focusContainer();
15070
15443
  };
15071
- const sortedLanguages = (0,hooks_.useMemo)(() => {
15072
- return [...languages].sort((a, b) => {
15073
- if (a.locale === defaultLocale)
15074
- return -1;
15075
- if (b.locale === defaultLocale)
15076
- return 1;
15077
- return a.nativeName.localeCompare(b.nativeName, undefined, {
15078
- sensitivity: 'base',
15079
- });
15080
- });
15081
- }, [languages, defaultLocale]);
15082
- return ((0,jsx_runtime_.jsx)("ul", Object.assign({ "aria-describedby": describedById, role: "listbox", tabIndex: -1, className: (0,css/* className */.o)('translation-options') }, { children: sortedLanguages.map((language, idx) => {
15083
- const isOriginal = idx === 0;
15084
- const checked = currentLocale === language.locale || (!currentLocale && isOriginal);
15085
- return ((0,jsx_runtime_.jsx)(translation_option, { id: language.locale, label: language.nativeName, checked: checked, description: isOriginal && t('translations.settings.original'), onChange: handleChange(language) }, language.locale));
15086
- }) })));
15444
+ const { primaryLanguages, remainingLanguages } = (0,compat_namespaceObject.useMemo)(() => languages.reduce((acc, language) => {
15445
+ const isOriginal = language.locale === defaultLocale;
15446
+ const checked = isChecked(language, currentLocale, isOriginal);
15447
+ if (language.locale !== defaultLocale) {
15448
+ acc.remainingLanguages.push(Object.assign(Object.assign({}, language), { checked, isOriginal }));
15449
+ }
15450
+ const selectedIdx = acc.remainingLanguages.findIndex((l) => l.locale === currentLocale);
15451
+ if (isOriginal || (checked && selectedIdx > 4)) {
15452
+ acc.primaryLanguages.push(Object.assign(Object.assign({}, language), { checked, isOriginal }));
15453
+ }
15454
+ return acc;
15455
+ }, {
15456
+ primaryLanguages: [],
15457
+ remainingLanguages: [],
15458
+ }), [currentLocale, defaultLocale, languages]);
15459
+ return ((0,jsx_runtime_.jsxs)("ul", { "aria-describedby": describedById, role: "listbox", tabIndex: -1, className: (0,css/* className */.o)('translation-options'), children: [primaryLanguages.map(({ locale, nativeName, checked, isOriginal }, idx) => ((0,jsx_runtime_.jsx)(translation_option, { id: locale, label: nativeName, checked: checked, description: isOriginal && t('translations.settings.original'), onChange: handleChange(locale), itemClassName: (0,css/* className */.o)({
15460
+ 'translation-options__item--original': isOriginal,
15461
+ 'translation-options__item--selected': checked && idx !== 0,
15462
+ }) }, locale))), remainingLanguages.map(({ locale, nativeName, checked, isOriginal }) => ((0,jsx_runtime_.jsx)(translation_option, { id: locale, label: nativeName, checked: checked, description: isOriginal && t('translations.settings.original'), onChange: handleChange(locale) }, locale)))] }));
15087
15463
  };
15088
15464
  /* harmony default export */ const translation_options = (TranslationOptions);
15089
15465
 
@@ -15096,7 +15472,7 @@ const TranslationOptions = ({ onChange, describedById, }) => {
15096
15472
  function TranslationsOptionsDialog({ onClose, position, }) {
15097
15473
  const { t } = (0,i18n_hooks/* useI18n */.Q)();
15098
15474
  const descriptionId = (0,seamly_hooks/* useGeneratedId */.I8)();
15099
- return ((0,jsx_runtime_.jsx)(options_frame, Object.assign({ onCancel: onClose, headingText: t('translations.menu.title'), cancelButtonText: t('translations.settings.cancelButtonText'), description: t('translations.menu.description'), descriptionId: descriptionId, position: position, disableButtonFocusing: true }, { children: (0,jsx_runtime_.jsx)(translation_options, { describedById: descriptionId, onChange: onClose }) })));
15475
+ return ((0,jsx_runtime_.jsx)(options_frame, { onCancel: onClose, headingText: t('translations.menu.title'), cancelButtonText: t('translations.settings.cancelButtonText'), description: t('translations.menu.description'), descriptionId: descriptionId, position: position, disableButtonFocusing: true, children: (0,jsx_runtime_.jsx)(translation_options, { describedById: descriptionId, onChange: onClose }) }));
15100
15476
  }
15101
15477
  /* harmony default export */ const options_dialog = (TranslationsOptionsDialog);
15102
15478
 
@@ -15136,11 +15512,11 @@ function TranslationsOptionsButton({ children, position = {
15136
15512
  e.preventDefault();
15137
15513
  }
15138
15514
  };
15139
- return ((0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('translations__container'), onKeyDown: onMainKeyDownHandler }, { children: [(0,jsx_runtime_.jsx)(in_out_transition, Object.assign({ transitionStartState: transitionStartStates.notRendered, isActive: menuIsOpen }, { children: (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('options__dialog'), role: "dialog" }, { children: (0,jsx_runtime_.jsx)(options_dialog, { onClose: handleDialogClose, position: position }) })) })), (0,jsx_runtime_.jsx)("button", Object.assign({ type: "button", className: (0,css/* className */.o)([
15515
+ return ((0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('translations__container'), onKeyDown: onMainKeyDownHandler, children: [(0,jsx_runtime_.jsx)(in_out_transition, { transitionStartState: transitionStartStates.notRendered, isActive: menuIsOpen, children: (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('options__dialog'), role: "dialog", children: (0,jsx_runtime_.jsx)(options_dialog, { onClose: handleDialogClose, position: position }) }) }), (0,jsx_runtime_.jsx)("button", { type: "button", className: (0,css/* className */.o)([
15140
15516
  'button',
15141
15517
  'chat__options__button',
15142
15518
  ...classNames,
15143
- ]), id: toggleButtonId, onClick: handleToggleClick, onKeyDown: handleToggleKeyDown, ref: toggleButton, "aria-haspopup": "dialog", "aria-expanded": menuIsOpen }, { children: children }))] })));
15519
+ ]), id: toggleButtonId, onClick: handleToggleClick, onKeyDown: handleToggleKeyDown, ref: toggleButton, "aria-haspopup": "dialog", "aria-expanded": menuIsOpen, children: children })] }));
15144
15520
  }
15145
15521
 
15146
15522
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/app-options/index.js
@@ -15210,7 +15586,7 @@ const UnreadMessagesButton = () => {
15210
15586
  const { scrollToRef, unreadIds } = (0,hooks_.useContext)(chat_scroll_context);
15211
15587
  const { isMinimized } = (0,visibility_hooks/* useVisibility */.iJ)();
15212
15588
  const { t } = (0,i18n_hooks/* useI18n */.Q)();
15213
- return ((0,jsx_runtime_.jsx)(in_out_transition, Object.assign({ isActive: !!unreadIds.length && !isMinimized }, { children: (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('unread-messages') }, { children: (0,jsx_runtime_.jsxs)("button", Object.assign({ type: "button", className: (0,css/* className */.o)('button', 'button--primary'), onClick: scrollToRef }, { children: [t('message.unreadMessagesCount', { unreadCount: unreadIds.length }), (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "chevronDown", size: "32", alt: "" })] })) })) })));
15589
+ return ((0,jsx_runtime_.jsx)(in_out_transition, { isActive: !!unreadIds.length && !isMinimized, children: (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('unread-messages'), children: (0,jsx_runtime_.jsxs)("button", { type: "button", className: (0,css/* className */.o)('button', 'button--primary'), onClick: scrollToRef, children: [t('message.unreadMessagesCount', { unreadCount: unreadIds.length }), (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "chevronDown", size: "32", alt: "" })] }) }) }));
15214
15590
  };
15215
15591
  /* harmony default export */ const unread_messages_button = (UnreadMessagesButton);
15216
15592
 
@@ -15358,13 +15734,13 @@ const ChatScrollProvider = ({ children }) => {
15358
15734
  return acc;
15359
15735
  }, {}), [events]);
15360
15736
  const { scrollToRef, scrollToBottom, containerRef, unreadIds } = use_chat_scroll(eventRefs);
15361
- return ((0,jsx_runtime_.jsx)(chat_scroll_context.Provider, Object.assign({ value: {
15737
+ return ((0,jsx_runtime_.jsx)(chat_scroll_context.Provider, { value: {
15362
15738
  eventRefs,
15363
15739
  unreadIds,
15364
15740
  scrollToRef,
15365
15741
  scrollToBottom,
15366
15742
  containerRef,
15367
- } }, { children: (0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('chat__container') }, { children: [(0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('chat__container__scroll-area'), ref: containerRef }, { children: children })), (0,jsx_runtime_.jsx)(unread_messages_button, {})] })) })));
15743
+ }, children: (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('chat__container'), children: [(0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('chat__container__scroll-area'), ref: containerRef, children: children }), (0,jsx_runtime_.jsx)(unread_messages_button, {})] }) }));
15368
15744
  };
15369
15745
  /* harmony default export */ const chat_scroll_provider = (ChatScrollProvider);
15370
15746
 
@@ -15405,7 +15781,7 @@ const CollapseButton = () => {
15405
15781
 
15406
15782
  const ChatStatus = ({ children, handleClose, title, closeButtonText, srCloseButtonText, id, }) => {
15407
15783
  const headingId = (0,utility_hooks/* useGeneratedId */.I8)();
15408
- return ((0,jsx_runtime_.jsxs)("section", Object.assign({ tabIndex: -1, id: id, "aria-labelledby": title ? headingId : undefined, className: (0,css/* className */.o)('chat-status', !title && 'chat-status--condensed') }, { children: [(0,jsx_runtime_.jsxs)("div", Object.assign({ className: (0,css/* className */.o)('chat-status__body') }, { children: [title ? ((0,jsx_runtime_.jsx)("h2", Object.assign({ className: (0,css/* className */.o)('chat-status__title'), id: headingId }, { children: title }))) : null, children] })), typeof handleClose === 'function' && ((0,jsx_runtime_.jsxs)("button", Object.assign({ type: "button", onClick: handleClose, className: (0,css/* className */.o)('button', 'button--tertiary', 'chat-status__close') }, { children: [closeButtonText || (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "close", size: "16", alt: "" }), srCloseButtonText && ((0,jsx_runtime_.jsx)("span", Object.assign({ className: (0,css/* className */.o)('visually-hidden') }, { children: srCloseButtonText })))] })))] })));
15784
+ return ((0,jsx_runtime_.jsxs)("section", { tabIndex: -1, id: id, "aria-labelledby": title ? headingId : undefined, className: (0,css/* className */.o)('chat-status', !title && 'chat-status--condensed'), children: [(0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('chat-status__body'), children: [title ? ((0,jsx_runtime_.jsx)("h2", { className: (0,css/* className */.o)('chat-status__title'), id: headingId, children: title })) : null, children] }), typeof handleClose === 'function' && ((0,jsx_runtime_.jsxs)("button", { type: "button", onClick: handleClose, className: (0,css/* className */.o)('button', 'button--tertiary', 'chat-status__close'), children: [closeButtonText || (0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: "close", size: "16", alt: "" }), srCloseButtonText && ((0,jsx_runtime_.jsx)("span", { className: (0,css/* className */.o)('visually-hidden'), children: srCloseButtonText }))] }))] }));
15409
15785
  };
15410
15786
  /* harmony default export */ const chat_status = (ChatStatus);
15411
15787
 
@@ -15440,7 +15816,7 @@ function TranslationChatStatus() {
15440
15816
 
15441
15817
 
15442
15818
 
15443
- const ChatStatusAction = ({ handleClick, icon, title, srButtonText, }) => ((0,jsx_runtime_.jsxs)("button", Object.assign({ type: "button", onClick: handleClick, className: (0,css/* className */.o)('button', 'button--primary', 'chat-status__button') }, { children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: icon, size: "16", alt: "" }), title, srButtonText && ((0,jsx_runtime_.jsx)("span", Object.assign({ className: (0,css/* className */.o)('visually-hidden') }, { children: srButtonText })))] })));
15819
+ const ChatStatusAction = ({ handleClick, icon, title, srButtonText, }) => ((0,jsx_runtime_.jsxs)("button", { type: "button", onClick: handleClick, className: (0,css/* className */.o)('button', 'button--primary', 'chat-status__button'), children: [(0,jsx_runtime_.jsx)(layout_icon/* default */.Z, { name: icon, size: "16", alt: "" }), title, srButtonText && ((0,jsx_runtime_.jsx)("span", { className: (0,css/* className */.o)('visually-hidden'), children: srButtonText }))] }));
15444
15820
  /* harmony default export */ const chat_status_action = (ChatStatusAction);
15445
15821
 
15446
15822
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/translation-proposal/index.tsx
@@ -15454,7 +15830,7 @@ function TranslationProposal() {
15454
15830
  if (!showProposal) {
15455
15831
  return null;
15456
15832
  }
15457
- return ((0,jsx_runtime_.jsx)(chat_status, Object.assign({ handleClose: dismissTranslationProposal, srCloseButtonText: translationProposal.srDismissButtonText, id: id, title: translationProposal.titleLabel }, { children: (0,jsx_runtime_.jsx)(chat_status_action, { handleClick: activateTranslationProposal, icon: "newTranslation", title: translationProposal.buttonLabel }) })));
15833
+ return ((0,jsx_runtime_.jsx)(chat_status, { handleClose: dismissTranslationProposal, srCloseButtonText: translationProposal.srDismissButtonText, id: id, title: translationProposal.titleLabel, children: (0,jsx_runtime_.jsx)(chat_status_action, { handleClick: activateTranslationProposal, icon: "newTranslation", title: translationProposal.buttonLabel }) }));
15458
15834
  }
15459
15835
 
15460
15836
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/translation-status.tsx
@@ -15764,10 +16140,14 @@ const WindowOpenButton = ({
15764
16140
  "aria-label": ariaLabel,
15765
16141
  "aria-hidden": isOpen,
15766
16142
  onClick: handleClick,
15767
- children: [(0,jsx_runtime_.jsx)("span", {
15768
- className: (0,css/* className */.o)('message-count'),
15769
- "aria-hidden": "true",
15770
- children: !!count && count
16143
+ children: [(0,jsx_runtime_.jsx)(in_out_transition, {
16144
+ isActive: !!count,
16145
+ transitionStartState: transitionStartStates.notRendered,
16146
+ children: (0,jsx_runtime_.jsx)("span", {
16147
+ className: (0,css/* className */.o)('message-count'),
16148
+ "aria-hidden": "true",
16149
+ children: count
16150
+ })
15771
16151
  }), (0,jsx_runtime_.jsx)(ButtonIcon, {})]
15772
16152
  })
15773
16153
  });
@@ -15802,7 +16182,7 @@ const WindowView = () => {
15802
16182
  },
15803
16183
  },
15804
16184
  }), [continueChatText]);
15805
- return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [(0,jsx_runtime_.jsx)(window_open_button, { onClick: openChat }), (0,jsx_runtime_.jsx)(in_out_transition, Object.assign({ isActive: preChat && !isOpen && !userHasResponded, exitAfter: getDelay(preChat, 'exitAfter'), enterDelay: getDelay(preChat, 'enterDelay'), transitionStartState: transitionStartStates.rendered }, { children: (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('unstarted-wrapper', 'unstarted-wrapper--window') }, { children: (0,jsx_runtime_.jsx)(PreChatMessages, {}) })) })), (0,jsx_runtime_.jsx)(in_out_transition, Object.assign({ isActive: continueChat && !isOpen && userHasResponded, exitAfter: getDelay(continueChat, 'exitAfter'), enterDelay: getDelay(continueChat, 'enterDelay'), transitionStartState: transitionStartStates.notRendered }, { children: (0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)('unstarted-wrapper', 'unstarted-wrapper--window', 'unstarted-wrapper--continue') }, { children: (0,jsx_runtime_.jsx)(event_text, { event: continueChatEvent }) })) })), (0,jsx_runtime_.jsx)(in_out_transition, Object.assign({ isActive: isOpen, transitionStartState: transitionStartStates.notRendered }, { children: (0,jsx_runtime_.jsx)(chat, { children: (0,jsx_runtime_.jsx)(chat_frame, { children: (0,jsx_runtime_.jsx)(conversation, {}) }) }) }))] }));
16185
+ return ((0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [(0,jsx_runtime_.jsx)(window_open_button, { onClick: openChat }), (0,jsx_runtime_.jsx)(in_out_transition, { isActive: preChat && !isOpen && !userHasResponded, exitAfter: getDelay(preChat, 'exitAfter'), enterDelay: getDelay(preChat, 'enterDelay'), transitionStartState: transitionStartStates.rendered, children: (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('unstarted-wrapper', 'unstarted-wrapper--window'), children: (0,jsx_runtime_.jsx)(PreChatMessages, {}) }) }), (0,jsx_runtime_.jsx)(in_out_transition, { isActive: continueChat && !isOpen && userHasResponded, exitAfter: getDelay(continueChat, 'exitAfter'), enterDelay: getDelay(continueChat, 'enterDelay'), transitionStartState: transitionStartStates.notRendered, children: (0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('unstarted-wrapper', 'unstarted-wrapper--window', 'unstarted-wrapper--continue'), children: (0,jsx_runtime_.jsx)(event_text, { event: continueChatEvent }) }) }), (0,jsx_runtime_.jsx)(in_out_transition, { isActive: isOpen, transitionStartState: transitionStartStates.notRendered, children: (0,jsx_runtime_.jsx)(chat, { children: (0,jsx_runtime_.jsx)(chat_frame, { children: (0,jsx_runtime_.jsx)(conversation, {}) }) }) })] }));
15806
16186
  };
15807
16187
  /* harmony default export */ const window_view = (WindowView);
15808
16188
 
@@ -16017,7 +16397,7 @@ const View = ({ children }) => {
16017
16397
  if (userHasResponded) {
16018
16398
  classNames.push('app--user-responded');
16019
16399
  }
16020
- return (isVisible && ((0,jsx_runtime_.jsx)("div", Object.assign({ className: (0,css/* className */.o)(classNames), lang: blockLang, tabIndex: -1, "data-nosnippet": true, style: { zIndex }, ref: containerElementRef }, { children: children || (0,jsx_runtime_.jsx)(ViewComponent, {}) }))));
16400
+ return (isVisible && ((0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)(classNames), lang: blockLang, tabIndex: -1, "data-nosnippet": true, style: { zIndex }, ref: containerElementRef, children: children || (0,jsx_runtime_.jsx)(ViewComponent, {}) })));
16021
16401
  };
16022
16402
  /* harmony default export */ const view = (View);
16023
16403