@seamly/web-ui 20.0.0-beta.6 → 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.
- package/build/dist/lib/deprecated-view.css +1 -1
- package/build/dist/lib/index.debug.js +138 -149
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +0 -4
- package/build/dist/lib/index.js +669 -655
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +702 -688
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +7288 -7266
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +1 -2
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +24 -19
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +30 -8
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/app/utils.js +1 -1
- package/src/javascripts/domains/config/hooks.js +18 -1
- package/src/javascripts/domains/config/index.js +0 -1
- package/src/javascripts/domains/config/reducer.js +7 -3
- package/src/javascripts/domains/config/selectors.js +1 -1
- package/src/javascripts/domains/config/utils.js +1 -1
- package/src/javascripts/domains/errors/index.js +2 -2
- package/src/javascripts/domains/forms/hooks.js +1 -1
- package/src/javascripts/domains/forms/provider.js +5 -3
- package/src/javascripts/domains/forms/reducer.js +1 -1
- package/src/javascripts/domains/forms/selectors.js +1 -1
- package/src/javascripts/domains/forms/utils.js +1 -1
- package/src/javascripts/domains/i18n/actions.js +1 -1
- package/src/javascripts/domains/i18n/hooks.js +1 -1
- package/src/javascripts/domains/i18n/reducer.js +1 -1
- package/src/javascripts/domains/i18n/utils.js +1 -1
- package/src/javascripts/domains/interrupt/hooks.js +2 -2
- package/src/javascripts/domains/interrupt/middleware.js +6 -6
- package/src/javascripts/domains/interrupt/reducer.js +1 -1
- package/src/javascripts/domains/interrupt/utils.js +1 -1
- package/src/javascripts/domains/options/middleware.js +1 -1
- package/src/javascripts/domains/store/index.js +10 -14
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +8 -5
- package/src/javascripts/domains/translations/components/options-button.js +6 -6
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
- package/src/javascripts/domains/translations/hooks.js +7 -3
- package/src/javascripts/domains/translations/middleware.js +5 -2
- package/src/javascripts/domains/translations/reducer.js +4 -4
- package/src/javascripts/domains/translations/selectors.js +1 -1
- package/src/javascripts/domains/translations/utils.js +1 -1
- package/src/javascripts/domains/visibility/actions.js +3 -3
- package/src/javascripts/domains/visibility/hooks.js +1 -1
- package/src/javascripts/domains/visibility/utils.js +1 -1
- package/src/javascripts/lib/css.js +1 -1
- package/src/javascripts/lib/engine/index.js +6 -5
- package/src/javascripts/lib/external-api/index.js +1 -1
- package/src/javascripts/lib/redux-helpers/index.js +1 -1
- package/src/javascripts/style-guide/components/app.js +9 -5
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +27 -13
- package/src/javascripts/style-guide/components/view.js +16 -3
- package/src/javascripts/style-guide/states.js +23 -41
- package/src/javascripts/style-guide/style-guide-engine.js +13 -1
- package/src/javascripts/style-guide.js +2 -0
- package/src/javascripts/ui/components/app-options/index.js +4 -4
- package/src/javascripts/ui/components/chat-status/index.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +6 -6
- package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
- package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
- package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
- package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +13 -10
- package/src/javascripts/ui/components/conversation/event/event.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/participant.js +6 -6
- package/src/javascripts/ui/components/conversation/event/text.js +3 -3
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +18 -15
- package/src/javascripts/ui/components/conversation/event/video.js +4 -4
- package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
- package/src/javascripts/ui/components/conversation/loader.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -4
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
- package/src/javascripts/ui/components/core/seamly-core.js +2 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
- package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
- package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
- package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
- package/src/javascripts/ui/components/entry/upload/index.js +10 -10
- package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
- package/src/javascripts/ui/components/faq/faq.js +16 -16
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
- package/src/javascripts/ui/components/form-controls/form.js +2 -2
- package/src/javascripts/ui/components/form-controls/input.js +1 -1
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +13 -17
- package/src/javascripts/ui/components/layout/chat-frame.js +6 -6
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
- package/src/javascripts/ui/components/layout/header.js +3 -3
- package/src/javascripts/ui/components/layout/icon.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +3 -3
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
- package/src/javascripts/ui/components/options/options-button.js +8 -13
- package/src/javascripts/ui/components/options/options-frame.js +4 -4
- package/src/javascripts/ui/components/options/options.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +8 -8
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +7 -7
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
- package/src/javascripts/ui/components/warnings/prompt.js +2 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
- package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
- package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
- package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/javascripts/ui/utils/seamly-utils.js +9 -2
- package/src/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_input.scss +2 -2
- package/src/stylesheets/5-components/_message-body.scss +19 -12
- package/src/stylesheets/6-default-implementation/_hover.scss +24 -12
- package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
- package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -3
- package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
- package/webpack/config.common.js +5 -0
- package/webpack/config.package.js +3 -0
- package/src/javascripts/domains/config/middleware.js +0 -22
package/build/dist/lib/index.js
CHANGED
|
@@ -8170,6 +8170,59 @@ const useSelectorWithProps = function useSelectorWithProps(selector, props, inpu
|
|
|
8170
8170
|
function useConfig() {
|
|
8171
8171
|
return useSelector(selectConfig);
|
|
8172
8172
|
}
|
|
8173
|
+
function useParticipants() {
|
|
8174
|
+
const {
|
|
8175
|
+
agentParticipant,
|
|
8176
|
+
userParticipant
|
|
8177
|
+
} = useSelector(selectConfig);
|
|
8178
|
+
return {
|
|
8179
|
+
agent: agentParticipant,
|
|
8180
|
+
user: userParticipant
|
|
8181
|
+
};
|
|
8182
|
+
}
|
|
8183
|
+
function useStartChatIcon() {
|
|
8184
|
+
const {
|
|
8185
|
+
startChatIcon
|
|
8186
|
+
} = useSelector(selectConfig);
|
|
8187
|
+
return startChatIcon;
|
|
8188
|
+
}
|
|
8189
|
+
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
8190
|
+
const CSS_NAME = 'cvco';
|
|
8191
|
+
const apiVersion = '2';
|
|
8192
|
+
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
8193
|
+
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
8194
|
+
|
|
8195
|
+
const unreadScreenReaderWait = 2000;
|
|
8196
|
+
const newMessageScreenReaderWait = 1000;
|
|
8197
|
+
const screenReaderDebounceDelaySeconds = 10;
|
|
8198
|
+
const activitySendDelay = 15000;
|
|
8199
|
+
const maxCharacterWarningLimit = 50;
|
|
8200
|
+
const maxCharacterSrDebounceDelay = 300;
|
|
8201
|
+
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
8202
|
+
|
|
8203
|
+
const typingTimeout = 2000;
|
|
8204
|
+
const defaultConfig = {
|
|
8205
|
+
namespace: 'default',
|
|
8206
|
+
layoutMode: 'window',
|
|
8207
|
+
// "window", "inline" ("sidebar")
|
|
8208
|
+
messages: {
|
|
8209
|
+
agent: {
|
|
8210
|
+
showAvatar: false,
|
|
8211
|
+
// true, "inline"
|
|
8212
|
+
showName: false
|
|
8213
|
+
},
|
|
8214
|
+
user: {
|
|
8215
|
+
showAvatar: false,
|
|
8216
|
+
// true, "inline"
|
|
8217
|
+
showName: false
|
|
8218
|
+
},
|
|
8219
|
+
timeIndicator: {
|
|
8220
|
+
enabled: false,
|
|
8221
|
+
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
8222
|
+
|
|
8223
|
+
}
|
|
8224
|
+
}
|
|
8225
|
+
};
|
|
8173
8226
|
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/general-utils.js
|
|
8174
8227
|
function general_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; }
|
|
8175
8228
|
|
|
@@ -8544,9 +8597,19 @@ const participantReducer = (state, action) => {
|
|
|
8544
8597
|
};
|
|
8545
8598
|
|
|
8546
8599
|
case SET_PARTICIPANT:
|
|
8600
|
+
// TODO: a) Styleguide only! b) Should be removed after styleguide overhaul.
|
|
8601
|
+
if (!state) {
|
|
8602
|
+
return {
|
|
8603
|
+
participants: {},
|
|
8604
|
+
currentAgent: ''
|
|
8605
|
+
};
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8547
8608
|
const {
|
|
8548
8609
|
participants
|
|
8549
|
-
} = state
|
|
8610
|
+
} = state || {
|
|
8611
|
+
participants: {}
|
|
8612
|
+
};
|
|
8550
8613
|
const {
|
|
8551
8614
|
id,
|
|
8552
8615
|
avatar,
|
|
@@ -9089,71 +9152,6 @@ const seamlyStateReducer = (state, action) => {
|
|
|
9089
9152
|
return state;
|
|
9090
9153
|
}
|
|
9091
9154
|
};
|
|
9092
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/config/middleware.js
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
function createMiddleware() {
|
|
9096
|
-
return ({
|
|
9097
|
-
dispatch
|
|
9098
|
-
}) => next => action => {
|
|
9099
|
-
var _action$config, _action$config$defaul;
|
|
9100
|
-
|
|
9101
|
-
const result = next(action);
|
|
9102
|
-
|
|
9103
|
-
switch (action.type) {
|
|
9104
|
-
case String(initialize):
|
|
9105
|
-
case String(update):
|
|
9106
|
-
if (action !== null && action !== void 0 && (_action$config = action.config) !== null && _action$config !== void 0 && (_action$config$defaul = _action$config.defaults) !== null && _action$config$defaul !== void 0 && _action$config$defaul.agentName) {
|
|
9107
|
-
var _action$config2, _action$config2$defau;
|
|
9108
|
-
|
|
9109
|
-
dispatch({
|
|
9110
|
-
type: seamlyActions.SET_HEADER_SUB_TITLE,
|
|
9111
|
-
title: action === null || action === void 0 ? void 0 : (_action$config2 = action.config) === null || _action$config2 === void 0 ? void 0 : (_action$config2$defau = _action$config2.defaults) === null || _action$config2$defau === void 0 ? void 0 : _action$config2$defau.agentName
|
|
9112
|
-
});
|
|
9113
|
-
}
|
|
9114
|
-
|
|
9115
|
-
}
|
|
9116
|
-
|
|
9117
|
-
return result;
|
|
9118
|
-
};
|
|
9119
|
-
}
|
|
9120
|
-
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
9121
|
-
const CSS_NAME = 'cvco';
|
|
9122
|
-
const apiVersion = '2';
|
|
9123
|
-
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
9124
|
-
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
9125
|
-
|
|
9126
|
-
const unreadScreenReaderWait = 2000;
|
|
9127
|
-
const newMessageScreenReaderWait = 1000;
|
|
9128
|
-
const screenReaderDebounceDelaySeconds = 10;
|
|
9129
|
-
const activitySendDelay = 15000;
|
|
9130
|
-
const maxCharacterWarningLimit = 50;
|
|
9131
|
-
const maxCharacterSrDebounceDelay = 300;
|
|
9132
|
-
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
9133
|
-
|
|
9134
|
-
const typingTimeout = 2000;
|
|
9135
|
-
const defaultConfig = {
|
|
9136
|
-
namespace: 'default',
|
|
9137
|
-
layoutMode: 'window',
|
|
9138
|
-
// "window", "inline" ("sidebar")
|
|
9139
|
-
messages: {
|
|
9140
|
-
agent: {
|
|
9141
|
-
showAvatar: false,
|
|
9142
|
-
// true, "inline"
|
|
9143
|
-
showName: false
|
|
9144
|
-
},
|
|
9145
|
-
user: {
|
|
9146
|
-
showAvatar: false,
|
|
9147
|
-
// true, "inline"
|
|
9148
|
-
showName: false
|
|
9149
|
-
},
|
|
9150
|
-
timeIndicator: {
|
|
9151
|
-
enabled: false,
|
|
9152
|
-
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
9153
|
-
|
|
9154
|
-
}
|
|
9155
|
-
}
|
|
9156
|
-
};
|
|
9157
9155
|
;// CONCATENATED MODULE: ./src/javascripts/lib/mutex.js
|
|
9158
9156
|
function createMutex() {
|
|
9159
9157
|
let isRunning = false;
|
|
@@ -9240,43 +9238,6 @@ const {
|
|
|
9240
9238
|
|
|
9241
9239
|
const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
|
|
9242
9240
|
|
|
9243
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
const {
|
|
9247
|
-
createAction: visibility_utils_createAction,
|
|
9248
|
-
createActions: utils_createActions,
|
|
9249
|
-
createThunk: visibility_utils_createThunk,
|
|
9250
|
-
createReducer: visibility_utils_createReducer,
|
|
9251
|
-
selectState: visibility_utils_selectState
|
|
9252
|
-
} = createDomain('visibility');
|
|
9253
|
-
const calculateVisibility = ({
|
|
9254
|
-
hasResponded,
|
|
9255
|
-
previousVisibility,
|
|
9256
|
-
requestedVisibility,
|
|
9257
|
-
config
|
|
9258
|
-
}) => {
|
|
9259
|
-
const {
|
|
9260
|
-
defaults,
|
|
9261
|
-
layoutMode,
|
|
9262
|
-
hideOnNoUserResponse
|
|
9263
|
-
} = config;
|
|
9264
|
-
const {
|
|
9265
|
-
visible: defaultVisibility
|
|
9266
|
-
} = defaults || {}; // Requesting open should override the responded check.
|
|
9267
|
-
|
|
9268
|
-
if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
|
|
9269
|
-
return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
|
|
9270
|
-
}
|
|
9271
|
-
|
|
9272
|
-
const baseVisibility = visibilityStates.minimized;
|
|
9273
|
-
return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
|
|
9274
|
-
};
|
|
9275
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
|
|
9279
|
-
|
|
9280
9241
|
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
|
|
9281
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; }
|
|
9282
9243
|
|
|
@@ -9388,6 +9349,43 @@ const useSeamlyLayoutMode = () => {
|
|
|
9388
9349
|
isResolving: !layoutMode
|
|
9389
9350
|
};
|
|
9390
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
|
+
|
|
9391
9389
|
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
|
|
9392
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; }
|
|
9393
9391
|
|
|
@@ -9511,6 +9509,7 @@ class SeamlyBaseError extends Error {
|
|
|
9511
9509
|
if (originalError !== null && originalError !== void 0 && originalError.payload) {
|
|
9512
9510
|
this.originalEvent = originalError;
|
|
9513
9511
|
this.originalError = originalError.payload.error;
|
|
9512
|
+
this.message = `Event of type ${originalError.payload.type} encountered`;
|
|
9514
9513
|
}
|
|
9515
9514
|
|
|
9516
9515
|
if (originalError !== null && originalError !== void 0 && originalError.error) {
|
|
@@ -9570,7 +9569,10 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
9570
9569
|
const {
|
|
9571
9570
|
features,
|
|
9572
9571
|
defaultLocale,
|
|
9573
|
-
preChat
|
|
9572
|
+
preChat,
|
|
9573
|
+
agentParticipant,
|
|
9574
|
+
userParticipant,
|
|
9575
|
+
startChatIcon
|
|
9574
9576
|
} = await api.getConfig();
|
|
9575
9577
|
dispatch({
|
|
9576
9578
|
type: seamlyActions.SET_FEATURES,
|
|
@@ -9582,6 +9584,18 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
9582
9584
|
type: 'message',
|
|
9583
9585
|
payload
|
|
9584
9586
|
}))));
|
|
9587
|
+
dispatch(update({
|
|
9588
|
+
agentParticipant,
|
|
9589
|
+
userParticipant,
|
|
9590
|
+
startChatIcon
|
|
9591
|
+
}));
|
|
9592
|
+
|
|
9593
|
+
if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
|
|
9594
|
+
dispatch({
|
|
9595
|
+
type: seamlyActions.SET_HEADER_TITLE,
|
|
9596
|
+
title: agentParticipant.name
|
|
9597
|
+
});
|
|
9598
|
+
}
|
|
9585
9599
|
} catch (e) {
|
|
9586
9600
|
throw new SeamlyUnavailableError();
|
|
9587
9601
|
}
|
|
@@ -9654,7 +9668,7 @@ const initialState = reducer_objectSpread(reducer_objectSpread({}, defaultConfig
|
|
|
9654
9668
|
preChatEvents: []
|
|
9655
9669
|
});
|
|
9656
9670
|
|
|
9657
|
-
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback'];
|
|
9671
|
+
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback', 'agentParticipant', 'userParticipant', 'startChatIcon'];
|
|
9658
9672
|
|
|
9659
9673
|
const updateState = (state, {
|
|
9660
9674
|
config
|
|
@@ -9702,7 +9716,6 @@ const updateState = (state, {
|
|
|
9702
9716
|
|
|
9703
9717
|
|
|
9704
9718
|
|
|
9705
|
-
|
|
9706
9719
|
;// CONCATENATED MODULE: ./src/javascripts/lib/css.js
|
|
9707
9720
|
|
|
9708
9721
|
/**
|
|
@@ -10805,33 +10818,6 @@ const useFileUploads = () => {
|
|
|
10805
10818
|
isComplete: currentUploads.every(file => file.complete)
|
|
10806
10819
|
};
|
|
10807
10820
|
};
|
|
10808
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
const useForceUpdate = () => {
|
|
10812
|
-
// This is an escape hatch mentioned in the React docs:
|
|
10813
|
-
// https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
|
|
10814
|
-
|
|
10815
|
-
/* eslint-disable-next-line no-unused-vars */
|
|
10816
|
-
const [ignored, forceUpdate] = (0,hooks_namespaceObject.useReducer)(x => x + 1, 0);
|
|
10817
|
-
return (0,hooks_namespaceObject.useCallback)(() => {
|
|
10818
|
-
setTimeout(() => {
|
|
10819
|
-
forceUpdate();
|
|
10820
|
-
});
|
|
10821
|
-
}, []);
|
|
10822
|
-
};
|
|
10823
|
-
const useGeneratedId = () => {
|
|
10824
|
-
const [id] = (0,hooks_namespaceObject.useState)(() => randomId());
|
|
10825
|
-
return id;
|
|
10826
|
-
};
|
|
10827
|
-
const useStableCallback = callback => {
|
|
10828
|
-
const callbackRef = (0,hooks_namespaceObject.useRef)();
|
|
10829
|
-
callbackRef.current = callback;
|
|
10830
|
-
const isFunction = typeof callback === 'function';
|
|
10831
|
-
return (0,hooks_namespaceObject.useMemo)(() => {
|
|
10832
|
-
return isFunction ? (...args) => callbackRef.current(...args) : undefined;
|
|
10833
|
-
}, [isFunction]);
|
|
10834
|
-
};
|
|
10835
10821
|
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
|
|
10836
10822
|
|
|
10837
10823
|
|
|
@@ -10934,7 +10920,7 @@ class SeamlyUnauthorizedError extends SeamlyBaseError {
|
|
|
10934
10920
|
|
|
10935
10921
|
|
|
10936
10922
|
const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError, SeamlyUnavailableError];
|
|
10937
|
-
function
|
|
10923
|
+
function createMiddleware({
|
|
10938
10924
|
api
|
|
10939
10925
|
}) {
|
|
10940
10926
|
return () => next => action => {
|
|
@@ -11049,6 +11035,33 @@ const visibility_reducer_initialState = {
|
|
|
11049
11035
|
|
|
11050
11036
|
|
|
11051
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
|
+
};
|
|
11052
11065
|
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
|
|
11053
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; }
|
|
11054
11067
|
|
|
@@ -11976,7 +11989,7 @@ function useTranslationsContainer() {
|
|
|
11976
11989
|
|
|
11977
11990
|
|
|
11978
11991
|
|
|
11979
|
-
function
|
|
11992
|
+
function middleware_createMiddleware() {
|
|
11980
11993
|
return ({
|
|
11981
11994
|
dispatch,
|
|
11982
11995
|
getState
|
|
@@ -12623,10 +12636,14 @@ function FormProvider(_ref) {
|
|
|
12623
12636
|
});
|
|
12624
12637
|
}, [setExternalErrors]);
|
|
12625
12638
|
const handleSubmit = (0,hooks_namespaceObject.useCallback)(e => {
|
|
12626
|
-
|
|
12627
|
-
setIsSubmitted(true);
|
|
12639
|
+
var _e$submitter;
|
|
12628
12640
|
|
|
12629
|
-
|
|
12641
|
+
e.preventDefault(); // If the submitter is set to being aria-disabled, block the submit action
|
|
12642
|
+
|
|
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) {
|
|
12630
12647
|
onSubmit(values, {
|
|
12631
12648
|
updateControlValue,
|
|
12632
12649
|
setError
|
|
@@ -12787,18 +12804,197 @@ function updateFormControl(state, formId, name, controlState) {
|
|
|
12787
12804
|
|
|
12788
12805
|
|
|
12789
12806
|
|
|
12790
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
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; }
|
|
12794
|
-
|
|
12795
|
-
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; }
|
|
12796
|
-
|
|
12797
|
-
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; }
|
|
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; }
|
|
12798
12809
|
|
|
12799
|
-
function
|
|
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; }
|
|
12800
12811
|
|
|
12801
|
-
function
|
|
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; }
|
|
12813
|
+
|
|
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;
|
|
12853
|
+
|
|
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
|
+
});
|
|
12859
|
+
|
|
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);
|
|
12870
|
+
|
|
12871
|
+
case DE_REGISTER_FORM:
|
|
12872
|
+
const removedFormState = form_utils_objectSpread({}, state);
|
|
12873
|
+
|
|
12874
|
+
delete removedFormState[formId];
|
|
12875
|
+
return removedFormState;
|
|
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
|
+
});
|
|
12891
|
+
|
|
12892
|
+
case DE_REGISTER:
|
|
12893
|
+
const relatedForm = state[formId];
|
|
12894
|
+
|
|
12895
|
+
if (!relatedForm) {
|
|
12896
|
+
return state;
|
|
12897
|
+
}
|
|
12898
|
+
|
|
12899
|
+
const newControls = form_utils_objectSpread({}, relatedForm.controls);
|
|
12900
|
+
|
|
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
|
+
});
|
|
12907
|
+
|
|
12908
|
+
case SET_VALUE:
|
|
12909
|
+
return setControls({
|
|
12910
|
+
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
12911
|
+
value
|
|
12912
|
+
})
|
|
12913
|
+
});
|
|
12914
|
+
|
|
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; }
|
|
12802
12998
|
|
|
12803
12999
|
|
|
12804
13000
|
|
|
@@ -12989,241 +13185,62 @@ function TranslationsOptionsDialogForm({
|
|
|
12989
13185
|
t
|
|
12990
13186
|
} = useI18n();
|
|
12991
13187
|
const {
|
|
12992
|
-
isActive,
|
|
12993
|
-
languages,
|
|
12994
|
-
currentLocale
|
|
12995
|
-
} = useTranslations();
|
|
12996
|
-
const {
|
|
12997
|
-
locale: uiLocale
|
|
12998
|
-
} = useI18n();
|
|
12999
|
-
const languageName = (0,hooks_namespaceObject.useMemo)(() => {
|
|
13000
|
-
var _languages$find;
|
|
13001
|
-
|
|
13002
|
-
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;
|
|
13003
|
-
}, [languages, currentLocale]);
|
|
13004
|
-
const options = (0,hooks_namespaceObject.useMemo)(() => {
|
|
13005
|
-
return [{
|
|
13006
|
-
value: '',
|
|
13007
|
-
label: t('translations.settings.defaultOptionLabel')
|
|
13008
|
-
}, ...languages.filter(language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase()).map(language => ({
|
|
13009
|
-
value: language.locale,
|
|
13010
|
-
label: language.nativeName
|
|
13011
|
-
}))];
|
|
13012
|
-
}, [t, languages, uiLocale]);
|
|
13013
|
-
return (0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, {
|
|
13014
|
-
noValidate: "true",
|
|
13015
|
-
className: css_className('options__form'),
|
|
13016
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("p", {
|
|
13017
|
-
className: css_className('options__description'),
|
|
13018
|
-
id: descriptionId,
|
|
13019
|
-
children: t('translations.settings.description')
|
|
13020
|
-
}), isActive ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
13021
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("h3", {
|
|
13022
|
-
children: t('translations.settings.currentTranslationLabel')
|
|
13023
|
-
}), (0,jsx_runtime_namespaceObject.jsx)("p", {
|
|
13024
|
-
className: css_className('options__active-language'),
|
|
13025
|
-
children: languageName
|
|
13026
|
-
})]
|
|
13027
|
-
}) : (0,jsx_runtime_namespaceObject.jsx)(form_controls_select, {
|
|
13028
|
-
name: controlName,
|
|
13029
|
-
type: "text",
|
|
13030
|
-
className: css_className('input__select'),
|
|
13031
|
-
"aria-describedby": descriptionId,
|
|
13032
|
-
labelClass: css_className('label'),
|
|
13033
|
-
labelText: t('translations.settings.inputLabel'),
|
|
13034
|
-
options: options,
|
|
13035
|
-
defaultValue: currentLocale || ''
|
|
13036
|
-
}), (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
13037
|
-
className: css_className('options__actions'),
|
|
13038
|
-
children: (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
13039
|
-
type: "submit",
|
|
13040
|
-
className: css_className('button', 'button--primary', 'options__submit'),
|
|
13041
|
-
children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
|
|
13042
|
-
})
|
|
13043
|
-
})]
|
|
13044
|
-
});
|
|
13045
|
-
}
|
|
13046
|
-
|
|
13047
|
-
/* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
|
|
13048
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
|
|
13049
|
-
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; }
|
|
13050
|
-
|
|
13051
|
-
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; }
|
|
13052
|
-
|
|
13053
|
-
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; }
|
|
13054
|
-
|
|
13055
|
-
const formActions = {
|
|
13056
|
-
REGISTER_FORM: 'REGISTER_FORM',
|
|
13057
|
-
DE_REGISTER_FORM: 'DE_REGISTER_FORM',
|
|
13058
|
-
REGISTER: 'REGISTER',
|
|
13059
|
-
DE_REGISTER: 'DEREGISTER',
|
|
13060
|
-
SET_VALUE: 'SET_VALUE',
|
|
13061
|
-
SET_VALIDITY: 'SET_VALIDITY',
|
|
13062
|
-
SET_STATE: 'SET_STATE',
|
|
13063
|
-
SET_SUBMITTED: 'SET_SUBMITTED',
|
|
13064
|
-
SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
|
|
13065
|
-
};
|
|
13066
|
-
const {
|
|
13067
|
-
REGISTER_FORM,
|
|
13068
|
-
DE_REGISTER_FORM,
|
|
13069
|
-
REGISTER,
|
|
13070
|
-
DE_REGISTER,
|
|
13071
|
-
SET_VALUE,
|
|
13072
|
-
SET_VALIDITY,
|
|
13073
|
-
SET_STATE,
|
|
13074
|
-
SET_SUBMITTED,
|
|
13075
|
-
SET_PERSIST_FORM_DATA
|
|
13076
|
-
} = formActions;
|
|
13077
|
-
const getValidator = (fn, errorText, compareValue = null) => ({
|
|
13078
|
-
fn,
|
|
13079
|
-
errorText,
|
|
13080
|
-
compareValue
|
|
13081
|
-
});
|
|
13082
|
-
const formReducer = (state, action) => {
|
|
13083
|
-
const {
|
|
13084
|
-
formId,
|
|
13085
|
-
name,
|
|
13086
|
-
controlId,
|
|
13087
|
-
value,
|
|
13088
|
-
data,
|
|
13089
|
-
validity,
|
|
13090
|
-
errorText,
|
|
13091
|
-
hasSubmitted,
|
|
13092
|
-
persistData
|
|
13093
|
-
} = action;
|
|
13094
|
-
|
|
13095
|
-
const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13096
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
13097
|
-
controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
|
|
13098
|
-
})
|
|
13099
|
-
});
|
|
13100
|
-
|
|
13101
|
-
switch (action.type) {
|
|
13102
|
-
case REGISTER_FORM:
|
|
13103
|
-
return form_utils_objectSpread({
|
|
13104
|
-
[formId]: {
|
|
13105
|
-
controls: {},
|
|
13106
|
-
validity: true,
|
|
13107
|
-
hasSubmitted: false,
|
|
13108
|
-
persistData: false
|
|
13109
|
-
}
|
|
13110
|
-
}, state);
|
|
13111
|
-
|
|
13112
|
-
case DE_REGISTER_FORM:
|
|
13113
|
-
const removedFormState = form_utils_objectSpread({}, state);
|
|
13114
|
-
|
|
13115
|
-
delete removedFormState[formId];
|
|
13116
|
-
return removedFormState;
|
|
13117
|
-
|
|
13118
|
-
case REGISTER:
|
|
13119
|
-
const {
|
|
13120
|
-
value: existingValue,
|
|
13121
|
-
validity: existingValidity,
|
|
13122
|
-
errorText: existingErrorText
|
|
13123
|
-
} = state[formId].controls[name] || {};
|
|
13124
|
-
return setControls({
|
|
13125
|
-
[name]: {
|
|
13126
|
-
controlId,
|
|
13127
|
-
value: existingValue || value,
|
|
13128
|
-
validity: existingValidity !== false,
|
|
13129
|
-
errorText: existingErrorText || ''
|
|
13130
|
-
}
|
|
13131
|
-
});
|
|
13132
|
-
|
|
13133
|
-
case DE_REGISTER:
|
|
13134
|
-
const relatedForm = state[formId];
|
|
13135
|
-
|
|
13136
|
-
if (!relatedForm) {
|
|
13137
|
-
return state;
|
|
13138
|
-
}
|
|
13139
|
-
|
|
13140
|
-
const newControls = form_utils_objectSpread({}, relatedForm.controls);
|
|
13141
|
-
|
|
13142
|
-
delete newControls[action.name];
|
|
13143
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13144
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
|
|
13145
|
-
controls: newControls
|
|
13146
|
-
})
|
|
13147
|
-
});
|
|
13148
|
-
|
|
13149
|
-
case SET_VALUE:
|
|
13150
|
-
return setControls({
|
|
13151
|
-
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
13152
|
-
value
|
|
13153
|
-
})
|
|
13154
|
-
});
|
|
13155
|
-
|
|
13156
|
-
case SET_VALIDITY:
|
|
13157
|
-
const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
|
|
13158
|
-
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
13159
|
-
validity,
|
|
13160
|
-
errorText
|
|
13161
|
-
})
|
|
13162
|
-
});
|
|
13163
|
-
|
|
13164
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13165
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
13166
|
-
controls: newControlValidities,
|
|
13167
|
-
validity: Object.keys(newControlValidities).map(key => newControlValidities[key].validity).every(v => v)
|
|
13168
|
-
})
|
|
13169
|
-
});
|
|
13170
|
-
|
|
13171
|
-
case SET_STATE:
|
|
13172
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13173
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
13174
|
-
controls: Object.keys(data).reduce((acc, key) => {
|
|
13175
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
|
|
13176
|
-
[key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
|
|
13177
|
-
value: data[key],
|
|
13178
|
-
validity: true,
|
|
13179
|
-
errorText: ''
|
|
13180
|
-
})
|
|
13181
|
-
});
|
|
13182
|
-
}, form_utils_objectSpread({}, state.controls))
|
|
13183
|
-
})
|
|
13184
|
-
});
|
|
13185
|
-
|
|
13186
|
-
case SET_SUBMITTED:
|
|
13187
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13188
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
13189
|
-
hasSubmitted
|
|
13190
|
-
})
|
|
13191
|
-
});
|
|
13192
|
-
|
|
13193
|
-
case SET_PERSIST_FORM_DATA:
|
|
13194
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
13195
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
13196
|
-
persistData
|
|
13197
|
-
})
|
|
13198
|
-
});
|
|
13199
|
-
|
|
13200
|
-
default:
|
|
13201
|
-
return state;
|
|
13202
|
-
}
|
|
13203
|
-
};
|
|
13204
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
|
|
13205
|
-
const validateFileSize = (fileList, maxSize) => {
|
|
13206
|
-
let isValid = true;
|
|
13207
|
-
|
|
13208
|
-
for (let i = 0; i < fileList.length; i++) {
|
|
13209
|
-
if (fileList[i].size > maxSize) {
|
|
13210
|
-
isValid = false;
|
|
13211
|
-
}
|
|
13212
|
-
}
|
|
13213
|
-
|
|
13214
|
-
return isValid;
|
|
13215
|
-
};
|
|
13216
|
-
const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
|
|
13217
|
-
/* eslint-disable no-control-regex */
|
|
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;
|
|
13218
13197
|
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
const
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
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
|
+
}
|
|
13225
13242
|
|
|
13226
|
-
const
|
|
13243
|
+
/* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
|
|
13227
13244
|
;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
|
|
13228
13245
|
|
|
13229
13246
|
|
|
@@ -13841,6 +13858,36 @@ const Interrupt = ({
|
|
|
13841
13858
|
};
|
|
13842
13859
|
|
|
13843
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);
|
|
13844
13891
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
|
|
13845
13892
|
|
|
13846
13893
|
const ComponentContext = (0,external_preact_namespaceObject.createContext)({});
|
|
@@ -14066,26 +14113,26 @@ const Event = ({
|
|
|
14066
14113
|
|
|
14067
14114
|
|
|
14068
14115
|
|
|
14116
|
+
|
|
14069
14117
|
const EventParticipant = ({
|
|
14070
14118
|
eventPayload
|
|
14071
14119
|
}) => {
|
|
14120
|
+
const {
|
|
14121
|
+
t
|
|
14122
|
+
} = useI18n();
|
|
14072
14123
|
const {
|
|
14073
14124
|
fromClient,
|
|
14074
14125
|
participant: participantId
|
|
14075
14126
|
} = eventPayload;
|
|
14076
14127
|
const participant = useSeamlyParticipant(participantId) || {};
|
|
14077
14128
|
const {
|
|
14078
|
-
messages
|
|
14079
|
-
defaults
|
|
14129
|
+
messages
|
|
14080
14130
|
} = useConfig();
|
|
14081
|
-
const participantName = participant && participant.name;
|
|
14131
|
+
const participantName = fromClient ? t('participants.user.name') : participant && participant.name;
|
|
14082
14132
|
const {
|
|
14083
14133
|
showAvatar,
|
|
14084
14134
|
showName
|
|
14085
14135
|
} = messages[fromClient ? 'user' : 'agent'] || {};
|
|
14086
|
-
const {
|
|
14087
|
-
userName
|
|
14088
|
-
} = defaults || {};
|
|
14089
14136
|
|
|
14090
14137
|
if (!showAvatar && !showName) {
|
|
14091
14138
|
return null;
|
|
@@ -14104,12 +14151,10 @@ const EventParticipant = ({
|
|
|
14104
14151
|
}));
|
|
14105
14152
|
}
|
|
14106
14153
|
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
if (showName && authorName) {
|
|
14154
|
+
if (showName) {
|
|
14110
14155
|
authorInfo.push((0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
14111
14156
|
className: css_className('message__author-name'),
|
|
14112
|
-
children:
|
|
14157
|
+
children: participantName
|
|
14113
14158
|
}));
|
|
14114
14159
|
}
|
|
14115
14160
|
|
|
@@ -19465,8 +19510,8 @@ const Participant = ({
|
|
|
19465
19510
|
event
|
|
19466
19511
|
}) => {
|
|
19467
19512
|
const {
|
|
19468
|
-
|
|
19469
|
-
} =
|
|
19513
|
+
agent
|
|
19514
|
+
} = useParticipants();
|
|
19470
19515
|
const {
|
|
19471
19516
|
participant
|
|
19472
19517
|
} = event.payload;
|
|
@@ -19479,7 +19524,7 @@ const Participant = ({
|
|
|
19479
19524
|
return null;
|
|
19480
19525
|
}
|
|
19481
19526
|
|
|
19482
|
-
const avatar = participant.avatar ||
|
|
19527
|
+
const avatar = participant.avatar || (agent === null || agent === void 0 ? void 0 : agent.avatar);
|
|
19483
19528
|
return (0,jsx_runtime_namespaceObject.jsx)(EventDivider, {
|
|
19484
19529
|
graphicSrc: avatar,
|
|
19485
19530
|
graphicType: participant.avatar ? 'avatar' : undefined,
|
|
@@ -19565,8 +19610,10 @@ const UploadContent = ({
|
|
|
19565
19610
|
href: url,
|
|
19566
19611
|
download: true,
|
|
19567
19612
|
target: target || undefined,
|
|
19613
|
+
className: css_className(['download', 'download-link']),
|
|
19568
19614
|
children: children
|
|
19569
19615
|
}) : (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
19616
|
+
className: css_className('download'),
|
|
19570
19617
|
children: children
|
|
19571
19618
|
});
|
|
19572
19619
|
|
|
@@ -19596,22 +19643,19 @@ const Upload = _ref => {
|
|
|
19596
19643
|
event: event,
|
|
19597
19644
|
type: "upload"
|
|
19598
19645
|
}, props), {}, {
|
|
19599
|
-
children: (0,jsx_runtime_namespaceObject.jsxs)(
|
|
19600
|
-
|
|
19646
|
+
children: (0,jsx_runtime_namespaceObject.jsxs)(UploadContent, {
|
|
19647
|
+
url: url,
|
|
19648
|
+
target: !fromClient ? '_blank' : undefined,
|
|
19601
19649
|
children: [(0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
19602
19650
|
name: "download",
|
|
19603
19651
|
size: "16"
|
|
19604
|
-
}), (0,jsx_runtime_namespaceObject.
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
children:
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
19612
|
-
className: css_className('visually-hidden'),
|
|
19613
|
-
children: srText
|
|
19614
|
-
})]
|
|
19652
|
+
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
19653
|
+
"aria-hidden": "true",
|
|
19654
|
+
className: css_className('file-download'),
|
|
19655
|
+
children: filename
|
|
19656
|
+
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
19657
|
+
className: css_className('visually-hidden'),
|
|
19658
|
+
children: srText
|
|
19615
19659
|
})]
|
|
19616
19660
|
})
|
|
19617
19661
|
}));
|
|
@@ -19669,94 +19713,6 @@ const Cta = ({
|
|
|
19669
19713
|
};
|
|
19670
19714
|
|
|
19671
19715
|
/* harmony default export */ const cta = (Cta);
|
|
19672
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
function CarouselPagination({
|
|
19677
|
-
items,
|
|
19678
|
-
currentIndex,
|
|
19679
|
-
onChange,
|
|
19680
|
-
getItemKey,
|
|
19681
|
-
getItemLabel
|
|
19682
|
-
}) {
|
|
19683
|
-
const itemCount = items.length;
|
|
19684
|
-
const handlePaginate = (0,hooks_namespaceObject.useCallback)(event => {
|
|
19685
|
-
const slideIndex = Number(event.target.dataset.item || '0');
|
|
19686
|
-
const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
|
|
19687
|
-
|
|
19688
|
-
if (nextIndex !== currentIndex) {
|
|
19689
|
-
onChange(nextIndex);
|
|
19690
|
-
}
|
|
19691
|
-
}, [itemCount, currentIndex, onChange]);
|
|
19692
|
-
return (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
19693
|
-
className: css_className('carousel-pagination__wrapper'),
|
|
19694
|
-
role: "group",
|
|
19695
|
-
children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
|
|
19696
|
-
className: css_className('carousel-pagination'),
|
|
19697
|
-
children: items.map((item, idx) => {
|
|
19698
|
-
const isActive = currentIndex === idx;
|
|
19699
|
-
return (0,jsx_runtime_namespaceObject.jsx)("li", {
|
|
19700
|
-
className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
|
|
19701
|
-
children: (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
19702
|
-
className: css_className('carousel-pagination__button'),
|
|
19703
|
-
type: "button",
|
|
19704
|
-
onClick: handlePaginate,
|
|
19705
|
-
"data-item": idx,
|
|
19706
|
-
"aria-disabled": isActive ? 'true' : undefined,
|
|
19707
|
-
"aria-label": getItemLabel(item, idx)
|
|
19708
|
-
})
|
|
19709
|
-
}, getItemKey(item, idx, 'pagination-item-'));
|
|
19710
|
-
})
|
|
19711
|
-
})
|
|
19712
|
-
});
|
|
19713
|
-
}
|
|
19714
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
function CarouselControls({
|
|
19721
|
-
items,
|
|
19722
|
-
currentIndex,
|
|
19723
|
-
onChange,
|
|
19724
|
-
children
|
|
19725
|
-
}) {
|
|
19726
|
-
const {
|
|
19727
|
-
t
|
|
19728
|
-
} = useI18n();
|
|
19729
|
-
const itemCount = items.length;
|
|
19730
|
-
|
|
19731
|
-
const handlePrevious = () => {
|
|
19732
|
-
onChange((currentIndex - 1 + itemCount) % itemCount);
|
|
19733
|
-
};
|
|
19734
|
-
|
|
19735
|
-
const handleNext = () => {
|
|
19736
|
-
onChange((currentIndex + 1) % itemCount);
|
|
19737
|
-
};
|
|
19738
|
-
|
|
19739
|
-
return (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
19740
|
-
className: css_className('carousel-controls'),
|
|
19741
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
19742
|
-
className: css_className('button', 'button--previous'),
|
|
19743
|
-
"aria-label": t('carousel.controls.previous'),
|
|
19744
|
-
onClick: handlePrevious,
|
|
19745
|
-
children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
19746
|
-
name: "arrowLeft",
|
|
19747
|
-
size: "16"
|
|
19748
|
-
})
|
|
19749
|
-
}), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
19750
|
-
className: css_className('button', 'button--next'),
|
|
19751
|
-
"aria-label": t('carousel.controls.next'),
|
|
19752
|
-
onClick: handleNext,
|
|
19753
|
-
children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
19754
|
-
name: "arrowRight",
|
|
19755
|
-
size: "16"
|
|
19756
|
-
})
|
|
19757
|
-
})]
|
|
19758
|
-
});
|
|
19759
|
-
}
|
|
19760
19716
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
|
|
19761
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; }
|
|
19762
19718
|
|
|
@@ -19881,27 +19837,115 @@ function slide_defineProperty(obj, key, value) { if (key in obj) { Object.define
|
|
|
19881
19837
|
|
|
19882
19838
|
|
|
19883
19839
|
|
|
19884
|
-
function CarouselMessageSlide({
|
|
19885
|
-
item: slide,
|
|
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
|
|
19906
|
+
|
|
19907
|
+
|
|
19908
|
+
|
|
19909
|
+
|
|
19910
|
+
|
|
19911
|
+
function CarouselControls({
|
|
19886
19912
|
items,
|
|
19887
|
-
|
|
19888
|
-
|
|
19913
|
+
currentIndex,
|
|
19914
|
+
onChange,
|
|
19915
|
+
children
|
|
19889
19916
|
}) {
|
|
19890
19917
|
const {
|
|
19891
19918
|
t
|
|
19892
19919
|
} = useI18n();
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
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
|
+
})]
|
|
19905
19949
|
});
|
|
19906
19950
|
}
|
|
19907
19951
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
|
|
@@ -20245,36 +20289,6 @@ const ComponentFilter = ({
|
|
|
20245
20289
|
};
|
|
20246
20290
|
|
|
20247
20291
|
/* harmony default export */ const component_filter = (ComponentFilter);
|
|
20248
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
|
|
20249
|
-
|
|
20250
|
-
|
|
20251
|
-
|
|
20252
|
-
|
|
20253
|
-
|
|
20254
|
-
|
|
20255
|
-
const PrivacyDisclaimer = () => {
|
|
20256
|
-
const {
|
|
20257
|
-
t
|
|
20258
|
-
} = useI18n();
|
|
20259
|
-
const {
|
|
20260
|
-
showDisclaimer
|
|
20261
|
-
} = useConfig();
|
|
20262
|
-
return showDisclaimer && (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
20263
|
-
className: css_className('disclaimer'),
|
|
20264
|
-
tabIndex: "0",
|
|
20265
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
|
|
20266
|
-
className: css_className('disclaimer__title'),
|
|
20267
|
-
children: t('disclaimer.title')
|
|
20268
|
-
}), (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
20269
|
-
className: css_className('disclaimer__message'),
|
|
20270
|
-
dangerouslySetInnerHTML: {
|
|
20271
|
-
__html: t('disclaimer.content')
|
|
20272
|
-
}
|
|
20273
|
-
})]
|
|
20274
|
-
});
|
|
20275
|
-
};
|
|
20276
|
-
|
|
20277
|
-
/* harmony default export */ const privacy_disclaimer = (PrivacyDisclaimer);
|
|
20278
20292
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
|
|
20279
20293
|
|
|
20280
20294
|
|
|
@@ -20731,7 +20745,7 @@ function TextEntryForm({
|
|
|
20731
20745
|
}), (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
20732
20746
|
className: css_className('button', 'input__submit'),
|
|
20733
20747
|
type: "submit",
|
|
20734
|
-
disabled: !hasValue || reachedCharacterLimit,
|
|
20748
|
+
"aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null,
|
|
20735
20749
|
children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
20736
20750
|
name: "send",
|
|
20737
20751
|
size: "32",
|
|
@@ -20865,9 +20879,9 @@ const UploadToggle = () => {
|
|
|
20865
20879
|
children: (0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
20866
20880
|
className: css_className(['button', 'button--secondary', 'upload-toggle']),
|
|
20867
20881
|
ref: uploadButton,
|
|
20868
|
-
disabled: !showUploadButton ? 'true' : null,
|
|
20882
|
+
"aria-disabled": !showUploadButton ? 'true' : null,
|
|
20869
20883
|
type: "button",
|
|
20870
|
-
onClick: onClickHandler,
|
|
20884
|
+
onClick: showUploadButton ? onClickHandler : null,
|
|
20871
20885
|
children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
20872
20886
|
name: "file",
|
|
20873
20887
|
size: "32",
|
|
@@ -21714,7 +21728,7 @@ const OptionsButton = () => {
|
|
|
21714
21728
|
ref: item => {
|
|
21715
21729
|
menuItemButtons.current[i] = item;
|
|
21716
21730
|
},
|
|
21717
|
-
className: css_className(['button', 'button--secondary'
|
|
21731
|
+
className: css_className(['button', 'button--secondary']),
|
|
21718
21732
|
onKeyDown: e => onMenuItemKeyDownHandler(e, i),
|
|
21719
21733
|
onKeyPress: e => onKeyPressHandler(e, i),
|
|
21720
21734
|
onClick: () => onMenuItemClickHandler(name, available),
|
|
@@ -21731,7 +21745,7 @@ const OptionsButton = () => {
|
|
|
21731
21745
|
})
|
|
21732
21746
|
}), (0,jsx_runtime_namespaceObject.jsxs)("button", {
|
|
21733
21747
|
type: "button",
|
|
21734
|
-
className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])
|
|
21748
|
+
className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])]),
|
|
21735
21749
|
id: id,
|
|
21736
21750
|
onClick: onClickHandler,
|
|
21737
21751
|
onKeyDown: multiMenu ? onButtonKeyDownHandler : null,
|
|
@@ -21829,7 +21843,7 @@ function ChatFrame({
|
|
|
21829
21843
|
children: [(0,jsx_runtime_namespaceObject.jsx)(TranslationsChatStatus, {}), (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
21830
21844
|
className: css_className('chat__container'),
|
|
21831
21845
|
children: getContent()
|
|
21832
|
-
}), (0,jsx_runtime_namespaceObject.jsx)(AppOptions, {})]
|
|
21846
|
+
}), isOpen && (0,jsx_runtime_namespaceObject.jsx)(AppOptions, {})]
|
|
21833
21847
|
});
|
|
21834
21848
|
}
|
|
21835
21849
|
|
|
@@ -21967,18 +21981,16 @@ const InlineView = () => {
|
|
|
21967
21981
|
|
|
21968
21982
|
|
|
21969
21983
|
const ButtonIcon = () => {
|
|
21984
|
+
const startChatIcon = useStartChatIcon();
|
|
21970
21985
|
const currentAgent = useSeamlyCurrentAgent();
|
|
21971
21986
|
const {
|
|
21972
21987
|
hasInterrupt
|
|
21973
21988
|
} = useInterrupt();
|
|
21974
|
-
const
|
|
21975
|
-
|
|
21976
|
-
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
return avatar || startChatIcon ? (0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
21980
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
21981
|
-
src: avatar || startChatIcon,
|
|
21989
|
+
const isActiveConversation = currentAgent && !hasInterrupt;
|
|
21990
|
+
const src = isActiveConversation ? currentAgent.avatar : startChatIcon;
|
|
21991
|
+
return src ? (0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
21992
|
+
className: css_className(isActiveConversation ? 'avatar' : 'icon'),
|
|
21993
|
+
src: src,
|
|
21982
21994
|
alt: ""
|
|
21983
21995
|
}) : (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
21984
21996
|
name: "avatar",
|
|
@@ -22205,6 +22217,53 @@ const View = () => {
|
|
|
22205
22217
|
};
|
|
22206
22218
|
|
|
22207
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
|
+
}
|
|
22208
22267
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
|
|
22209
22268
|
|
|
22210
22269
|
|
|
@@ -23079,53 +23138,6 @@ const SeamlyFileUpload = ({
|
|
|
23079
23138
|
};
|
|
23080
23139
|
|
|
23081
23140
|
/* harmony default export */ const seamly_file_upload = (SeamlyFileUpload);
|
|
23082
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
const {
|
|
23086
|
-
createAction: errors_createAction
|
|
23087
|
-
} = createDomain('errors');
|
|
23088
|
-
const catchError = errors_createAction('catch-error', error => ({
|
|
23089
|
-
error
|
|
23090
|
-
}));
|
|
23091
|
-
function errors_createMiddleware({
|
|
23092
|
-
api: seamlyApi
|
|
23093
|
-
}) {
|
|
23094
|
-
return ({
|
|
23095
|
-
getState
|
|
23096
|
-
}) => {
|
|
23097
|
-
const handleError = action => {
|
|
23098
|
-
const {
|
|
23099
|
-
errorCallback,
|
|
23100
|
-
namespace,
|
|
23101
|
-
api,
|
|
23102
|
-
layoutMode
|
|
23103
|
-
} = selectConfig(getState());
|
|
23104
|
-
errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
|
|
23105
|
-
namespace,
|
|
23106
|
-
api,
|
|
23107
|
-
layoutMode,
|
|
23108
|
-
conversationUrl: seamlyApi.getConversationUrl(),
|
|
23109
|
-
action: action.type ? action : undefined
|
|
23110
|
-
});
|
|
23111
|
-
};
|
|
23112
|
-
|
|
23113
|
-
return next => action => {
|
|
23114
|
-
try {
|
|
23115
|
-
if (action.error) {
|
|
23116
|
-
handleError(action);
|
|
23117
|
-
}
|
|
23118
|
-
|
|
23119
|
-
return next(action);
|
|
23120
|
-
} catch (error) {
|
|
23121
|
-
handleError({
|
|
23122
|
-
error
|
|
23123
|
-
});
|
|
23124
|
-
throw error;
|
|
23125
|
-
}
|
|
23126
|
-
};
|
|
23127
|
-
};
|
|
23128
|
-
}
|
|
23129
23141
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
|
|
23130
23142
|
|
|
23131
23143
|
|
|
@@ -23230,6 +23242,34 @@ function objectStore(key, storageProvider) {
|
|
|
23230
23242
|
|
|
23231
23243
|
};
|
|
23232
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);
|
|
23233
23273
|
;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
|
|
23234
23274
|
// js/phoenix/utils.js
|
|
23235
23275
|
var closure = value => {
|
|
@@ -24624,9 +24664,6 @@ const splitUrlParams = url => {
|
|
|
24624
24664
|
};
|
|
24625
24665
|
|
|
24626
24666
|
/* harmony default export */ const split_url_params = (splitUrlParams);
|
|
24627
|
-
// EXTERNAL MODULE: ./src/javascripts/lib/debug.js
|
|
24628
|
-
var debug = __webpack_require__(905);
|
|
24629
|
-
var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
|
|
24630
24667
|
;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
|
|
24631
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; }
|
|
24632
24669
|
|
|
@@ -24789,31 +24826,6 @@ class ConversationProducer {
|
|
|
24789
24826
|
}
|
|
24790
24827
|
|
|
24791
24828
|
}
|
|
24792
|
-
;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
|
|
24793
|
-
function store(key) {
|
|
24794
|
-
const KEY = 'cvco.' + key;
|
|
24795
|
-
return {
|
|
24796
|
-
get() {
|
|
24797
|
-
const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')];
|
|
24798
|
-
let val;
|
|
24799
|
-
|
|
24800
|
-
do {
|
|
24801
|
-
val = sessionStorage.getItem(candidates[0]);
|
|
24802
|
-
} while (candidates.shift() && !val);
|
|
24803
|
-
|
|
24804
|
-
return JSON.parse(val);
|
|
24805
|
-
},
|
|
24806
|
-
|
|
24807
|
-
set(value) {
|
|
24808
|
-
if (!value) {
|
|
24809
|
-
return;
|
|
24810
|
-
}
|
|
24811
|
-
|
|
24812
|
-
sessionStorage.setItem(KEY, JSON.stringify(value));
|
|
24813
|
-
}
|
|
24814
|
-
|
|
24815
|
-
};
|
|
24816
|
-
}
|
|
24817
24829
|
;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
|
|
24818
24830
|
class EventProducer {
|
|
24819
24831
|
constructor(name) {
|
|
@@ -24913,15 +24925,6 @@ function getTimeZone() {
|
|
|
24913
24925
|
}
|
|
24914
24926
|
}
|
|
24915
24927
|
|
|
24916
|
-
function getEnvironment() {
|
|
24917
|
-
return {
|
|
24918
|
-
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
24919
|
-
userAgent: navigator.userAgent,
|
|
24920
|
-
currentUrl: window.location.toString(),
|
|
24921
|
-
timezone: getTimeZone()
|
|
24922
|
-
};
|
|
24923
|
-
}
|
|
24924
|
-
|
|
24925
24928
|
class API {
|
|
24926
24929
|
/**
|
|
24927
24930
|
* Creates an instance of API.
|
|
@@ -24931,6 +24934,7 @@ class API {
|
|
|
24931
24934
|
* @param {string} config.secure Connect securely
|
|
24932
24935
|
* @param {string} config.externalId Unique visitor identifier (optional)
|
|
24933
24936
|
* @param {boolean} config.sendEnvironment
|
|
24937
|
+
* @param {string} layoutMode
|
|
24934
24938
|
* @param {string} namespace
|
|
24935
24939
|
* @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
|
|
24936
24940
|
* @param {string} context.channelName
|
|
@@ -24939,6 +24943,7 @@ class API {
|
|
|
24939
24943
|
* @memberof API
|
|
24940
24944
|
*/
|
|
24941
24945
|
constructor({
|
|
24946
|
+
layoutMode,
|
|
24942
24947
|
namespace,
|
|
24943
24948
|
config = {},
|
|
24944
24949
|
context = {}
|
|
@@ -24958,6 +24963,7 @@ class API {
|
|
|
24958
24963
|
this.connected = false;
|
|
24959
24964
|
this.configReady = false;
|
|
24960
24965
|
this.externalId = config.externalId;
|
|
24966
|
+
this.layoutMode = layoutMode;
|
|
24961
24967
|
this.internalProducer = new EventProducer('API');
|
|
24962
24968
|
this.internal$ = xstream_default().create(this.internalProducer).flatten();
|
|
24963
24969
|
this.connection$ = this.internal$.filter(event => event.type === 'connection');
|
|
@@ -25082,7 +25088,7 @@ class API {
|
|
|
25082
25088
|
v: apiVersion
|
|
25083
25089
|
}).send({
|
|
25084
25090
|
context: api_objectSpread(api_objectSpread({}, this.config.context), {}, {
|
|
25085
|
-
environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
|
|
25091
|
+
environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
|
|
25086
25092
|
})
|
|
25087
25093
|
}).then(({
|
|
25088
25094
|
body
|
|
@@ -25096,7 +25102,7 @@ class API {
|
|
|
25096
25102
|
}
|
|
25097
25103
|
|
|
25098
25104
|
if (error.status >= 500) {
|
|
25099
|
-
throw new SeamlyGeneralError();
|
|
25105
|
+
throw new SeamlyGeneralError(error);
|
|
25100
25106
|
}
|
|
25101
25107
|
|
|
25102
25108
|
throw error;
|
|
@@ -25170,7 +25176,7 @@ class API {
|
|
|
25170
25176
|
|
|
25171
25177
|
if (this.config.sendEnvironment) {
|
|
25172
25178
|
this.send('context', {
|
|
25173
|
-
environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
|
|
25179
|
+
environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
|
|
25174
25180
|
}, false);
|
|
25175
25181
|
}
|
|
25176
25182
|
|
|
@@ -25295,6 +25301,18 @@ class API {
|
|
|
25295
25301
|
return this.internal$.filter(event => event.type !== 'connection');
|
|
25296
25302
|
}
|
|
25297
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
|
+
|
|
25298
25316
|
}
|
|
25299
25317
|
;// CONCATENATED MODULE: ./node_modules/redux-thunk/es/index.js
|
|
25300
25318
|
function createThunkMiddleware(extraArgument) {
|
|
@@ -25441,11 +25459,11 @@ function store_createStore({
|
|
|
25441
25459
|
api,
|
|
25442
25460
|
eventBus,
|
|
25443
25461
|
config
|
|
25444
|
-
}), createMiddleware(
|
|
25462
|
+
}), createMiddleware({
|
|
25445
25463
|
api
|
|
25446
25464
|
}), options_middleware_createMiddleware({
|
|
25447
25465
|
api
|
|
25448
|
-
}),
|
|
25466
|
+
}), middleware_createMiddleware()]
|
|
25449
25467
|
});
|
|
25450
25468
|
return store;
|
|
25451
25469
|
}
|
|
@@ -25488,6 +25506,7 @@ class Engine {
|
|
|
25488
25506
|
this.parentElement = parentElement;
|
|
25489
25507
|
this.externalApi = externalApi;
|
|
25490
25508
|
this.api = new API({
|
|
25509
|
+
layoutMode: config.layoutMode,
|
|
25491
25510
|
namespace: config.namespace,
|
|
25492
25511
|
config: config.api,
|
|
25493
25512
|
context: config.context
|
|
@@ -25776,13 +25795,8 @@ const AgentInfo = () => {
|
|
|
25776
25795
|
const {
|
|
25777
25796
|
hasInterrupt
|
|
25778
25797
|
} = useInterrupt();
|
|
25779
|
-
const
|
|
25780
|
-
|
|
25781
|
-
} = useConfig();
|
|
25782
|
-
const {
|
|
25783
|
-
startChatIcon
|
|
25784
|
-
} = defaults || {};
|
|
25785
|
-
const avatar = currentAgent && !hasInterrupt ? currentAgent.avatar : null;
|
|
25798
|
+
const startChatIcon = useStartChatIcon();
|
|
25799
|
+
const src = (currentAgent === null || currentAgent === void 0 ? void 0 : currentAgent.avatar) ?? startChatIcon;
|
|
25786
25800
|
const displaySubtitle = hasInterrupt ? '' : subTitle;
|
|
25787
25801
|
const classNames = ['message-count'];
|
|
25788
25802
|
|
|
@@ -25794,13 +25808,13 @@ const AgentInfo = () => {
|
|
|
25794
25808
|
classNames.push('message-count__empty');
|
|
25795
25809
|
}
|
|
25796
25810
|
|
|
25797
|
-
return (
|
|
25811
|
+
return (displaySubtitle || !isOpen) && (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
25798
25812
|
className: css_className('agent-info'),
|
|
25799
25813
|
children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
25800
25814
|
className: css_className('agent-info__graphic'),
|
|
25801
|
-
children: [
|
|
25802
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
25803
|
-
src:
|
|
25815
|
+
children: [src ? (0,jsx_runtime_namespaceObject.jsx)("img", {
|
|
25816
|
+
className: css_className(currentAgent !== null && currentAgent !== void 0 && currentAgent.avatar ? 'avatar' : 'icon'),
|
|
25817
|
+
src: src,
|
|
25804
25818
|
alt: ""
|
|
25805
25819
|
}) : (0,jsx_runtime_namespaceObject.jsx)(icon, {
|
|
25806
25820
|
name: "avatar",
|