@seamly/web-ui 20.1.0-alpha.1 → 20.1.0

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 (160) hide show
  1. package/build/dist/lib/deprecated-view.css +1 -1
  2. package/build/dist/lib/index.debug.js +135 -135
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.js +582 -570
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/standalone.js +607 -595
  7. package/build/dist/lib/standalone.min.js +1 -1
  8. package/build/dist/lib/style-guide.js +7294 -7289
  9. package/build/dist/lib/style-guide.min.js +1 -1
  10. package/build/dist/lib/styles-default-implementation.css +1 -1
  11. package/build/dist/lib/styles.css +1 -1
  12. package/package.json +1 -1
  13. package/src/javascripts/api/errors/seamly-base-error.js +1 -0
  14. package/src/javascripts/api/index.js +24 -19
  15. package/src/javascripts/api/producer.js +3 -3
  16. package/src/javascripts/domains/app/actions.js +7 -7
  17. package/src/javascripts/domains/app/hooks.js +1 -1
  18. package/src/javascripts/domains/app/utils.js +1 -1
  19. package/src/javascripts/domains/config/hooks.js +1 -1
  20. package/src/javascripts/domains/config/reducer.js +3 -3
  21. package/src/javascripts/domains/config/selectors.js +1 -1
  22. package/src/javascripts/domains/config/utils.js +1 -1
  23. package/src/javascripts/domains/errors/index.js +2 -2
  24. package/src/javascripts/domains/forms/hooks.js +1 -1
  25. package/src/javascripts/domains/forms/provider.js +5 -3
  26. package/src/javascripts/domains/forms/reducer.js +1 -1
  27. package/src/javascripts/domains/forms/selectors.js +1 -1
  28. package/src/javascripts/domains/forms/utils.js +1 -1
  29. package/src/javascripts/domains/i18n/actions.js +1 -1
  30. package/src/javascripts/domains/i18n/hooks.js +1 -1
  31. package/src/javascripts/domains/i18n/reducer.js +1 -1
  32. package/src/javascripts/domains/i18n/utils.js +1 -1
  33. package/src/javascripts/domains/interrupt/hooks.js +2 -2
  34. package/src/javascripts/domains/interrupt/middleware.js +6 -6
  35. package/src/javascripts/domains/interrupt/reducer.js +1 -1
  36. package/src/javascripts/domains/interrupt/utils.js +1 -1
  37. package/src/javascripts/domains/options/middleware.js +1 -1
  38. package/src/javascripts/domains/store/index.js +10 -10
  39. package/src/javascripts/domains/store/state-reducer.js +3 -3
  40. package/src/javascripts/domains/translations/components/chat-status.js +8 -5
  41. package/src/javascripts/domains/translations/components/options-button.js +6 -6
  42. package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
  43. package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
  44. package/src/javascripts/domains/translations/hooks.js +7 -3
  45. package/src/javascripts/domains/translations/middleware.js +5 -2
  46. package/src/javascripts/domains/translations/reducer.js +4 -4
  47. package/src/javascripts/domains/translations/selectors.js +1 -1
  48. package/src/javascripts/domains/translations/utils.js +1 -1
  49. package/src/javascripts/domains/visibility/actions.js +3 -3
  50. package/src/javascripts/domains/visibility/hooks.js +1 -1
  51. package/src/javascripts/domains/visibility/utils.js +1 -1
  52. package/src/javascripts/lib/css.js +1 -1
  53. package/src/javascripts/lib/engine/index.js +6 -5
  54. package/src/javascripts/lib/external-api/index.js +1 -1
  55. package/src/javascripts/lib/redux-helpers/index.js +1 -1
  56. package/src/javascripts/style-guide/components/app.js +1 -1
  57. package/src/javascripts/style-guide/components/links.js +1 -1
  58. package/src/javascripts/style-guide/components/static-core.js +8 -11
  59. package/src/javascripts/ui/components/app-options/index.js +4 -4
  60. package/src/javascripts/ui/components/chat-status/index.js +2 -2
  61. package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
  62. package/src/javascripts/ui/components/conversation/conversation.js +6 -6
  63. package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
  64. package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
  65. package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
  66. package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
  67. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
  68. package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
  69. package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
  70. package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
  71. package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
  72. package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
  73. package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
  74. package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
  75. package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
  76. package/src/javascripts/ui/components/conversation/event/event-participant.js +4 -4
  77. package/src/javascripts/ui/components/conversation/event/event.js +2 -2
  78. package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
  79. package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
  80. package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
  81. package/src/javascripts/ui/components/conversation/event/image.js +2 -2
  82. package/src/javascripts/ui/components/conversation/event/participant.js +4 -4
  83. package/src/javascripts/ui/components/conversation/event/text.js +3 -3
  84. package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
  85. package/src/javascripts/ui/components/conversation/event/upload.js +5 -5
  86. package/src/javascripts/ui/components/conversation/event/video.js +4 -4
  87. package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
  88. package/src/javascripts/ui/components/conversation/loader.js +2 -2
  89. package/src/javascripts/ui/components/conversation/message-container.js +4 -4
  90. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
  91. package/src/javascripts/ui/components/core/seamly-core.js +2 -2
  92. package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
  93. package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
  94. package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
  95. package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
  96. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
  97. package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
  98. package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
  99. package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
  100. package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
  101. package/src/javascripts/ui/components/entry/entry-container.js +8 -8
  102. package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
  103. package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
  104. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
  105. package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
  106. package/src/javascripts/ui/components/entry/upload/index.js +10 -10
  107. package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
  108. package/src/javascripts/ui/components/faq/faq.js +16 -16
  109. package/src/javascripts/ui/components/form-controls/error.js +2 -2
  110. package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
  111. package/src/javascripts/ui/components/form-controls/form.js +2 -2
  112. package/src/javascripts/ui/components/form-controls/input.js +1 -1
  113. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  114. package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
  115. package/src/javascripts/ui/components/layout/agent-info.js +7 -7
  116. package/src/javascripts/ui/components/layout/chat-frame.js +5 -5
  117. package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
  118. package/src/javascripts/ui/components/layout/header.js +3 -3
  119. package/src/javascripts/ui/components/layout/icon.js +1 -1
  120. package/src/javascripts/ui/components/layout/interrupt.js +3 -3
  121. package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
  122. package/src/javascripts/ui/components/options/options-button.js +8 -13
  123. package/src/javascripts/ui/components/options/options-frame.js +4 -4
  124. package/src/javascripts/ui/components/options/options.js +1 -1
  125. package/src/javascripts/ui/components/options/transcript/index.js +8 -8
  126. package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
  127. package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
  128. package/src/javascripts/ui/components/warnings/prompt.js +2 -2
  129. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
  130. package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
  131. package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
  132. package/src/javascripts/ui/components/widgets/modal.js +2 -2
  133. package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
  134. package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
  135. package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
  136. package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
  137. package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
  138. package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
  139. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
  140. package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
  141. package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
  142. package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
  143. package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
  144. package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
  145. package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
  146. package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
  147. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
  148. package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
  149. package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
  150. package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
  151. package/src/stylesheets/4-base/_formelements.scss +3 -3
  152. package/src/stylesheets/5-components/_buttons.scss +1 -1
  153. package/src/stylesheets/5-components/_input.scss +2 -2
  154. package/src/stylesheets/6-default-implementation/_hover.scss +5 -5
  155. package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
  156. package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
  157. package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
  158. package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
  159. package/webpack/config.common.js +5 -0
  160. package/webpack/config.package.js +3 -0
@@ -9238,43 +9238,6 @@ const {
9238
9238
 
9239
9239
  const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
9240
9240
 
9241
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
9242
-
9243
-
9244
- const {
9245
- createAction: visibility_utils_createAction,
9246
- createActions: utils_createActions,
9247
- createThunk: visibility_utils_createThunk,
9248
- createReducer: visibility_utils_createReducer,
9249
- selectState: visibility_utils_selectState
9250
- } = createDomain('visibility');
9251
- const calculateVisibility = ({
9252
- hasResponded,
9253
- previousVisibility,
9254
- requestedVisibility,
9255
- config
9256
- }) => {
9257
- const {
9258
- defaults,
9259
- layoutMode,
9260
- hideOnNoUserResponse
9261
- } = config;
9262
- const {
9263
- visible: defaultVisibility
9264
- } = defaults || {}; // Requesting open should override the responded check.
9265
-
9266
- if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
9267
- return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
9268
- }
9269
-
9270
- const baseVisibility = visibilityStates.minimized;
9271
- return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
9272
- };
9273
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
9274
-
9275
-
9276
- const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
9277
-
9278
9241
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
9279
9242
  function seamly_state_hooks_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9280
9243
 
@@ -9386,6 +9349,43 @@ const useSeamlyLayoutMode = () => {
9386
9349
  isResolving: !layoutMode
9387
9350
  };
9388
9351
  };
9352
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
9353
+
9354
+
9355
+ const {
9356
+ createAction: visibility_utils_createAction,
9357
+ createActions: utils_createActions,
9358
+ createThunk: visibility_utils_createThunk,
9359
+ createReducer: visibility_utils_createReducer,
9360
+ selectState: visibility_utils_selectState
9361
+ } = createDomain('visibility');
9362
+ const calculateVisibility = ({
9363
+ hasResponded,
9364
+ previousVisibility,
9365
+ requestedVisibility,
9366
+ config
9367
+ }) => {
9368
+ const {
9369
+ defaults,
9370
+ layoutMode,
9371
+ hideOnNoUserResponse
9372
+ } = config;
9373
+ const {
9374
+ visible: defaultVisibility
9375
+ } = defaults || {}; // Requesting open should override the responded check.
9376
+
9377
+ if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
9378
+ return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
9379
+ }
9380
+
9381
+ const baseVisibility = visibilityStates.minimized;
9382
+ return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
9383
+ };
9384
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
9385
+
9386
+
9387
+ const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
9388
+
9389
9389
  ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
9390
9390
  function actions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9391
9391
 
@@ -9509,6 +9509,7 @@ class SeamlyBaseError extends Error {
9509
9509
  if (originalError !== null && originalError !== void 0 && originalError.payload) {
9510
9510
  this.originalEvent = originalError;
9511
9511
  this.originalError = originalError.payload.error;
9512
+ this.message = `Event of type ${originalError.payload.type} encountered`;
9512
9513
  }
9513
9514
 
9514
9515
  if (originalError !== null && originalError !== void 0 && originalError.error) {
@@ -10817,33 +10818,6 @@ const useFileUploads = () => {
10817
10818
  isComplete: currentUploads.every(file => file.complete)
10818
10819
  };
10819
10820
  };
10820
- ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
10821
-
10822
-
10823
- const useForceUpdate = () => {
10824
- // This is an escape hatch mentioned in the React docs:
10825
- // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
10826
-
10827
- /* eslint-disable-next-line no-unused-vars */
10828
- const [ignored, forceUpdate] = (0,hooks_namespaceObject.useReducer)(x => x + 1, 0);
10829
- return (0,hooks_namespaceObject.useCallback)(() => {
10830
- setTimeout(() => {
10831
- forceUpdate();
10832
- });
10833
- }, []);
10834
- };
10835
- const useGeneratedId = () => {
10836
- const [id] = (0,hooks_namespaceObject.useState)(() => randomId());
10837
- return id;
10838
- };
10839
- const useStableCallback = callback => {
10840
- const callbackRef = (0,hooks_namespaceObject.useRef)();
10841
- callbackRef.current = callback;
10842
- const isFunction = typeof callback === 'function';
10843
- return (0,hooks_namespaceObject.useMemo)(() => {
10844
- return isFunction ? (...args) => callbackRef.current(...args) : undefined;
10845
- }, [isFunction]);
10846
- };
10847
10821
  ;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
10848
10822
 
10849
10823
 
@@ -11061,6 +11035,33 @@ const visibility_reducer_initialState = {
11061
11035
 
11062
11036
 
11063
11037
 
11038
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
11039
+
11040
+
11041
+ const useForceUpdate = () => {
11042
+ // This is an escape hatch mentioned in the React docs:
11043
+ // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
11044
+
11045
+ /* eslint-disable-next-line no-unused-vars */
11046
+ const [ignored, forceUpdate] = (0,hooks_namespaceObject.useReducer)(x => x + 1, 0);
11047
+ return (0,hooks_namespaceObject.useCallback)(() => {
11048
+ setTimeout(() => {
11049
+ forceUpdate();
11050
+ });
11051
+ }, []);
11052
+ };
11053
+ const useGeneratedId = () => {
11054
+ const [id] = (0,hooks_namespaceObject.useState)(() => randomId());
11055
+ return id;
11056
+ };
11057
+ const useStableCallback = callback => {
11058
+ const callbackRef = (0,hooks_namespaceObject.useRef)();
11059
+ callbackRef.current = callback;
11060
+ const isFunction = typeof callback === 'function';
11061
+ return (0,hooks_namespaceObject.useMemo)(() => {
11062
+ return isFunction ? (...args) => callbackRef.current(...args) : undefined;
11063
+ }, [isFunction]);
11064
+ };
11064
11065
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
11065
11066
  function use_seamly_commands_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
11066
11067
 
@@ -12635,10 +12636,14 @@ function FormProvider(_ref) {
12635
12636
  });
12636
12637
  }, [setExternalErrors]);
12637
12638
  const handleSubmit = (0,hooks_namespaceObject.useCallback)(e => {
12638
- e.preventDefault();
12639
- setIsSubmitted(true);
12639
+ var _e$submitter;
12640
+
12641
+ e.preventDefault(); // If the submitter is set to being aria-disabled, block the submit action
12640
12642
 
12641
- if (validationIsValid) {
12643
+ const ariaDisabled = ((_e$submitter = e.submitter) === null || _e$submitter === void 0 ? void 0 : _e$submitter.ariaDisabled) === 'true';
12644
+ setIsSubmitted(!ariaDisabled);
12645
+
12646
+ if (!ariaDisabled && validationIsValid) {
12642
12647
  onSubmit(values, {
12643
12648
  updateControlValue,
12644
12649
  setError
@@ -12799,51 +12804,230 @@ function updateFormControl(state, formId, name, controlState) {
12799
12804
 
12800
12805
 
12801
12806
 
12802
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
12803
- const form_excluded = ["className", "disableValidationClasses"];
12807
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
12808
+ function form_utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12804
12809
 
12805
- function form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12810
+ function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_utils_ownKeys(Object(source), true).forEach(function (key) { form_utils_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12806
12811
 
12807
- function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_ownKeys(Object(source), true).forEach(function (key) { form_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12812
+ function form_utils_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12808
12813
 
12809
- function form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12814
+ const formActions = {
12815
+ REGISTER_FORM: 'REGISTER_FORM',
12816
+ DE_REGISTER_FORM: 'DE_REGISTER_FORM',
12817
+ REGISTER: 'REGISTER',
12818
+ DE_REGISTER: 'DEREGISTER',
12819
+ SET_VALUE: 'SET_VALUE',
12820
+ SET_VALIDITY: 'SET_VALIDITY',
12821
+ SET_STATE: 'SET_STATE',
12822
+ SET_SUBMITTED: 'SET_SUBMITTED',
12823
+ SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
12824
+ };
12825
+ const {
12826
+ REGISTER_FORM,
12827
+ DE_REGISTER_FORM,
12828
+ REGISTER,
12829
+ DE_REGISTER,
12830
+ SET_VALUE,
12831
+ SET_VALIDITY,
12832
+ SET_STATE,
12833
+ SET_SUBMITTED,
12834
+ SET_PERSIST_FORM_DATA
12835
+ } = formActions;
12836
+ const getValidator = (fn, errorText, compareValue = null) => ({
12837
+ fn,
12838
+ errorText,
12839
+ compareValue
12840
+ });
12841
+ const formReducer = (state, action) => {
12842
+ const {
12843
+ formId,
12844
+ name,
12845
+ controlId,
12846
+ value,
12847
+ data,
12848
+ validity,
12849
+ errorText,
12850
+ hasSubmitted,
12851
+ persistData
12852
+ } = action;
12810
12853
 
12811
- function form_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = form_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12854
+ const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12855
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12856
+ controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
12857
+ })
12858
+ });
12812
12859
 
12813
- function form_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12860
+ switch (action.type) {
12861
+ case REGISTER_FORM:
12862
+ return form_utils_objectSpread({
12863
+ [formId]: {
12864
+ controls: {},
12865
+ validity: true,
12866
+ hasSubmitted: false,
12867
+ persistData: false
12868
+ }
12869
+ }, state);
12814
12870
 
12871
+ case DE_REGISTER_FORM:
12872
+ const removedFormState = form_utils_objectSpread({}, state);
12815
12873
 
12874
+ delete removedFormState[formId];
12875
+ return removedFormState;
12816
12876
 
12877
+ case REGISTER:
12878
+ const {
12879
+ value: existingValue,
12880
+ validity: existingValidity,
12881
+ errorText: existingErrorText
12882
+ } = state[formId].controls[name] || {};
12883
+ return setControls({
12884
+ [name]: {
12885
+ controlId,
12886
+ value: existingValue || value,
12887
+ validity: existingValidity !== false,
12888
+ errorText: existingErrorText || ''
12889
+ }
12890
+ });
12817
12891
 
12892
+ case DE_REGISTER:
12893
+ const relatedForm = state[formId];
12818
12894
 
12819
- function Form(_ref) {
12820
- let {
12821
- className: givenClassName,
12822
- disableValidationClasses
12823
- } = _ref,
12824
- props = form_objectWithoutProperties(_ref, form_excluded);
12895
+ if (!relatedForm) {
12896
+ return state;
12897
+ }
12825
12898
 
12826
- const {
12827
- handleSubmit,
12828
- isValid,
12829
- isSubmitted
12830
- } = useForm();
12831
- const formClasses = ['form'];
12899
+ const newControls = form_utils_objectSpread({}, relatedForm.controls);
12832
12900
 
12833
- if (!disableValidationClasses && isSubmitted) {
12834
- formClasses.push('form--submitted');
12901
+ delete newControls[action.name];
12902
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12903
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
12904
+ controls: newControls
12905
+ })
12906
+ });
12835
12907
 
12836
- if (isValid) {
12837
- formClasses.push('form--valid');
12838
- } else {
12839
- formClasses.push('form--invalid');
12840
- }
12841
- }
12908
+ case SET_VALUE:
12909
+ return setControls({
12910
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
12911
+ value
12912
+ })
12913
+ });
12842
12914
 
12843
- return (0,jsx_runtime_namespaceObject.jsx)("form", form_objectSpread({
12844
- onSubmit: handleSubmit,
12845
- className: css_className([...formClasses, givenClassName])
12846
- }, props));
12915
+ case SET_VALIDITY:
12916
+ const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
12917
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
12918
+ validity,
12919
+ errorText
12920
+ })
12921
+ });
12922
+
12923
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12924
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12925
+ controls: newControlValidities,
12926
+ validity: Object.keys(newControlValidities).map(key => newControlValidities[key].validity).every(v => v)
12927
+ })
12928
+ });
12929
+
12930
+ case SET_STATE:
12931
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12932
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12933
+ controls: Object.keys(data).reduce((acc, key) => {
12934
+ return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
12935
+ [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
12936
+ value: data[key],
12937
+ validity: true,
12938
+ errorText: ''
12939
+ })
12940
+ });
12941
+ }, form_utils_objectSpread({}, state.controls))
12942
+ })
12943
+ });
12944
+
12945
+ case SET_SUBMITTED:
12946
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12947
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12948
+ hasSubmitted
12949
+ })
12950
+ });
12951
+
12952
+ case SET_PERSIST_FORM_DATA:
12953
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12954
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12955
+ persistData
12956
+ })
12957
+ });
12958
+
12959
+ default:
12960
+ return state;
12961
+ }
12962
+ };
12963
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
12964
+ const validateFileSize = (fileList, maxSize) => {
12965
+ let isValid = true;
12966
+
12967
+ for (let i = 0; i < fileList.length; i++) {
12968
+ if (fileList[i].size > maxSize) {
12969
+ isValid = false;
12970
+ }
12971
+ }
12972
+
12973
+ return isValid;
12974
+ };
12975
+ const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
12976
+ /* eslint-disable no-control-regex */
12977
+
12978
+ const isEmailString = val => {
12979
+ 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;
12980
+ const trimmedVal = val && val.trim();
12981
+ return !!(trimmedVal && trimmedVal.match(regex));
12982
+ };
12983
+ /* eslint-enable no-control-regex */
12984
+
12985
+ const isNotEmptyString = val => !!val;
12986
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
12987
+ const form_excluded = ["className", "disableValidationClasses"];
12988
+
12989
+ function form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12990
+
12991
+ function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_ownKeys(Object(source), true).forEach(function (key) { form_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12992
+
12993
+ function form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12994
+
12995
+ function form_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = form_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12996
+
12997
+ function form_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12998
+
12999
+
13000
+
13001
+
13002
+
13003
+ function Form(_ref) {
13004
+ let {
13005
+ className: givenClassName,
13006
+ disableValidationClasses
13007
+ } = _ref,
13008
+ props = form_objectWithoutProperties(_ref, form_excluded);
13009
+
13010
+ const {
13011
+ handleSubmit,
13012
+ isValid,
13013
+ isSubmitted
13014
+ } = useForm();
13015
+ const formClasses = ['form'];
13016
+
13017
+ if (!disableValidationClasses && isSubmitted) {
13018
+ formClasses.push('form--submitted');
13019
+
13020
+ if (isValid) {
13021
+ formClasses.push('form--valid');
13022
+ } else {
13023
+ formClasses.push('form--invalid');
13024
+ }
13025
+ }
13026
+
13027
+ return (0,jsx_runtime_namespaceObject.jsx)("form", form_objectSpread({
13028
+ onSubmit: handleSubmit,
13029
+ className: css_className([...formClasses, givenClassName])
13030
+ }, props));
12847
13031
  }
12848
13032
 
12849
13033
  /* harmony default export */ const form_controls_form = (Form);
@@ -12997,245 +13181,66 @@ function TranslationsOptionsDialogForm({
12997
13181
  controlName,
12998
13182
  descriptionId
12999
13183
  }) {
13000
- const {
13001
- t
13002
- } = useI18n();
13003
- const {
13004
- isActive,
13005
- languages,
13006
- currentLocale
13007
- } = useTranslations();
13008
- const {
13009
- locale: uiLocale
13010
- } = useI18n();
13011
- const languageName = (0,hooks_namespaceObject.useMemo)(() => {
13012
- var _languages$find;
13013
-
13014
- return languages === null || languages === void 0 ? void 0 : (_languages$find = languages.find(lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
13015
- }, [languages, currentLocale]);
13016
- const options = (0,hooks_namespaceObject.useMemo)(() => {
13017
- return [{
13018
- value: '',
13019
- label: t('translations.settings.defaultOptionLabel')
13020
- }, ...languages.filter(language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase()).map(language => ({
13021
- value: language.locale,
13022
- label: language.nativeName
13023
- }))];
13024
- }, [t, languages, uiLocale]);
13025
- return (0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, {
13026
- noValidate: "true",
13027
- className: css_className('options__form'),
13028
- children: [(0,jsx_runtime_namespaceObject.jsx)("p", {
13029
- className: css_className('options__description'),
13030
- id: descriptionId,
13031
- children: t('translations.settings.description')
13032
- }), isActive ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
13033
- children: [(0,jsx_runtime_namespaceObject.jsx)("h3", {
13034
- children: t('translations.settings.currentTranslationLabel')
13035
- }), (0,jsx_runtime_namespaceObject.jsx)("p", {
13036
- className: css_className('options__active-language'),
13037
- children: languageName
13038
- })]
13039
- }) : (0,jsx_runtime_namespaceObject.jsx)(form_controls_select, {
13040
- name: controlName,
13041
- type: "text",
13042
- className: css_className('input__select'),
13043
- "aria-describedby": descriptionId,
13044
- labelClass: css_className('label'),
13045
- labelText: t('translations.settings.inputLabel'),
13046
- options: options,
13047
- defaultValue: currentLocale || ''
13048
- }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13049
- className: css_className('options__actions'),
13050
- children: (0,jsx_runtime_namespaceObject.jsx)("button", {
13051
- type: "submit",
13052
- className: css_className('button', 'button--primary', 'options__submit'),
13053
- children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
13054
- })
13055
- })]
13056
- });
13057
- }
13058
-
13059
- /* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
13060
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
13061
- function form_utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
13062
-
13063
- function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_utils_ownKeys(Object(source), true).forEach(function (key) { form_utils_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
13064
-
13065
- function form_utils_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13066
-
13067
- const formActions = {
13068
- REGISTER_FORM: 'REGISTER_FORM',
13069
- DE_REGISTER_FORM: 'DE_REGISTER_FORM',
13070
- REGISTER: 'REGISTER',
13071
- DE_REGISTER: 'DEREGISTER',
13072
- SET_VALUE: 'SET_VALUE',
13073
- SET_VALIDITY: 'SET_VALIDITY',
13074
- SET_STATE: 'SET_STATE',
13075
- SET_SUBMITTED: 'SET_SUBMITTED',
13076
- SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
13077
- };
13078
- const {
13079
- REGISTER_FORM,
13080
- DE_REGISTER_FORM,
13081
- REGISTER,
13082
- DE_REGISTER,
13083
- SET_VALUE,
13084
- SET_VALIDITY,
13085
- SET_STATE,
13086
- SET_SUBMITTED,
13087
- SET_PERSIST_FORM_DATA
13088
- } = formActions;
13089
- const getValidator = (fn, errorText, compareValue = null) => ({
13090
- fn,
13091
- errorText,
13092
- compareValue
13093
- });
13094
- const formReducer = (state, action) => {
13095
- const {
13096
- formId,
13097
- name,
13098
- controlId,
13099
- value,
13100
- data,
13101
- validity,
13102
- errorText,
13103
- hasSubmitted,
13104
- persistData
13105
- } = action;
13106
-
13107
- const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13108
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13109
- controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
13110
- })
13111
- });
13112
-
13113
- switch (action.type) {
13114
- case REGISTER_FORM:
13115
- return form_utils_objectSpread({
13116
- [formId]: {
13117
- controls: {},
13118
- validity: true,
13119
- hasSubmitted: false,
13120
- persistData: false
13121
- }
13122
- }, state);
13123
-
13124
- case DE_REGISTER_FORM:
13125
- const removedFormState = form_utils_objectSpread({}, state);
13126
-
13127
- delete removedFormState[formId];
13128
- return removedFormState;
13129
-
13130
- case REGISTER:
13131
- const {
13132
- value: existingValue,
13133
- validity: existingValidity,
13134
- errorText: existingErrorText
13135
- } = state[formId].controls[name] || {};
13136
- return setControls({
13137
- [name]: {
13138
- controlId,
13139
- value: existingValue || value,
13140
- validity: existingValidity !== false,
13141
- errorText: existingErrorText || ''
13142
- }
13143
- });
13144
-
13145
- case DE_REGISTER:
13146
- const relatedForm = state[formId];
13147
-
13148
- if (!relatedForm) {
13149
- return state;
13150
- }
13151
-
13152
- const newControls = form_utils_objectSpread({}, relatedForm.controls);
13153
-
13154
- delete newControls[action.name];
13155
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13156
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
13157
- controls: newControls
13158
- })
13159
- });
13160
-
13161
- case SET_VALUE:
13162
- return setControls({
13163
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
13164
- value
13165
- })
13166
- });
13167
-
13168
- case SET_VALIDITY:
13169
- const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
13170
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
13171
- validity,
13172
- errorText
13173
- })
13174
- });
13175
-
13176
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13177
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13178
- controls: newControlValidities,
13179
- validity: Object.keys(newControlValidities).map(key => newControlValidities[key].validity).every(v => v)
13180
- })
13181
- });
13182
-
13183
- case SET_STATE:
13184
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13185
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13186
- controls: Object.keys(data).reduce((acc, key) => {
13187
- return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
13188
- [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
13189
- value: data[key],
13190
- validity: true,
13191
- errorText: ''
13192
- })
13193
- });
13194
- }, form_utils_objectSpread({}, state.controls))
13195
- })
13196
- });
13197
-
13198
- case SET_SUBMITTED:
13199
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13200
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13201
- hasSubmitted
13202
- })
13203
- });
13204
-
13205
- case SET_PERSIST_FORM_DATA:
13206
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13207
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13208
- persistData
13209
- })
13210
- });
13211
-
13212
- default:
13213
- return state;
13214
- }
13215
- };
13216
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
13217
- const validateFileSize = (fileList, maxSize) => {
13218
- let isValid = true;
13219
-
13220
- for (let i = 0; i < fileList.length; i++) {
13221
- if (fileList[i].size > maxSize) {
13222
- isValid = false;
13223
- }
13224
- }
13225
-
13226
- return isValid;
13227
- };
13228
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
13229
- /* eslint-disable no-control-regex */
13184
+ const {
13185
+ t
13186
+ } = useI18n();
13187
+ const {
13188
+ isActive,
13189
+ languages,
13190
+ currentLocale
13191
+ } = useTranslations();
13192
+ const {
13193
+ locale: uiLocale
13194
+ } = useI18n();
13195
+ const languageName = (0,hooks_namespaceObject.useMemo)(() => {
13196
+ var _languages$find;
13230
13197
 
13231
- const isEmailString = val => {
13232
- 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;
13233
- const trimmedVal = val && val.trim();
13234
- return !!(trimmedVal && trimmedVal.match(regex));
13235
- };
13236
- /* eslint-enable no-control-regex */
13198
+ return languages === null || languages === void 0 ? void 0 : (_languages$find = languages.find(lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
13199
+ }, [languages, currentLocale]);
13200
+ const options = (0,hooks_namespaceObject.useMemo)(() => {
13201
+ return [{
13202
+ value: '',
13203
+ label: t('translations.settings.defaultOptionLabel')
13204
+ }, ...languages.filter(language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase()).map(language => ({
13205
+ value: language.locale,
13206
+ label: language.nativeName
13207
+ }))];
13208
+ }, [t, languages, uiLocale]);
13209
+ return (0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, {
13210
+ noValidate: "true",
13211
+ className: css_className('options__form'),
13212
+ children: [(0,jsx_runtime_namespaceObject.jsx)("p", {
13213
+ className: css_className('options__description'),
13214
+ id: descriptionId,
13215
+ children: t('translations.settings.description')
13216
+ }), isActive ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
13217
+ children: [(0,jsx_runtime_namespaceObject.jsx)("h3", {
13218
+ children: t('translations.settings.currentTranslationLabel')
13219
+ }), (0,jsx_runtime_namespaceObject.jsx)("p", {
13220
+ className: css_className('options__active-language'),
13221
+ children: languageName
13222
+ })]
13223
+ }) : (0,jsx_runtime_namespaceObject.jsx)(form_controls_select, {
13224
+ name: controlName,
13225
+ type: "text",
13226
+ className: css_className('input__select'),
13227
+ "aria-describedby": descriptionId,
13228
+ labelClass: css_className('label'),
13229
+ labelText: t('translations.settings.inputLabel'),
13230
+ options: options,
13231
+ defaultValue: currentLocale || ''
13232
+ }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13233
+ className: css_className('options__actions'),
13234
+ children: (0,jsx_runtime_namespaceObject.jsx)("button", {
13235
+ type: "submit",
13236
+ className: css_className('button', 'button--primary', 'options__submit'),
13237
+ children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
13238
+ })
13239
+ })]
13240
+ });
13241
+ }
13237
13242
 
13238
- const isNotEmptyString = val => !!val;
13243
+ /* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
13239
13244
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
13240
13245
 
13241
13246
 
@@ -13853,6 +13858,36 @@ const Interrupt = ({
13853
13858
  };
13854
13859
 
13855
13860
  /* harmony default export */ const interrupt = (Interrupt);
13861
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
13862
+
13863
+
13864
+
13865
+
13866
+
13867
+
13868
+ const PrivacyDisclaimer = () => {
13869
+ const {
13870
+ t
13871
+ } = useI18n();
13872
+ const {
13873
+ showDisclaimer
13874
+ } = useConfig();
13875
+ return showDisclaimer && (0,jsx_runtime_namespaceObject.jsxs)("div", {
13876
+ className: css_className('disclaimer'),
13877
+ tabIndex: "0",
13878
+ children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
13879
+ className: css_className('disclaimer__title'),
13880
+ children: t('disclaimer.title')
13881
+ }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13882
+ className: css_className('disclaimer__message'),
13883
+ dangerouslySetInnerHTML: {
13884
+ __html: t('disclaimer.content')
13885
+ }
13886
+ })]
13887
+ });
13888
+ };
13889
+
13890
+ /* harmony default export */ const privacy_disclaimer = (PrivacyDisclaimer);
13856
13891
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
13857
13892
 
13858
13893
  const ComponentContext = (0,external_preact_namespaceObject.createContext)({});
@@ -19678,94 +19713,6 @@ const Cta = ({
19678
19713
  };
19679
19714
 
19680
19715
  /* harmony default export */ const cta = (Cta);
19681
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
19682
-
19683
-
19684
-
19685
- function CarouselPagination({
19686
- items,
19687
- currentIndex,
19688
- onChange,
19689
- getItemKey,
19690
- getItemLabel
19691
- }) {
19692
- const itemCount = items.length;
19693
- const handlePaginate = (0,hooks_namespaceObject.useCallback)(event => {
19694
- const slideIndex = Number(event.target.dataset.item || '0');
19695
- const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
19696
-
19697
- if (nextIndex !== currentIndex) {
19698
- onChange(nextIndex);
19699
- }
19700
- }, [itemCount, currentIndex, onChange]);
19701
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
19702
- className: css_className('carousel-pagination__wrapper'),
19703
- role: "group",
19704
- children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
19705
- className: css_className('carousel-pagination'),
19706
- children: items.map((item, idx) => {
19707
- const isActive = currentIndex === idx;
19708
- return (0,jsx_runtime_namespaceObject.jsx)("li", {
19709
- className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
19710
- children: (0,jsx_runtime_namespaceObject.jsx)("button", {
19711
- className: css_className('carousel-pagination__button'),
19712
- type: "button",
19713
- onClick: handlePaginate,
19714
- "data-item": idx,
19715
- "aria-disabled": isActive ? 'true' : undefined,
19716
- "aria-label": getItemLabel(item, idx)
19717
- })
19718
- }, getItemKey(item, idx, 'pagination-item-'));
19719
- })
19720
- })
19721
- });
19722
- }
19723
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
19724
-
19725
-
19726
-
19727
-
19728
-
19729
- function CarouselControls({
19730
- items,
19731
- currentIndex,
19732
- onChange,
19733
- children
19734
- }) {
19735
- const {
19736
- t
19737
- } = useI18n();
19738
- const itemCount = items.length;
19739
-
19740
- const handlePrevious = () => {
19741
- onChange((currentIndex - 1 + itemCount) % itemCount);
19742
- };
19743
-
19744
- const handleNext = () => {
19745
- onChange((currentIndex + 1) % itemCount);
19746
- };
19747
-
19748
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
19749
- className: css_className('carousel-controls'),
19750
- children: [(0,jsx_runtime_namespaceObject.jsx)("button", {
19751
- className: css_className('button', 'button--previous'),
19752
- "aria-label": t('carousel.controls.previous'),
19753
- onClick: handlePrevious,
19754
- children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19755
- name: "arrowLeft",
19756
- size: "16"
19757
- })
19758
- }), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
19759
- className: css_className('button', 'button--next'),
19760
- "aria-label": t('carousel.controls.next'),
19761
- onClick: handleNext,
19762
- children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19763
- name: "arrowRight",
19764
- size: "16"
19765
- })
19766
- })]
19767
- });
19768
- }
19769
19716
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
19770
19717
  function card_component_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19771
19718
 
@@ -19876,41 +19823,129 @@ const CardComponent = ({
19876
19823
  }))]
19877
19824
  })]
19878
19825
  });
19879
- };
19880
-
19881
- /* harmony default export */ const card_component = (CardComponent);
19882
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
19883
- function slide_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19884
-
19885
- function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { slide_ownKeys(Object(source), true).forEach(function (key) { slide_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { slide_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19886
-
19887
- function slide_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19826
+ };
19827
+
19828
+ /* harmony default export */ const card_component = (CardComponent);
19829
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
19830
+ function slide_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19831
+
19832
+ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { slide_ownKeys(Object(source), true).forEach(function (key) { slide_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { slide_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19833
+
19834
+ function slide_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19835
+
19836
+
19837
+
19838
+
19839
+
19840
+ function CarouselMessageSlide({
19841
+ item: slide,
19842
+ items,
19843
+ index,
19844
+ isActive
19845
+ }) {
19846
+ const {
19847
+ t
19848
+ } = useI18n();
19849
+ return (0,jsx_runtime_namespaceObject.jsx)("div", {
19850
+ className: css_className('carousel-item', `carousel-item--${slide.type}`),
19851
+ role: "group",
19852
+ "aria-roledescription": "slide",
19853
+ "aria-label": t('carousel.slide.label', {
19854
+ index: index + 1,
19855
+ total: items.length
19856
+ }),
19857
+ children: (0,jsx_runtime_namespaceObject.jsx)(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
19858
+ isCarouselItem: true,
19859
+ hasFocus: isActive
19860
+ }))
19861
+ });
19862
+ }
19863
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
19864
+
19865
+
19866
+
19867
+ function CarouselPagination({
19868
+ items,
19869
+ currentIndex,
19870
+ onChange,
19871
+ getItemKey,
19872
+ getItemLabel
19873
+ }) {
19874
+ const itemCount = items.length;
19875
+ const handlePaginate = (0,hooks_namespaceObject.useCallback)(event => {
19876
+ const slideIndex = Number(event.target.dataset.item || '0');
19877
+ const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
19878
+
19879
+ if (nextIndex !== currentIndex) {
19880
+ onChange(nextIndex);
19881
+ }
19882
+ }, [itemCount, currentIndex, onChange]);
19883
+ return (0,jsx_runtime_namespaceObject.jsx)("div", {
19884
+ className: css_className('carousel-pagination__wrapper'),
19885
+ role: "group",
19886
+ children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
19887
+ className: css_className('carousel-pagination'),
19888
+ children: items.map((item, idx) => {
19889
+ const isActive = currentIndex === idx;
19890
+ return (0,jsx_runtime_namespaceObject.jsx)("li", {
19891
+ className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
19892
+ children: (0,jsx_runtime_namespaceObject.jsx)("button", {
19893
+ className: css_className('carousel-pagination__button'),
19894
+ type: "button",
19895
+ onClick: handlePaginate,
19896
+ "data-item": idx,
19897
+ "aria-disabled": isActive ? 'true' : undefined,
19898
+ "aria-label": getItemLabel(item, idx)
19899
+ })
19900
+ }, getItemKey(item, idx, 'pagination-item-'));
19901
+ })
19902
+ })
19903
+ });
19904
+ }
19905
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
19888
19906
 
19889
19907
 
19890
19908
 
19891
19909
 
19892
19910
 
19893
- function CarouselMessageSlide({
19894
- item: slide,
19911
+ function CarouselControls({
19895
19912
  items,
19896
- index,
19897
- isActive
19913
+ currentIndex,
19914
+ onChange,
19915
+ children
19898
19916
  }) {
19899
19917
  const {
19900
19918
  t
19901
19919
  } = useI18n();
19902
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
19903
- className: css_className('carousel-item', `carousel-item--${slide.type}`),
19904
- role: "group",
19905
- "aria-roledescription": "slide",
19906
- "aria-label": t('carousel.slide.label', {
19907
- index: index + 1,
19908
- total: items.length
19909
- }),
19910
- children: (0,jsx_runtime_namespaceObject.jsx)(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
19911
- isCarouselItem: true,
19912
- hasFocus: isActive
19913
- }))
19920
+ const itemCount = items.length;
19921
+
19922
+ const handlePrevious = () => {
19923
+ onChange((currentIndex - 1 + itemCount) % itemCount);
19924
+ };
19925
+
19926
+ const handleNext = () => {
19927
+ onChange((currentIndex + 1) % itemCount);
19928
+ };
19929
+
19930
+ return (0,jsx_runtime_namespaceObject.jsxs)("div", {
19931
+ className: css_className('carousel-controls'),
19932
+ children: [(0,jsx_runtime_namespaceObject.jsx)("button", {
19933
+ className: css_className('button', 'button--previous'),
19934
+ "aria-label": t('carousel.controls.previous'),
19935
+ onClick: handlePrevious,
19936
+ children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19937
+ name: "arrowLeft",
19938
+ size: "16"
19939
+ })
19940
+ }), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
19941
+ className: css_className('button', 'button--next'),
19942
+ "aria-label": t('carousel.controls.next'),
19943
+ onClick: handleNext,
19944
+ children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19945
+ name: "arrowRight",
19946
+ size: "16"
19947
+ })
19948
+ })]
19914
19949
  });
19915
19950
  }
19916
19951
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
@@ -20254,36 +20289,6 @@ const ComponentFilter = ({
20254
20289
  };
20255
20290
 
20256
20291
  /* harmony default export */ const component_filter = (ComponentFilter);
20257
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
20258
-
20259
-
20260
-
20261
-
20262
-
20263
-
20264
- const PrivacyDisclaimer = () => {
20265
- const {
20266
- t
20267
- } = useI18n();
20268
- const {
20269
- showDisclaimer
20270
- } = useConfig();
20271
- return showDisclaimer && (0,jsx_runtime_namespaceObject.jsxs)("div", {
20272
- className: css_className('disclaimer'),
20273
- tabIndex: "0",
20274
- children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
20275
- className: css_className('disclaimer__title'),
20276
- children: t('disclaimer.title')
20277
- }), (0,jsx_runtime_namespaceObject.jsx)("div", {
20278
- className: css_className('disclaimer__message'),
20279
- dangerouslySetInnerHTML: {
20280
- __html: t('disclaimer.content')
20281
- }
20282
- })]
20283
- });
20284
- };
20285
-
20286
- /* harmony default export */ const privacy_disclaimer = (PrivacyDisclaimer);
20287
20292
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
20288
20293
 
20289
20294
 
@@ -20740,7 +20745,7 @@ function TextEntryForm({
20740
20745
  }), (0,jsx_runtime_namespaceObject.jsx)("button", {
20741
20746
  className: css_className('button', 'input__submit'),
20742
20747
  type: "submit",
20743
- disabled: !hasValue || reachedCharacterLimit,
20748
+ "aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null,
20744
20749
  children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
20745
20750
  name: "send",
20746
20751
  size: "32",
@@ -20874,9 +20879,9 @@ const UploadToggle = () => {
20874
20879
  children: (0,jsx_runtime_namespaceObject.jsx)("button", {
20875
20880
  className: css_className(['button', 'button--secondary', 'upload-toggle']),
20876
20881
  ref: uploadButton,
20877
- disabled: !showUploadButton ? 'true' : null,
20882
+ "aria-disabled": !showUploadButton ? 'true' : null,
20878
20883
  type: "button",
20879
- onClick: onClickHandler,
20884
+ onClick: showUploadButton ? onClickHandler : null,
20880
20885
  children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
20881
20886
  name: "file",
20882
20887
  size: "32",
@@ -21723,7 +21728,7 @@ const OptionsButton = () => {
21723
21728
  ref: item => {
21724
21729
  menuItemButtons.current[i] = item;
21725
21730
  },
21726
- className: css_className(['button', 'button--secondary', ...(available ? [] : ['button--disabled'])]),
21731
+ className: css_className(['button', 'button--secondary']),
21727
21732
  onKeyDown: e => onMenuItemKeyDownHandler(e, i),
21728
21733
  onKeyPress: e => onKeyPressHandler(e, i),
21729
21734
  onClick: () => onMenuItemClickHandler(name, available),
@@ -21740,7 +21745,7 @@ const OptionsButton = () => {
21740
21745
  })
21741
21746
  }), (0,jsx_runtime_namespaceObject.jsxs)("button", {
21742
21747
  type: "button",
21743
- className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : []), ...(!multiMenu && !firstOption.available ? ['button--disabled'] : [])]),
21748
+ className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])]),
21744
21749
  id: id,
21745
21750
  onClick: onClickHandler,
21746
21751
  onKeyDown: multiMenu ? onButtonKeyDownHandler : null,
@@ -22212,6 +22217,53 @@ const View = () => {
22212
22217
  };
22213
22218
 
22214
22219
  /* harmony default export */ const view = (View);
22220
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
22221
+
22222
+
22223
+ const {
22224
+ createAction: errors_createAction
22225
+ } = createDomain('errors');
22226
+ const catchError = errors_createAction('catch-error', error => ({
22227
+ error
22228
+ }));
22229
+ function errors_createMiddleware({
22230
+ api: seamlyApi
22231
+ }) {
22232
+ return ({
22233
+ getState
22234
+ }) => {
22235
+ const handleError = action => {
22236
+ const {
22237
+ errorCallback,
22238
+ namespace,
22239
+ api,
22240
+ layoutMode
22241
+ } = selectConfig(getState());
22242
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
22243
+ namespace,
22244
+ api,
22245
+ layoutMode,
22246
+ conversationUrl: seamlyApi.getConversationUrl(),
22247
+ action: action.type ? action : undefined
22248
+ });
22249
+ };
22250
+
22251
+ return next => action => {
22252
+ try {
22253
+ if (action.error) {
22254
+ handleError(action);
22255
+ }
22256
+
22257
+ return next(action);
22258
+ } catch (error) {
22259
+ handleError({
22260
+ error
22261
+ });
22262
+ throw error;
22263
+ }
22264
+ };
22265
+ };
22266
+ }
22215
22267
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
22216
22268
 
22217
22269
 
@@ -23086,53 +23138,6 @@ const SeamlyFileUpload = ({
23086
23138
  };
23087
23139
 
23088
23140
  /* harmony default export */ const seamly_file_upload = (SeamlyFileUpload);
23089
- ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
23090
-
23091
-
23092
- const {
23093
- createAction: errors_createAction
23094
- } = createDomain('errors');
23095
- const catchError = errors_createAction('catch-error', error => ({
23096
- error
23097
- }));
23098
- function errors_createMiddleware({
23099
- api: seamlyApi
23100
- }) {
23101
- return ({
23102
- getState
23103
- }) => {
23104
- const handleError = action => {
23105
- const {
23106
- errorCallback,
23107
- namespace,
23108
- api,
23109
- layoutMode
23110
- } = selectConfig(getState());
23111
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
23112
- namespace,
23113
- api,
23114
- layoutMode,
23115
- conversationUrl: seamlyApi.getConversationUrl(),
23116
- action: action.type ? action : undefined
23117
- });
23118
- };
23119
-
23120
- return next => action => {
23121
- try {
23122
- if (action.error) {
23123
- handleError(action);
23124
- }
23125
-
23126
- return next(action);
23127
- } catch (error) {
23128
- handleError({
23129
- error
23130
- });
23131
- throw error;
23132
- }
23133
- };
23134
- };
23135
- }
23136
23141
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
23137
23142
 
23138
23143
 
@@ -23237,6 +23242,34 @@ function objectStore(key, storageProvider) {
23237
23242
 
23238
23243
  };
23239
23244
  }
23245
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
23246
+ function store(key) {
23247
+ const KEY = 'cvco.' + key;
23248
+ return {
23249
+ get() {
23250
+ const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')];
23251
+ let val;
23252
+
23253
+ do {
23254
+ val = sessionStorage.getItem(candidates[0]);
23255
+ } while (candidates.shift() && !val);
23256
+
23257
+ return JSON.parse(val);
23258
+ },
23259
+
23260
+ set(value) {
23261
+ if (!value) {
23262
+ return;
23263
+ }
23264
+
23265
+ sessionStorage.setItem(KEY, JSON.stringify(value));
23266
+ }
23267
+
23268
+ };
23269
+ }
23270
+ // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
23271
+ var debug = __webpack_require__(905);
23272
+ var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
23240
23273
  ;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
23241
23274
  // js/phoenix/utils.js
23242
23275
  var closure = value => {
@@ -24631,9 +24664,6 @@ const splitUrlParams = url => {
24631
24664
  };
24632
24665
 
24633
24666
  /* harmony default export */ const split_url_params = (splitUrlParams);
24634
- // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
24635
- var debug = __webpack_require__(905);
24636
- var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
24637
24667
  ;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
24638
24668
  function producer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
24639
24669
 
@@ -24796,31 +24826,6 @@ class ConversationProducer {
24796
24826
  }
24797
24827
 
24798
24828
  }
24799
- ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
24800
- function store(key) {
24801
- const KEY = 'cvco.' + key;
24802
- return {
24803
- get() {
24804
- const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')];
24805
- let val;
24806
-
24807
- do {
24808
- val = sessionStorage.getItem(candidates[0]);
24809
- } while (candidates.shift() && !val);
24810
-
24811
- return JSON.parse(val);
24812
- },
24813
-
24814
- set(value) {
24815
- if (!value) {
24816
- return;
24817
- }
24818
-
24819
- sessionStorage.setItem(KEY, JSON.stringify(value));
24820
- }
24821
-
24822
- };
24823
- }
24824
24829
  ;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
24825
24830
  class EventProducer {
24826
24831
  constructor(name) {
@@ -24920,15 +24925,6 @@ function getTimeZone() {
24920
24925
  }
24921
24926
  }
24922
24927
 
24923
- function getEnvironment() {
24924
- return {
24925
- screenResolution: `${window.screen.width}x${window.screen.height}`,
24926
- userAgent: navigator.userAgent,
24927
- currentUrl: window.location.toString(),
24928
- timezone: getTimeZone()
24929
- };
24930
- }
24931
-
24932
24928
  class API {
24933
24929
  /**
24934
24930
  * Creates an instance of API.
@@ -24938,6 +24934,7 @@ class API {
24938
24934
  * @param {string} config.secure Connect securely
24939
24935
  * @param {string} config.externalId Unique visitor identifier (optional)
24940
24936
  * @param {boolean} config.sendEnvironment
24937
+ * @param {string} layoutMode
24941
24938
  * @param {string} namespace
24942
24939
  * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
24943
24940
  * @param {string} context.channelName
@@ -24946,6 +24943,7 @@ class API {
24946
24943
  * @memberof API
24947
24944
  */
24948
24945
  constructor({
24946
+ layoutMode,
24949
24947
  namespace,
24950
24948
  config = {},
24951
24949
  context = {}
@@ -24965,6 +24963,7 @@ class API {
24965
24963
  this.connected = false;
24966
24964
  this.configReady = false;
24967
24965
  this.externalId = config.externalId;
24966
+ this.layoutMode = layoutMode;
24968
24967
  this.internalProducer = new EventProducer('API');
24969
24968
  this.internal$ = xstream_default().create(this.internalProducer).flatten();
24970
24969
  this.connection$ = this.internal$.filter(event => event.type === 'connection');
@@ -25089,7 +25088,7 @@ class API {
25089
25088
  v: apiVersion
25090
25089
  }).send({
25091
25090
  context: api_objectSpread(api_objectSpread({}, this.config.context), {}, {
25092
- environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
25091
+ environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
25093
25092
  })
25094
25093
  }).then(({
25095
25094
  body
@@ -25103,7 +25102,7 @@ class API {
25103
25102
  }
25104
25103
 
25105
25104
  if (error.status >= 500) {
25106
- throw new SeamlyGeneralError();
25105
+ throw new SeamlyGeneralError(error);
25107
25106
  }
25108
25107
 
25109
25108
  throw error;
@@ -25177,7 +25176,7 @@ class API {
25177
25176
 
25178
25177
  if (this.config.sendEnvironment) {
25179
25178
  this.send('context', {
25180
- environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
25179
+ environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
25181
25180
  }, false);
25182
25181
  }
25183
25182
 
@@ -25302,6 +25301,18 @@ class API {
25302
25301
  return this.internal$.filter(event => event.type !== 'connection');
25303
25302
  }
25304
25303
 
25304
+ getEnvironment() {
25305
+ return {
25306
+ clientName: PACKAGE_NAME,
25307
+ clientVariant: this.layoutMode,
25308
+ clientVersion: PACKAGE_VERSION,
25309
+ currentUrl: window.location.toString(),
25310
+ screenResolution: `${window.screen.width}x${window.screen.height}`,
25311
+ timezone: getTimeZone(),
25312
+ userAgent: navigator.userAgent
25313
+ };
25314
+ }
25315
+
25305
25316
  }
25306
25317
  ;// CONCATENATED MODULE: ./node_modules/redux-thunk/es/index.js
25307
25318
  function createThunkMiddleware(extraArgument) {
@@ -25495,6 +25506,7 @@ class Engine {
25495
25506
  this.parentElement = parentElement;
25496
25507
  this.externalApi = externalApi;
25497
25508
  this.api = new API({
25509
+ layoutMode: config.layoutMode,
25498
25510
  namespace: config.namespace,
25499
25511
  config: config.api,
25500
25512
  context: config.context