@seamly/web-ui 20.1.0 → 20.2.0-alpha.3

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 (67) hide show
  1. package/build/dist/lib/deprecated-view.css +1 -1
  2. package/build/dist/lib/index.debug.js +44 -44
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.js +593 -546
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/standalone.js +620 -573
  7. package/build/dist/lib/standalone.min.js +1 -1
  8. package/build/dist/lib/style-guide.js +6931 -6911
  9. package/build/dist/lib/style-guide.min.js +1 -1
  10. package/build/dist/lib/styles.css +1 -1
  11. package/package.json +2 -2
  12. package/src/javascripts/api/index.js +5 -4
  13. package/src/javascripts/domains/app/actions.js +11 -2
  14. package/src/javascripts/domains/config/reducer.js +2 -2
  15. package/src/javascripts/domains/forms/reducer.js +1 -1
  16. package/src/javascripts/domains/i18n/reducer.js +1 -1
  17. package/src/javascripts/domains/interrupt/reducer.js +1 -1
  18. package/src/javascripts/domains/translations/components/chat-status.js +1 -4
  19. package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
  20. package/src/javascripts/domains/translations/hooks.js +1 -5
  21. package/src/javascripts/domains/translations/middleware.js +2 -5
  22. package/src/javascripts/domains/translations/reducer.js +2 -2
  23. package/src/javascripts/domains/visibility/actions.js +1 -1
  24. package/src/javascripts/domains/visibility/utils.js +6 -0
  25. package/src/javascripts/lib/external-api/index.js +27 -1
  26. package/src/javascripts/style-guide/components/app.js +1 -1
  27. package/src/javascripts/style-guide/components/static-core.js +4 -1
  28. package/src/javascripts/ui/components/conversation/conversation.js +2 -2
  29. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +1 -1
  30. package/src/javascripts/ui/components/conversation/event/cta.js +1 -1
  31. package/src/javascripts/ui/components/conversation/event/image.js +1 -1
  32. package/src/javascripts/ui/components/conversation/event/participant.js +1 -1
  33. package/src/javascripts/ui/components/conversation/event/text.js +2 -2
  34. package/src/javascripts/ui/components/conversation/loader.js +1 -1
  35. package/src/javascripts/ui/components/conversation/message-container.js +1 -1
  36. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +1 -1
  37. package/src/javascripts/ui/components/core/seamly-core.js +2 -2
  38. package/src/javascripts/ui/components/core/seamly-file-upload.js +1 -1
  39. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +1 -1
  40. package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
  41. package/src/javascripts/ui/components/entry/entry-container.js +2 -2
  42. package/src/javascripts/ui/components/entry/text-entry/hooks.js +4 -1
  43. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +1 -1
  44. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  45. package/src/javascripts/ui/components/layout/agent-info.js +1 -1
  46. package/src/javascripts/ui/components/layout/header.js +1 -1
  47. package/src/javascripts/ui/components/options/options-button.js +1 -1
  48. package/src/javascripts/ui/components/options/options.js +1 -1
  49. package/src/javascripts/ui/components/options/transcript/index.js +1 -1
  50. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
  51. package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
  52. package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -2
  53. package/src/javascripts/ui/hooks/focus-helper-hooks.js +2 -2
  54. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +1 -1
  55. package/src/javascripts/ui/hooks/seamly-option-hooks.js +1 -1
  56. package/src/javascripts/ui/hooks/use-seamly-chat.js +2 -2
  57. package/src/javascripts/ui/hooks/use-seamly-commands.js +7 -7
  58. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +4 -4
  59. package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
  60. package/src/javascripts/ui/hooks/use-single-file-upload.js +1 -1
  61. package/src/stylesheets/5-components/_chat-status.scss +4 -0
  62. package/src/stylesheets/5-components/_message-translation-info.scss +4 -0
  63. package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -0
  64. package/src/stylesheets/7-deprecated/5-components/_suggestions.scss +3 -0
  65. package/src/stylesheets/deprecated-view.scss +1 -0
  66. package/webpack/config.package.js +7 -0
  67. package/src/.DS_Store +0 -0
@@ -16964,6 +16964,29 @@ const setLocale = i18n_utils_createThunk('setLocale', async (locale, {
16964
16964
  return api.getTranslations(locale);
16965
16965
  });
16966
16966
  });
16967
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
16968
+
16969
+ const {
16970
+ createActions: utils_createActions,
16971
+ createReducer: translations_utils_createReducer,
16972
+ selectState: translations_utils_selectState
16973
+ } = createDomain('translations');
16974
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
16975
+
16976
+ const [enable, disable] = utils_createActions('translate', {
16977
+ enable: locale => ({
16978
+ locale
16979
+ }),
16980
+ disable: () => ({})
16981
+ });
16982
+ const [enableEvent, disableEvent] = utils_createActions('event', {
16983
+ enable: payloadId => ({
16984
+ payloadId
16985
+ }),
16986
+ disable: payloadId => ({
16987
+ payloadId
16988
+ })
16989
+ });
16967
16990
  ;// CONCATENATED MODULE: ./src/javascripts/domains/app/utils.js
16968
16991
 
16969
16992
  const {
@@ -16977,6 +17000,49 @@ const {
16977
17000
 
16978
17001
  const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
16979
17002
 
17003
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
17004
+
17005
+
17006
+ const {
17007
+ createAction: visibility_utils_createAction,
17008
+ createActions: visibility_utils_createActions,
17009
+ createThunk: visibility_utils_createThunk,
17010
+ createReducer: visibility_utils_createReducer,
17011
+ selectState: visibility_utils_selectState
17012
+ } = createDomain('visibility');
17013
+ const calculateVisibility = ({
17014
+ hasResponded,
17015
+ previousVisibility,
17016
+ requestedVisibility,
17017
+ config
17018
+ }) => {
17019
+ const {
17020
+ defaults,
17021
+ layoutMode,
17022
+ hideOnNoUserResponse
17023
+ } = config;
17024
+ const {
17025
+ visible: defaultVisibility
17026
+ } = defaults || {}; // Requesting open should override the responded check.
17027
+
17028
+ if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17029
+ return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17030
+ } // Allow users to continue a conversation (if they have responded and no visibility is requested)
17031
+ // when switching from the window layout to the inline layout
17032
+
17033
+
17034
+ if (layoutMode === 'inline' && hasResponded && !requestedVisibility) {
17035
+ return previousVisibility || visibilityStates.open;
17036
+ }
17037
+
17038
+ const baseVisibility = visibilityStates.minimized;
17039
+ return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17040
+ };
17041
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17042
+
17043
+
17044
+ const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17045
+
16980
17046
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
16981
17047
 
16982
17048
 
@@ -17099,43 +17165,6 @@ const useSeamlyLayoutMode = () => {
17099
17165
  isResolving: !layoutMode
17100
17166
  };
17101
17167
  };
17102
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
17103
-
17104
-
17105
- const {
17106
- createAction: visibility_utils_createAction,
17107
- createActions: utils_createActions,
17108
- createThunk: visibility_utils_createThunk,
17109
- createReducer: visibility_utils_createReducer,
17110
- selectState: visibility_utils_selectState
17111
- } = createDomain('visibility');
17112
- const calculateVisibility = ({
17113
- hasResponded,
17114
- previousVisibility,
17115
- requestedVisibility,
17116
- config
17117
- }) => {
17118
- const {
17119
- defaults,
17120
- layoutMode,
17121
- hideOnNoUserResponse
17122
- } = config;
17123
- const {
17124
- visible: defaultVisibility
17125
- } = defaults || {}; // Requesting open should override the responded check.
17126
-
17127
- if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17128
- return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17129
- }
17130
-
17131
- const baseVisibility = visibilityStates.minimized;
17132
- return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17133
- };
17134
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17135
-
17136
-
17137
- const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17138
-
17139
17168
  ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
17140
17169
 
17141
17170
 
@@ -17314,6 +17343,8 @@ const clear = interrupt_utils_createAction('clear');
17314
17343
 
17315
17344
 
17316
17345
 
17346
+
17347
+
17317
17348
  const setHasResponded = app_utils_createAction('setHasResponded', hasResponded => ({
17318
17349
  hasResponded
17319
17350
  }));
@@ -17356,7 +17387,7 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17356
17387
 
17357
17388
  if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
17358
17389
  dispatch({
17359
- type: seamlyActions.SET_HEADER_TITLE,
17390
+ type: seamlyActions.SET_HEADER_SUB_TITLE,
17360
17391
  title: agentParticipant.name
17361
17392
  });
17362
17393
  }
@@ -17365,6 +17396,8 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17365
17396
  }
17366
17397
 
17367
17398
  try {
17399
+ var _config$context2;
17400
+
17368
17401
  if (api.hasConversation()) {
17369
17402
  var _initialState$transla;
17370
17403
 
@@ -17378,6 +17411,16 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17378
17411
  if ('userResponded' in initialState) {
17379
17412
  dispatch(setHasResponded(initialState.userResponded));
17380
17413
  }
17414
+ } else if (config !== null && config !== void 0 && (_config$context2 = config.context) !== null && _config$context2 !== void 0 && _config$context2.translationLocale) {
17415
+ locale = config.context.translationLocale;
17416
+ api.send('action', {
17417
+ type: actionTypes.setTranslation,
17418
+ body: {
17419
+ enabled: true,
17420
+ locale
17421
+ }
17422
+ });
17423
+ dispatch(enable(locale));
17381
17424
  }
17382
17425
  } catch (e) {
17383
17426
  if (e instanceof SeamlySessionExpiredError) {
@@ -18641,6 +18684,34 @@ const useFileUploads = () => {
18641
18684
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
18642
18685
  var trim = __webpack_require__(5843);
18643
18686
  var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
18687
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18688
+
18689
+
18690
+
18691
+ const useForceUpdate = () => {
18692
+ // This is an escape hatch mentioned in the React docs:
18693
+ // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18694
+
18695
+ /* eslint-disable-next-line no-unused-vars */
18696
+ const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18697
+ return hooks_module_A(() => {
18698
+ set_timeout_default()(() => {
18699
+ forceUpdate();
18700
+ });
18701
+ }, []);
18702
+ };
18703
+ const useGeneratedId = () => {
18704
+ const [id] = l(() => randomId());
18705
+ return id;
18706
+ };
18707
+ const useStableCallback = callback => {
18708
+ const callbackRef = hooks_module_s();
18709
+ callbackRef.current = callback;
18710
+ const isFunction = typeof callback === 'function';
18711
+ return hooks_module_d(() => {
18712
+ return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18713
+ }, [isFunction]);
18714
+ };
18644
18715
  ;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
18645
18716
 
18646
18717
 
@@ -18883,34 +18954,6 @@ const visibility_reducer_initialState = {
18883
18954
 
18884
18955
 
18885
18956
 
18886
- ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18887
-
18888
-
18889
-
18890
- const useForceUpdate = () => {
18891
- // This is an escape hatch mentioned in the React docs:
18892
- // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18893
-
18894
- /* eslint-disable-next-line no-unused-vars */
18895
- const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18896
- return hooks_module_A(() => {
18897
- set_timeout_default()(() => {
18898
- forceUpdate();
18899
- });
18900
- }, []);
18901
- };
18902
- const useGeneratedId = () => {
18903
- const [id] = l(() => randomId());
18904
- return id;
18905
- };
18906
- const useStableCallback = callback => {
18907
- const callbackRef = hooks_module_s();
18908
- callbackRef.current = callback;
18909
- const isFunction = typeof callback === 'function';
18910
- return hooks_module_d(() => {
18911
- return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18912
- }, [isFunction]);
18913
- };
18914
18957
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
18915
18958
 
18916
18959
 
@@ -19742,29 +19785,6 @@ const app_reducer_initialState = {
19742
19785
 
19743
19786
 
19744
19787
 
19745
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
19746
-
19747
- const {
19748
- createActions: translations_utils_createActions,
19749
- createReducer: translations_utils_createReducer,
19750
- selectState: translations_utils_selectState
19751
- } = createDomain('translations');
19752
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
19753
-
19754
- const [enable, disable] = translations_utils_createActions('translate', {
19755
- enable: locale => ({
19756
- locale
19757
- }),
19758
- disable: () => ({})
19759
- });
19760
- const [enableEvent, disableEvent] = translations_utils_createActions('event', {
19761
- enable: payloadId => ({
19762
- payloadId
19763
- }),
19764
- disable: payloadId => ({
19765
- payloadId
19766
- })
19767
- });
19768
19788
  ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/utils.js
19769
19789
 
19770
19790
 
@@ -20754,7 +20774,7 @@ function updateFormControl(state, formId, name, controlState) {
20754
20774
 
20755
20775
 
20756
20776
 
20757
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
20777
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20758
20778
 
20759
20779
 
20760
20780
 
@@ -20765,227 +20785,32 @@ function updateFormControl(state, formId, name, controlState) {
20765
20785
 
20766
20786
 
20767
20787
 
20788
+ const form_excluded = ["className", "disableValidationClasses"];
20768
20789
 
20790
+ function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20769
20791
 
20792
+ function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20770
20793
 
20771
- function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20772
20794
 
20773
- function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
20774
20795
 
20775
- const formActions = {
20776
- REGISTER_FORM: 'REGISTER_FORM',
20777
- DE_REGISTER_FORM: 'DE_REGISTER_FORM',
20778
- REGISTER: 'REGISTER',
20779
- DE_REGISTER: 'DEREGISTER',
20780
- SET_VALUE: 'SET_VALUE',
20781
- SET_VALIDITY: 'SET_VALIDITY',
20782
- SET_STATE: 'SET_STATE',
20783
- SET_SUBMITTED: 'SET_SUBMITTED',
20784
- SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
20785
- };
20786
- const {
20787
- REGISTER_FORM,
20788
- DE_REGISTER_FORM,
20789
- REGISTER,
20790
- DE_REGISTER,
20791
- SET_VALUE,
20792
- SET_VALIDITY,
20793
- SET_STATE,
20794
- SET_SUBMITTED,
20795
- SET_PERSIST_FORM_DATA
20796
- } = formActions;
20797
- const getValidator = (fn, errorText, compareValue = null) => ({
20798
- fn,
20799
- errorText,
20800
- compareValue
20801
- });
20802
- const formReducer = (state, action) => {
20803
- var _context, _context2, _context3;
20804
20796
 
20805
- const {
20806
- formId,
20807
- name,
20808
- controlId,
20809
- value,
20810
- data,
20811
- validity,
20812
- errorText,
20813
- hasSubmitted,
20814
- persistData
20815
- } = action;
20816
20797
 
20817
- const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20818
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20819
- controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
20820
- })
20821
- });
20798
+ function Form(_ref) {
20799
+ let {
20800
+ className: givenClassName,
20801
+ disableValidationClasses
20802
+ } = _ref,
20803
+ props = _objectWithoutProperties(_ref, form_excluded);
20822
20804
 
20823
- switch (action.type) {
20824
- case REGISTER_FORM:
20825
- return form_utils_objectSpread({
20826
- [formId]: {
20827
- controls: {},
20828
- validity: true,
20829
- hasSubmitted: false,
20830
- persistData: false
20831
- }
20832
- }, state);
20805
+ const {
20806
+ handleSubmit,
20807
+ isValid,
20808
+ isSubmitted
20809
+ } = useForm();
20810
+ const formClasses = ['form'];
20833
20811
 
20834
- case DE_REGISTER_FORM:
20835
- const removedFormState = form_utils_objectSpread({}, state);
20836
-
20837
- delete removedFormState[formId];
20838
- return removedFormState;
20839
-
20840
- case REGISTER:
20841
- const {
20842
- value: existingValue,
20843
- validity: existingValidity,
20844
- errorText: existingErrorText
20845
- } = state[formId].controls[name] || {};
20846
- return setControls({
20847
- [name]: {
20848
- controlId,
20849
- value: existingValue || value,
20850
- validity: existingValidity !== false,
20851
- errorText: existingErrorText || ''
20852
- }
20853
- });
20854
-
20855
- case DE_REGISTER:
20856
- const relatedForm = state[formId];
20857
-
20858
- if (!relatedForm) {
20859
- return state;
20860
- }
20861
-
20862
- const newControls = form_utils_objectSpread({}, relatedForm.controls);
20863
-
20864
- delete newControls[action.name];
20865
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20866
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
20867
- controls: newControls
20868
- })
20869
- });
20870
-
20871
- case SET_VALUE:
20872
- return setControls({
20873
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20874
- value
20875
- })
20876
- });
20877
-
20878
- case SET_VALIDITY:
20879
- const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
20880
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20881
- validity,
20882
- errorText
20883
- })
20884
- });
20885
-
20886
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20887
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20888
- controls: newControlValidities,
20889
- validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
20890
- })
20891
- });
20892
-
20893
- case SET_STATE:
20894
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20895
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20896
- controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
20897
- return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
20898
- [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
20899
- value: data[key],
20900
- validity: true,
20901
- errorText: ''
20902
- })
20903
- });
20904
- }, form_utils_objectSpread({}, state.controls))
20905
- })
20906
- });
20907
-
20908
- case SET_SUBMITTED:
20909
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20910
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20911
- hasSubmitted
20912
- })
20913
- });
20914
-
20915
- case SET_PERSIST_FORM_DATA:
20916
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20917
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20918
- persistData
20919
- })
20920
- });
20921
-
20922
- default:
20923
- return state;
20924
- }
20925
- };
20926
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
20927
-
20928
- const validateFileSize = (fileList, maxSize) => {
20929
- let isValid = true;
20930
-
20931
- for (let i = 0; i < fileList.length; i++) {
20932
- if (fileList[i].size > maxSize) {
20933
- isValid = false;
20934
- }
20935
- }
20936
-
20937
- return isValid;
20938
- };
20939
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
20940
- /* eslint-disable no-control-regex */
20941
-
20942
- const isEmailString = val => {
20943
- const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
20944
-
20945
- const trimmedVal = val && trim_default()(val).call(val);
20946
-
20947
- return !!(trimmedVal && trimmedVal.match(regex));
20948
- };
20949
- /* eslint-enable no-control-regex */
20950
-
20951
- const isNotEmptyString = val => !!val;
20952
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20953
-
20954
-
20955
-
20956
-
20957
-
20958
-
20959
-
20960
-
20961
-
20962
-
20963
- const form_excluded = ["className", "disableValidationClasses"];
20964
-
20965
- function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20966
-
20967
- function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20968
-
20969
-
20970
-
20971
-
20972
-
20973
- function Form(_ref) {
20974
- let {
20975
- className: givenClassName,
20976
- disableValidationClasses
20977
- } = _ref,
20978
- props = _objectWithoutProperties(_ref, form_excluded);
20979
-
20980
- const {
20981
- handleSubmit,
20982
- isValid,
20983
- isSubmitted
20984
- } = useForm();
20985
- const formClasses = ['form'];
20986
-
20987
- if (!disableValidationClasses && isSubmitted) {
20988
- formClasses.push('form--submitted');
20812
+ if (!disableValidationClasses && isSubmitted) {
20813
+ formClasses.push('form--submitted');
20989
20814
 
20990
20815
  if (isValid) {
20991
20816
  formClasses.push('form--valid');
@@ -21175,54 +21000,249 @@ function TranslationsOptionsDialogForm({
21175
21000
  const languageName = hooks_module_d(() => {
21176
21001
  var _languages$find;
21177
21002
 
21178
- return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
21179
- }, [languages, currentLocale]);
21180
- const options = hooks_module_d(() => {
21181
- var _context;
21003
+ return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
21004
+ }, [languages, currentLocale]);
21005
+ const options = hooks_module_d(() => {
21006
+ var _context;
21007
+
21008
+ return [{
21009
+ value: '',
21010
+ label: t('translations.settings.defaultOptionLabel')
21011
+ }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
21012
+ value: language.locale,
21013
+ label: language.nativeName
21014
+ }))];
21015
+ }, [t, languages, uiLocale]);
21016
+ return jsxRuntime_module_e(form_controls_form, {
21017
+ noValidate: "true",
21018
+ className: css_className('options__form'),
21019
+ children: [jsxRuntime_module_e("p", {
21020
+ className: css_className('options__description'),
21021
+ id: descriptionId,
21022
+ children: t('translations.settings.description')
21023
+ }), isActive ? jsxRuntime_module_e(d, {
21024
+ children: [jsxRuntime_module_e("h3", {
21025
+ children: t('translations.settings.currentTranslationLabel')
21026
+ }), jsxRuntime_module_e("p", {
21027
+ className: css_className('options__active-language'),
21028
+ children: languageName
21029
+ })]
21030
+ }) : jsxRuntime_module_e(form_controls_select, {
21031
+ name: controlName,
21032
+ type: "text",
21033
+ className: css_className('input__select'),
21034
+ "aria-describedby": descriptionId,
21035
+ labelClass: css_className('label'),
21036
+ labelText: t('translations.settings.inputLabel'),
21037
+ options: options,
21038
+ defaultValue: currentLocale || ''
21039
+ }), jsxRuntime_module_e("div", {
21040
+ className: css_className('options__actions'),
21041
+ children: jsxRuntime_module_e("button", {
21042
+ type: "submit",
21043
+ className: css_className('button', 'button--primary', 'options__submit'),
21044
+ children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21045
+ })
21046
+ })]
21047
+ });
21048
+ }
21049
+
21050
+ /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21051
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
21052
+
21053
+
21054
+
21055
+
21056
+
21057
+
21058
+
21059
+
21060
+
21061
+
21062
+
21063
+
21064
+
21065
+ function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21066
+
21067
+ function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
21068
+
21069
+ const formActions = {
21070
+ REGISTER_FORM: 'REGISTER_FORM',
21071
+ DE_REGISTER_FORM: 'DE_REGISTER_FORM',
21072
+ REGISTER: 'REGISTER',
21073
+ DE_REGISTER: 'DEREGISTER',
21074
+ SET_VALUE: 'SET_VALUE',
21075
+ SET_VALIDITY: 'SET_VALIDITY',
21076
+ SET_STATE: 'SET_STATE',
21077
+ SET_SUBMITTED: 'SET_SUBMITTED',
21078
+ SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
21079
+ };
21080
+ const {
21081
+ REGISTER_FORM,
21082
+ DE_REGISTER_FORM,
21083
+ REGISTER,
21084
+ DE_REGISTER,
21085
+ SET_VALUE,
21086
+ SET_VALIDITY,
21087
+ SET_STATE,
21088
+ SET_SUBMITTED,
21089
+ SET_PERSIST_FORM_DATA
21090
+ } = formActions;
21091
+ const getValidator = (fn, errorText, compareValue = null) => ({
21092
+ fn,
21093
+ errorText,
21094
+ compareValue
21095
+ });
21096
+ const formReducer = (state, action) => {
21097
+ var _context, _context2, _context3;
21098
+
21099
+ const {
21100
+ formId,
21101
+ name,
21102
+ controlId,
21103
+ value,
21104
+ data,
21105
+ validity,
21106
+ errorText,
21107
+ hasSubmitted,
21108
+ persistData
21109
+ } = action;
21110
+
21111
+ const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21112
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21113
+ controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
21114
+ })
21115
+ });
21116
+
21117
+ switch (action.type) {
21118
+ case REGISTER_FORM:
21119
+ return form_utils_objectSpread({
21120
+ [formId]: {
21121
+ controls: {},
21122
+ validity: true,
21123
+ hasSubmitted: false,
21124
+ persistData: false
21125
+ }
21126
+ }, state);
21127
+
21128
+ case DE_REGISTER_FORM:
21129
+ const removedFormState = form_utils_objectSpread({}, state);
21130
+
21131
+ delete removedFormState[formId];
21132
+ return removedFormState;
21133
+
21134
+ case REGISTER:
21135
+ const {
21136
+ value: existingValue,
21137
+ validity: existingValidity,
21138
+ errorText: existingErrorText
21139
+ } = state[formId].controls[name] || {};
21140
+ return setControls({
21141
+ [name]: {
21142
+ controlId,
21143
+ value: existingValue || value,
21144
+ validity: existingValidity !== false,
21145
+ errorText: existingErrorText || ''
21146
+ }
21147
+ });
21148
+
21149
+ case DE_REGISTER:
21150
+ const relatedForm = state[formId];
21151
+
21152
+ if (!relatedForm) {
21153
+ return state;
21154
+ }
21155
+
21156
+ const newControls = form_utils_objectSpread({}, relatedForm.controls);
21157
+
21158
+ delete newControls[action.name];
21159
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21160
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
21161
+ controls: newControls
21162
+ })
21163
+ });
21164
+
21165
+ case SET_VALUE:
21166
+ return setControls({
21167
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21168
+ value
21169
+ })
21170
+ });
21171
+
21172
+ case SET_VALIDITY:
21173
+ const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
21174
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21175
+ validity,
21176
+ errorText
21177
+ })
21178
+ });
21179
+
21180
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21181
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21182
+ controls: newControlValidities,
21183
+ validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
21184
+ })
21185
+ });
21186
+
21187
+ case SET_STATE:
21188
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21189
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21190
+ controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
21191
+ return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
21192
+ [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
21193
+ value: data[key],
21194
+ validity: true,
21195
+ errorText: ''
21196
+ })
21197
+ });
21198
+ }, form_utils_objectSpread({}, state.controls))
21199
+ })
21200
+ });
21201
+
21202
+ case SET_SUBMITTED:
21203
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21204
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21205
+ hasSubmitted
21206
+ })
21207
+ });
21208
+
21209
+ case SET_PERSIST_FORM_DATA:
21210
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21211
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21212
+ persistData
21213
+ })
21214
+ });
21215
+
21216
+ default:
21217
+ return state;
21218
+ }
21219
+ };
21220
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
21221
+
21222
+ const validateFileSize = (fileList, maxSize) => {
21223
+ let isValid = true;
21224
+
21225
+ for (let i = 0; i < fileList.length; i++) {
21226
+ if (fileList[i].size > maxSize) {
21227
+ isValid = false;
21228
+ }
21229
+ }
21230
+
21231
+ return isValid;
21232
+ };
21233
+ const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
21234
+ /* eslint-disable no-control-regex */
21182
21235
 
21183
- return [{
21184
- value: '',
21185
- label: t('translations.settings.defaultOptionLabel')
21186
- }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
21187
- value: language.locale,
21188
- label: language.nativeName
21189
- }))];
21190
- }, [t, languages, uiLocale]);
21191
- return jsxRuntime_module_e(form_controls_form, {
21192
- noValidate: "true",
21193
- className: css_className('options__form'),
21194
- children: [jsxRuntime_module_e("p", {
21195
- className: css_className('options__description'),
21196
- id: descriptionId,
21197
- children: t('translations.settings.description')
21198
- }), isActive ? jsxRuntime_module_e(d, {
21199
- children: [jsxRuntime_module_e("h3", {
21200
- children: t('translations.settings.currentTranslationLabel')
21201
- }), jsxRuntime_module_e("p", {
21202
- className: css_className('options__active-language'),
21203
- children: languageName
21204
- })]
21205
- }) : jsxRuntime_module_e(form_controls_select, {
21206
- name: controlName,
21207
- type: "text",
21208
- className: css_className('input__select'),
21209
- "aria-describedby": descriptionId,
21210
- labelClass: css_className('label'),
21211
- labelText: t('translations.settings.inputLabel'),
21212
- options: options,
21213
- defaultValue: currentLocale || ''
21214
- }), jsxRuntime_module_e("div", {
21215
- className: css_className('options__actions'),
21216
- children: jsxRuntime_module_e("button", {
21217
- type: "submit",
21218
- className: css_className('button', 'button--primary', 'options__submit'),
21219
- children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21220
- })
21221
- })]
21222
- });
21223
- }
21236
+ const isEmailString = val => {
21237
+ const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
21224
21238
 
21225
- /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21239
+ const trimmedVal = val && trim_default()(val).call(val);
21240
+
21241
+ return !!(trimmedVal && trimmedVal.match(regex));
21242
+ };
21243
+ /* eslint-enable no-control-regex */
21244
+
21245
+ const isNotEmptyString = val => !!val;
21226
21246
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
21227
21247
 
21228
21248
 
@@ -21854,36 +21874,6 @@ const Interrupt = ({
21854
21874
  };
21855
21875
 
21856
21876
  /* harmony default export */ var interrupt = (Interrupt);
21857
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
21858
-
21859
-
21860
-
21861
-
21862
-
21863
-
21864
- const PrivacyDisclaimer = () => {
21865
- const {
21866
- t
21867
- } = useI18n();
21868
- const {
21869
- showDisclaimer
21870
- } = useConfig();
21871
- return showDisclaimer && jsxRuntime_module_e("div", {
21872
- className: css_className('disclaimer'),
21873
- tabIndex: "0",
21874
- children: [jsxRuntime_module_e("h2", {
21875
- className: css_className('disclaimer__title'),
21876
- children: t('disclaimer.title')
21877
- }), jsxRuntime_module_e("div", {
21878
- className: css_className('disclaimer__message'),
21879
- dangerouslySetInnerHTML: {
21880
- __html: t('disclaimer.content')
21881
- }
21882
- })]
21883
- });
21884
- };
21885
-
21886
- /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
21887
21877
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
21888
21878
 
21889
21879
  const ComponentContext = D({});
@@ -27584,7 +27574,7 @@ const Participant = ({
27584
27574
  const avatar = participant.avatar || (agent === null || agent === void 0 ? void 0 : agent.avatar);
27585
27575
  return jsxRuntime_module_e(EventDivider, {
27586
27576
  graphicSrc: avatar,
27587
- graphicType: participant.avatar ? 'avatar' : undefined,
27577
+ graphicType: avatar ? 'avatar' : undefined,
27588
27578
  iconName: !avatar ? 'balloon' : undefined,
27589
27579
  childrenHTML: intro,
27590
27580
  dividerType: "participant"
@@ -27781,6 +27771,95 @@ const Cta = ({
27781
27771
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js
27782
27772
  var fill = __webpack_require__(4494);
27783
27773
  var fill_default = /*#__PURE__*/__webpack_require__.n(fill);
27774
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27775
+
27776
+
27777
+
27778
+
27779
+ function CarouselPagination({
27780
+ items,
27781
+ currentIndex,
27782
+ onChange,
27783
+ getItemKey,
27784
+ getItemLabel
27785
+ }) {
27786
+ const itemCount = items.length;
27787
+ const handlePaginate = hooks_module_A(event => {
27788
+ const slideIndex = Number(event.target.dataset.item || '0');
27789
+ const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27790
+
27791
+ if (nextIndex !== currentIndex) {
27792
+ onChange(nextIndex);
27793
+ }
27794
+ }, [itemCount, currentIndex, onChange]);
27795
+ return jsxRuntime_module_e("div", {
27796
+ className: css_className('carousel-pagination__wrapper'),
27797
+ role: "group",
27798
+ children: jsxRuntime_module_e("ul", {
27799
+ className: css_className('carousel-pagination'),
27800
+ children: map_default()(items).call(items, (item, idx) => {
27801
+ const isActive = currentIndex === idx;
27802
+ return jsxRuntime_module_e("li", {
27803
+ className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27804
+ children: jsxRuntime_module_e("button", {
27805
+ className: css_className('carousel-pagination__button'),
27806
+ type: "button",
27807
+ onClick: handlePaginate,
27808
+ "data-item": idx,
27809
+ "aria-disabled": isActive ? 'true' : undefined,
27810
+ "aria-label": getItemLabel(item, idx)
27811
+ })
27812
+ }, getItemKey(item, idx, 'pagination-item-'));
27813
+ })
27814
+ })
27815
+ });
27816
+ }
27817
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27818
+
27819
+
27820
+
27821
+
27822
+
27823
+ function CarouselControls({
27824
+ items,
27825
+ currentIndex,
27826
+ onChange,
27827
+ children
27828
+ }) {
27829
+ const {
27830
+ t
27831
+ } = useI18n();
27832
+ const itemCount = items.length;
27833
+
27834
+ const handlePrevious = () => {
27835
+ onChange((currentIndex - 1 + itemCount) % itemCount);
27836
+ };
27837
+
27838
+ const handleNext = () => {
27839
+ onChange((currentIndex + 1) % itemCount);
27840
+ };
27841
+
27842
+ return jsxRuntime_module_e("div", {
27843
+ className: css_className('carousel-controls'),
27844
+ children: [jsxRuntime_module_e("button", {
27845
+ className: css_className('button', 'button--previous'),
27846
+ "aria-label": t('carousel.controls.previous'),
27847
+ onClick: handlePrevious,
27848
+ children: jsxRuntime_module_e(icon, {
27849
+ name: "arrowLeft",
27850
+ size: "16"
27851
+ })
27852
+ }), children, jsxRuntime_module_e("button", {
27853
+ className: css_className('button', 'button--next'),
27854
+ "aria-label": t('carousel.controls.next'),
27855
+ onClick: handleNext,
27856
+ children: jsxRuntime_module_e(icon, {
27857
+ name: "arrowRight",
27858
+ size: "16"
27859
+ })
27860
+ })]
27861
+ });
27862
+ }
27784
27863
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
27785
27864
 
27786
27865
 
@@ -27913,124 +27992,35 @@ const CardComponent = ({
27913
27992
 
27914
27993
 
27915
27994
 
27916
- function slide_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27917
-
27918
- function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = slide_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = slide_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
27919
-
27920
-
27921
-
27922
-
27923
-
27924
- function CarouselMessageSlide({
27925
- item: slide,
27926
- items,
27927
- index,
27928
- isActive
27929
- }) {
27930
- const {
27931
- t
27932
- } = useI18n();
27933
- return jsxRuntime_module_e("div", {
27934
- className: css_className('carousel-item', `carousel-item--${slide.type}`),
27935
- role: "group",
27936
- "aria-roledescription": "slide",
27937
- "aria-label": t('carousel.slide.label', {
27938
- index: index + 1,
27939
- total: items.length
27940
- }),
27941
- children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
27942
- isCarouselItem: true,
27943
- hasFocus: isActive
27944
- }))
27945
- });
27946
- }
27947
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27948
-
27949
-
27950
-
27951
-
27952
- function CarouselPagination({
27953
- items,
27954
- currentIndex,
27955
- onChange,
27956
- getItemKey,
27957
- getItemLabel
27958
- }) {
27959
- const itemCount = items.length;
27960
- const handlePaginate = hooks_module_A(event => {
27961
- const slideIndex = Number(event.target.dataset.item || '0');
27962
- const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27963
-
27964
- if (nextIndex !== currentIndex) {
27965
- onChange(nextIndex);
27966
- }
27967
- }, [itemCount, currentIndex, onChange]);
27968
- return jsxRuntime_module_e("div", {
27969
- className: css_className('carousel-pagination__wrapper'),
27970
- role: "group",
27971
- children: jsxRuntime_module_e("ul", {
27972
- className: css_className('carousel-pagination'),
27973
- children: map_default()(items).call(items, (item, idx) => {
27974
- const isActive = currentIndex === idx;
27975
- return jsxRuntime_module_e("li", {
27976
- className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27977
- children: jsxRuntime_module_e("button", {
27978
- className: css_className('carousel-pagination__button'),
27979
- type: "button",
27980
- onClick: handlePaginate,
27981
- "data-item": idx,
27982
- "aria-disabled": isActive ? 'true' : undefined,
27983
- "aria-label": getItemLabel(item, idx)
27984
- })
27985
- }, getItemKey(item, idx, 'pagination-item-'));
27986
- })
27987
- })
27988
- });
27989
- }
27990
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27991
-
27995
+ function slide_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27996
+
27997
+ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = slide_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = slide_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
27992
27998
 
27993
27999
 
27994
28000
 
27995
28001
 
27996
- function CarouselControls({
28002
+
28003
+ function CarouselMessageSlide({
28004
+ item: slide,
27997
28005
  items,
27998
- currentIndex,
27999
- onChange,
28000
- children
28006
+ index,
28007
+ isActive
28001
28008
  }) {
28002
28009
  const {
28003
28010
  t
28004
28011
  } = useI18n();
28005
- const itemCount = items.length;
28006
-
28007
- const handlePrevious = () => {
28008
- onChange((currentIndex - 1 + itemCount) % itemCount);
28009
- };
28010
-
28011
- const handleNext = () => {
28012
- onChange((currentIndex + 1) % itemCount);
28013
- };
28014
-
28015
28012
  return jsxRuntime_module_e("div", {
28016
- className: css_className('carousel-controls'),
28017
- children: [jsxRuntime_module_e("button", {
28018
- className: css_className('button', 'button--previous'),
28019
- "aria-label": t('carousel.controls.previous'),
28020
- onClick: handlePrevious,
28021
- children: jsxRuntime_module_e(icon, {
28022
- name: "arrowLeft",
28023
- size: "16"
28024
- })
28025
- }), children, jsxRuntime_module_e("button", {
28026
- className: css_className('button', 'button--next'),
28027
- "aria-label": t('carousel.controls.next'),
28028
- onClick: handleNext,
28029
- children: jsxRuntime_module_e(icon, {
28030
- name: "arrowRight",
28031
- size: "16"
28032
- })
28033
- })]
28013
+ className: css_className('carousel-item', `carousel-item--${slide.type}`),
28014
+ role: "group",
28015
+ "aria-roledescription": "slide",
28016
+ "aria-label": t('carousel.slide.label', {
28017
+ index: index + 1,
28018
+ total: items.length
28019
+ }),
28020
+ children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
28021
+ isCarouselItem: true,
28022
+ hasFocus: isActive
28023
+ }))
28034
28024
  });
28035
28025
  }
28036
28026
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
@@ -28401,6 +28391,36 @@ const ComponentFilter = ({
28401
28391
  };
28402
28392
 
28403
28393
  /* harmony default export */ var component_filter = (ComponentFilter);
28394
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
28395
+
28396
+
28397
+
28398
+
28399
+
28400
+
28401
+ const PrivacyDisclaimer = () => {
28402
+ const {
28403
+ t
28404
+ } = useI18n();
28405
+ const {
28406
+ showDisclaimer
28407
+ } = useConfig();
28408
+ return showDisclaimer && jsxRuntime_module_e("div", {
28409
+ className: css_className('disclaimer'),
28410
+ tabIndex: "0",
28411
+ children: [jsxRuntime_module_e("h2", {
28412
+ className: css_className('disclaimer__title'),
28413
+ children: t('disclaimer.title')
28414
+ }), jsxRuntime_module_e("div", {
28415
+ className: css_className('disclaimer__message'),
28416
+ dangerouslySetInnerHTML: {
28417
+ __html: t('disclaimer.content')
28418
+ }
28419
+ })]
28420
+ });
28421
+ };
28422
+
28423
+ /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
28404
28424
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
28405
28425
 
28406
28426
 
@@ -30407,53 +30427,6 @@ const View = () => {
30407
30427
  };
30408
30428
 
30409
30429
  /* harmony default export */ var view = (View);
30410
- ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
30411
-
30412
-
30413
- const {
30414
- createAction: errors_createAction
30415
- } = createDomain('errors');
30416
- const catchError = errors_createAction('catch-error', error => ({
30417
- error
30418
- }));
30419
- function errors_createMiddleware({
30420
- api: seamlyApi
30421
- }) {
30422
- return ({
30423
- getState
30424
- }) => {
30425
- const handleError = action => {
30426
- const {
30427
- errorCallback,
30428
- namespace,
30429
- api,
30430
- layoutMode
30431
- } = selectConfig(getState());
30432
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
30433
- namespace,
30434
- api,
30435
- layoutMode,
30436
- conversationUrl: seamlyApi.getConversationUrl(),
30437
- action: action.type ? action : undefined
30438
- });
30439
- };
30440
-
30441
- return next => action => {
30442
- try {
30443
- if (action.error) {
30444
- handleError(action);
30445
- }
30446
-
30447
- return next(action);
30448
- } catch (error) {
30449
- handleError({
30450
- error
30451
- });
30452
- throw error;
30453
- }
30454
- };
30455
- };
30456
- }
30457
30430
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
30458
30431
 
30459
30432
 
@@ -31345,6 +31318,53 @@ const SeamlyFileUpload = ({
31345
31318
  };
31346
31319
 
31347
31320
  /* harmony default export */ var seamly_file_upload = (SeamlyFileUpload);
31321
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
31322
+
31323
+
31324
+ const {
31325
+ createAction: errors_createAction
31326
+ } = createDomain('errors');
31327
+ const catchError = errors_createAction('catch-error', error => ({
31328
+ error
31329
+ }));
31330
+ function errors_createMiddleware({
31331
+ api: seamlyApi
31332
+ }) {
31333
+ return ({
31334
+ getState
31335
+ }) => {
31336
+ const handleError = action => {
31337
+ const {
31338
+ errorCallback,
31339
+ namespace,
31340
+ api,
31341
+ layoutMode
31342
+ } = selectConfig(getState());
31343
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
31344
+ namespace,
31345
+ api,
31346
+ layoutMode,
31347
+ conversationUrl: seamlyApi.getConversationUrl(),
31348
+ action: action.type ? action : undefined
31349
+ });
31350
+ };
31351
+
31352
+ return next => action => {
31353
+ try {
31354
+ if (action.error) {
31355
+ handleError(action);
31356
+ }
31357
+
31358
+ return next(action);
31359
+ } catch (error) {
31360
+ handleError({
31361
+ error
31362
+ });
31363
+ throw error;
31364
+ }
31365
+ };
31366
+ };
31367
+ }
31348
31368
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
31349
31369
 
31350
31370
 
@@ -31457,43 +31477,11 @@ function objectStore(key, storageProvider) {
31457
31477
 
31458
31478
  };
31459
31479
  }
31480
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31481
+ var get_own_property_names = __webpack_require__(8604);
31460
31482
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js
31461
31483
  var stringify = __webpack_require__(9340);
31462
31484
  var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
31463
- ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
31464
-
31465
-
31466
- function store(key) {
31467
- const KEY = 'cvco.' + key;
31468
- return {
31469
- get() {
31470
- var _context;
31471
-
31472
- const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
31473
- let val;
31474
-
31475
- do {
31476
- val = sessionStorage.getItem(candidates[0]);
31477
- } while (candidates.shift() && !val);
31478
-
31479
- return JSON.parse(val);
31480
- },
31481
-
31482
- set(value) {
31483
- if (!value) {
31484
- return;
31485
- }
31486
-
31487
- sessionStorage.setItem(KEY, stringify_default()(value));
31488
- }
31489
-
31490
- };
31491
- }
31492
- // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
31493
- var debug = __webpack_require__(1905);
31494
- var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
31495
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31496
- var get_own_property_names = __webpack_require__(8604);
31497
31485
  ;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
31498
31486
 
31499
31487
 
@@ -32995,6 +32983,9 @@ const splitUrlParams = url => {
32995
32983
  };
32996
32984
 
32997
32985
  /* harmony default export */ var split_url_params = (splitUrlParams);
32986
+ // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
32987
+ var debug = __webpack_require__(1905);
32988
+ var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
32998
32989
  ;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
32999
32990
 
33000
32991
 
@@ -33166,6 +33157,35 @@ class ConversationProducer {
33166
33157
  }
33167
33158
 
33168
33159
  }
33160
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
33161
+
33162
+
33163
+ function store(key) {
33164
+ const KEY = 'cvco.' + key;
33165
+ return {
33166
+ get() {
33167
+ var _context;
33168
+
33169
+ const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
33170
+ let val;
33171
+
33172
+ do {
33173
+ val = sessionStorage.getItem(candidates[0]);
33174
+ } while (candidates.shift() && !val);
33175
+
33176
+ return JSON.parse(val);
33177
+ },
33178
+
33179
+ set(value) {
33180
+ if (!value) {
33181
+ return;
33182
+ }
33183
+
33184
+ sessionStorage.setItem(KEY, stringify_default()(value));
33185
+ }
33186
+
33187
+ };
33188
+ }
33169
33189
  ;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
33170
33190
  class EventProducer {
33171
33191
  constructor(name) {
@@ -33288,10 +33308,11 @@ class API {
33288
33308
  * @param {boolean} config.sendEnvironment
33289
33309
  * @param {string} layoutMode
33290
33310
  * @param {string} namespace
33291
- * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
33311
+ * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined, translationLocale: undefined }]
33292
33312
  * @param {string} context.channelName
33293
33313
  * @param {object} context.variables
33294
33314
  * @param {string} context.locale
33315
+ * @param {string} context.translationLocale
33295
33316
  * @memberof API
33296
33317
  */
33297
33318
  constructor({
@@ -33664,9 +33685,9 @@ class API {
33664
33685
 
33665
33686
  getEnvironment() {
33666
33687
  return {
33667
- clientName: PACKAGE_NAME,
33688
+ clientName: "@seamly/web-ui",
33668
33689
  clientVariant: this.layoutMode,
33669
- clientVersion: PACKAGE_VERSION,
33690
+ clientVersion: "20.2.0-alpha.3",
33670
33691
  currentUrl: window.location.toString(),
33671
33692
  screenResolution: `${window.screen.width}x${window.screen.height}`,
33672
33693
  timezone: getTimeZone(),
@@ -34012,6 +34033,7 @@ class ExternalApi {
34012
34033
  this._waitingActions = [];
34013
34034
  this._instances = {};
34014
34035
  this.appConfig = appConfig;
34036
+ this.context = {};
34015
34037
  }
34016
34038
 
34017
34039
  push(...actionObjects) {
@@ -34042,7 +34064,8 @@ class ExternalApi {
34042
34064
  break;
34043
34065
 
34044
34066
  default:
34045
- if (!this.handleAction(actionObj)) {
34067
+ if (!this.handleAction(actionObj) && // Store context properties for the next instance that will be created
34068
+ !this.setContext(actionObj.action, ...actionObj.args)) {
34046
34069
  this._waitingActions.push(actionObj);
34047
34070
  }
34048
34071
 
@@ -34051,6 +34074,25 @@ class ExternalApi {
34051
34074
  });
34052
34075
  }
34053
34076
 
34077
+ setContext(action, args) {
34078
+ switch (action) {
34079
+ case 'setTranslation':
34080
+ const {
34081
+ enabled,
34082
+ locale
34083
+ } = args;
34084
+
34085
+ if (!!enabled && locale) {
34086
+ this.context.translationLocale = locale;
34087
+ }
34088
+
34089
+ return true;
34090
+
34091
+ default:
34092
+ return false;
34093
+ }
34094
+ }
34095
+
34054
34096
  handleInit(actionObj) {
34055
34097
  const userConfig = this.getUserConfig(...actionObj.args);
34056
34098
  const config = this.getCombinedConfig(userConfig); // if this.appConfig is a function, it might return an invalid configuration (false, null, undefined)
@@ -34074,7 +34116,9 @@ class ExternalApi {
34074
34116
 
34075
34117
  if (config) {
34076
34118
  const instance = this.createInstance(config);
34077
- this._instances[config.namespace] = instance;
34119
+ this._instances[config.namespace] = instance; // Clear the context after creating the instance, so we do not reuse it for the next
34120
+
34121
+ this.context = {};
34078
34122
  instance.render();
34079
34123
  }
34080
34124
  }
@@ -34142,10 +34186,13 @@ class ExternalApi {
34142
34186
  return this.appConfig(userConfig);
34143
34187
  }
34144
34188
 
34189
+ const context = external_api_objectSpread(external_api_objectSpread({}, userConfig.context || this.appConfig.context), this.context);
34190
+
34145
34191
  const defaults = external_api_objectSpread(external_api_objectSpread({}, this.appConfig.defaults), userConfig.defaults);
34146
34192
 
34147
34193
  return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, this.appConfig), userConfig), {}, {
34148
34194
  api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api),
34195
+ context: keys_default()(context).length ? context : undefined,
34149
34196
  defaults: keys_default()(defaults).length ? defaults : undefined
34150
34197
  });
34151
34198
  }