@copart/ops-tool-kit 1.12.12-beta.1 → 1.12.12
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/dist/ops-tool-kit.js +414 -1163
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
47
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
48
48
|
|
|
49
49
|
const name$r = "@copart/ops-tool-kit";
|
|
50
|
-
const version$8 = "1.12.12
|
|
50
|
+
const version$8 = "1.12.12";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -2855,10 +2855,10 @@ var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
2855
2855
|
}(React__namespace.Component);
|
|
2856
2856
|
|
|
2857
2857
|
var _class;
|
|
2858
|
-
var _excluded$
|
|
2858
|
+
var _excluded$4 = ["breadcrumbs"];
|
|
2859
2859
|
var getCrumbProps = function getCrumbProps(props) {
|
|
2860
2860
|
props.breadcrumbs;
|
|
2861
|
-
var crumbProps = _objectWithoutProperties(props, _excluded$
|
|
2861
|
+
var crumbProps = _objectWithoutProperties(props, _excluded$4);
|
|
2862
2862
|
return crumbProps;
|
|
2863
2863
|
};
|
|
2864
2864
|
var Crumb = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -23566,7 +23566,7 @@ var RoleSelector$2 = function RoleSelector(_ref) {
|
|
|
23566
23566
|
}));
|
|
23567
23567
|
};
|
|
23568
23568
|
|
|
23569
|
-
var _excluded$
|
|
23569
|
+
var _excluded$3 = ["selectedYard", "name", "handleChange", "yardOptions", "label"];
|
|
23570
23570
|
var getDescription = function getDescription(yardOptions) {
|
|
23571
23571
|
return function (code) {
|
|
23572
23572
|
return yardOptions[code].yard_number;
|
|
@@ -23582,7 +23582,7 @@ var YardNumberMenu$2 = function YardNumberMenu(_ref) {
|
|
|
23582
23582
|
handleChange = _ref.handleChange,
|
|
23583
23583
|
yardOptions = _ref.yardOptions,
|
|
23584
23584
|
label = _ref.label,
|
|
23585
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
23585
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
23586
23586
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23587
23587
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
23588
23588
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -24526,14 +24526,14 @@ var HierarchyMenu = function HierarchyMenu(props) {
|
|
|
24526
24526
|
});
|
|
24527
24527
|
};
|
|
24528
24528
|
|
|
24529
|
-
var _excluded$
|
|
24529
|
+
var _excluded$2 = ["value", "handleChange", "yardOptions", "label", "disabled"];
|
|
24530
24530
|
var YardNumberMenu$1 = function YardNumberMenu(_ref) {
|
|
24531
24531
|
var value = _ref.value,
|
|
24532
24532
|
handleChange = _ref.handleChange,
|
|
24533
24533
|
yardOptions = _ref.yardOptions;
|
|
24534
24534
|
_ref.label;
|
|
24535
24535
|
var disabled = _ref.disabled,
|
|
24536
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
24536
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
24537
24537
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
24538
24538
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
24539
24539
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -32160,7 +32160,7 @@ var useWindowSize = function useWindowSize() {
|
|
|
32160
32160
|
return windowSize;
|
|
32161
32161
|
};
|
|
32162
32162
|
|
|
32163
|
-
var _excluded$
|
|
32163
|
+
var _excluded$1 = ["count", "current", "showNavButtons", "onLeftButtonClick", "onRightButtonClick", "saveActionComponentState", "ActionComponent", "notificationsTopContainerRef", "mobileNotificationsTopContainerRef", "setNotificationHeightFlag"];
|
|
32164
32164
|
var alertBackgroundColorMapping = {
|
|
32165
32165
|
alert: '#fab9b9',
|
|
32166
32166
|
warning: '#f5f5cb',
|
|
@@ -32229,7 +32229,7 @@ var Banner = function Banner(props) {
|
|
|
32229
32229
|
notificationsTopContainerRef = props.notificationsTopContainerRef,
|
|
32230
32230
|
mobileNotificationsTopContainerRef = props.mobileNotificationsTopContainerRef,
|
|
32231
32231
|
setNotificationHeightFlag = props.setNotificationHeightFlag,
|
|
32232
|
-
notification = _objectWithoutProperties(props, _excluded$
|
|
32232
|
+
notification = _objectWithoutProperties(props, _excluded$1);
|
|
32233
32233
|
var dismissibleFlag = notification.dismissibleFlag,
|
|
32234
32234
|
onDismiss = notification.onDismiss,
|
|
32235
32235
|
startsAt = notification.startsAt,
|
|
@@ -32728,8 +32728,7 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
|
|
|
32728
32728
|
props.setSettingsVisible;
|
|
32729
32729
|
var handleIconClick = props.handleIconClick,
|
|
32730
32730
|
ideaNoteVisible = props.ideaNoteVisible,
|
|
32731
|
-
mobileMenuVisible = props.mobileMenuVisible
|
|
32732
|
-
chatBotVisible = props.chatBotVisible;
|
|
32731
|
+
mobileMenuVisible = props.mobileMenuVisible;
|
|
32733
32732
|
var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
32734
32733
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures,
|
|
32735
32734
|
showSettingsMenuByTileConfig = coreAppConfig.showSettingsMenuByTileConfig,
|
|
@@ -33010,23 +33009,6 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
|
|
|
33010
33009
|
mobileMenuVisible: mobileMenuVisible
|
|
33011
33010
|
});
|
|
33012
33011
|
}
|
|
33013
|
-
}, {
|
|
33014
|
-
key: 'chatBot',
|
|
33015
|
-
name: 'ChatBot',
|
|
33016
|
-
renderIf: true,
|
|
33017
|
-
render: function render() {
|
|
33018
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
33019
|
-
className: "utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items",
|
|
33020
|
-
onClick: function onClick() {
|
|
33021
|
-
return handleIconClick(ICONS.CHATBOT);
|
|
33022
|
-
}
|
|
33023
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
33024
|
-
name: "comment-sparkle-custom",
|
|
33025
|
-
variant: "light"
|
|
33026
|
-
}), chatBotVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
33027
|
-
className: "utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer"
|
|
33028
|
-
}));
|
|
33029
|
-
}
|
|
33030
33012
|
},
|
|
33031
33013
|
// {
|
|
33032
33014
|
// key: 'phoneStatus',
|
|
@@ -33150,8 +33132,7 @@ var ICONS = {
|
|
|
33150
33132
|
IDEANOTE: 'IDEANOTE',
|
|
33151
33133
|
SETTINGS: 'SETTINGS',
|
|
33152
33134
|
MIHELP: 'MIHELP',
|
|
33153
|
-
MOBILE_MENU: 'MOBILE_MENU'
|
|
33154
|
-
CHATBOT: 'CHATBOT'
|
|
33135
|
+
MOBILE_MENU: 'MOBILE_MENU'
|
|
33155
33136
|
};
|
|
33156
33137
|
var AppBar$1 = function AppBar(props) {
|
|
33157
33138
|
var _window$toolkitEnv4;
|
|
@@ -33225,9 +33206,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
33225
33206
|
setIsNavBarOpen = props.setIsNavBarOpen,
|
|
33226
33207
|
availableStatuses = props.availableStatuses,
|
|
33227
33208
|
currentUserStatus = props.currentUserStatus,
|
|
33228
|
-
onUserStatusUpdate = props.onUserStatusUpdate
|
|
33229
|
-
chatBotVisible = props.chatBotVisible,
|
|
33230
|
-
setChatBotVisible = props.setChatBotVisible;
|
|
33209
|
+
onUserStatusUpdate = props.onUserStatusUpdate;
|
|
33231
33210
|
var _useWindowSize = useWindowSize(),
|
|
33232
33211
|
width = _useWindowSize.width;
|
|
33233
33212
|
_useWindowSize.height;
|
|
@@ -33314,16 +33293,6 @@ var AppBar$1 = function AppBar(props) {
|
|
|
33314
33293
|
}, [ideaNoteVisible]);
|
|
33315
33294
|
var handleIconClick = function handleIconClick(icon) {
|
|
33316
33295
|
switch (icon) {
|
|
33317
|
-
case ICONS.CHATBOT:
|
|
33318
|
-
setChatBotVisible(function (chatBotVisible) {
|
|
33319
|
-
return !chatBotVisible;
|
|
33320
|
-
});
|
|
33321
|
-
setNotificationsVisible(false);
|
|
33322
|
-
setIdeaNoteVisible(false);
|
|
33323
|
-
setSettingsVisible(false);
|
|
33324
|
-
setMihelpVisible(false);
|
|
33325
|
-
setMobileMenuVisible(false);
|
|
33326
|
-
break;
|
|
33327
33296
|
case ICONS.SEARCH:
|
|
33328
33297
|
setShowSearchContainer(function (showSearchContainer) {
|
|
33329
33298
|
return !showSearchContainer;
|
|
@@ -33536,8 +33505,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
33536
33505
|
setSettingsVisible: setSettingsVisible,
|
|
33537
33506
|
handleIconClick: handleIconClick,
|
|
33538
33507
|
ideaNoteVisible: ideaNoteVisible,
|
|
33539
|
-
mobileMenuVisible: mobileMenuVisible
|
|
33540
|
-
chatBotVisible: chatBotVisible
|
|
33508
|
+
mobileMenuVisible: mobileMenuVisible
|
|
33541
33509
|
})),
|
|
33542
33510
|
overflowSetStyles: overflowSetStyles,
|
|
33543
33511
|
overflowIcon: "CollapseMenu",
|
|
@@ -36046,10 +36014,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
36046
36014
|
ActionComponent = _ref.ActionComponent,
|
|
36047
36015
|
searchComponent = _ref.searchComponent,
|
|
36048
36016
|
showNavIconInHeader = _ref.showNavIconInHeader,
|
|
36049
|
-
setIsNavBarOpen = _ref.setIsNavBarOpen
|
|
36050
|
-
setChatBotVisible = _ref.setChatBotVisible,
|
|
36051
|
-
chatBotVisible = _ref.chatBotVisible,
|
|
36052
|
-
onNotificationsAndHeightChange = _ref.onNotificationsAndHeightChange;
|
|
36017
|
+
setIsNavBarOpen = _ref.setIsNavBarOpen;
|
|
36053
36018
|
SETTINGS_ITEMS[0].name = storage$1.userName;
|
|
36054
36019
|
|
|
36055
36020
|
// Escape hatch for forceUpdate function
|
|
@@ -36646,15 +36611,6 @@ var AppBar = function AppBar(_ref) {
|
|
|
36646
36611
|
clearInterval(expireNotificationsInterval);
|
|
36647
36612
|
};
|
|
36648
36613
|
}, [notifications]);
|
|
36649
|
-
React.useEffect(function () {
|
|
36650
|
-
if (onNotificationsAndHeightChange) {
|
|
36651
|
-
var _notificationsTopCont, _mobileNotificationsT;
|
|
36652
|
-
// Calculate sideBarTopValue on-the-fly based on notification container heights
|
|
36653
|
-
// Default to 48 (base header height) if refs aren't ready yet
|
|
36654
|
-
var calculatedHeight = notificationsTopContainerRef !== null && notificationsTopContainerRef !== void 0 && (_notificationsTopCont = notificationsTopContainerRef.current) !== null && _notificationsTopCont !== void 0 && _notificationsTopCont.offsetHeight ? notificationsTopContainerRef.current.offsetHeight + 48 : mobileNotificationsTopContainerRef !== null && mobileNotificationsTopContainerRef !== void 0 && (_mobileNotificationsT = mobileNotificationsTopContainerRef.current) !== null && _mobileNotificationsT !== void 0 && _mobileNotificationsT.offsetHeight ? mobileNotificationsTopContainerRef.current.offsetHeight + 48 : 48;
|
|
36655
|
-
onNotificationsAndHeightChange(notifications.length, calculatedHeight);
|
|
36656
|
-
}
|
|
36657
|
-
}, [notifications, notificationHeightFlag, onNotificationsAndHeightChange]);
|
|
36658
36614
|
var STACK = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.STACK ? window.toolkitEnv.STACK : process.env.STACK;
|
|
36659
36615
|
STACK = STACK || 'c';
|
|
36660
36616
|
var modifiedSettings = SETTINGS_ITEMS;
|
|
@@ -36718,9 +36674,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
36718
36674
|
setIsNavBarOpen: setIsNavBarOpen,
|
|
36719
36675
|
availableStatuses: availableStatuses,
|
|
36720
36676
|
currentUserStatus: currentUserStatus,
|
|
36721
|
-
onUserStatusUpdate: handleUserStatusUpdate
|
|
36722
|
-
chatBotVisible: chatBotVisible,
|
|
36723
|
-
setChatBotVisible: setChatBotVisible
|
|
36677
|
+
onUserStatusUpdate: handleUserStatusUpdate
|
|
36724
36678
|
}), latestRelease && /*#__PURE__*/React__default["default"].createElement(LatestReleaseDialog, {
|
|
36725
36679
|
release: latestRelease,
|
|
36726
36680
|
handleClose: handleReleaseClose,
|
|
@@ -57992,769 +57946,13 @@ var purify$2 = createCommonjsModule(function (module, exports) {
|
|
|
57992
57946
|
});
|
|
57993
57947
|
});
|
|
57994
57948
|
|
|
57995
|
-
var _excluded$1 = ["options"];
|
|
57996
|
-
var FLOW_COMPONENTS = {
|
|
57997
|
-
Input: coreComponents.Input,
|
|
57998
|
-
DatePicker: coreComponents.DatePicker,
|
|
57999
|
-
TimeField: coreComponents.TimeField,
|
|
58000
|
-
Select: coreComponents.Select,
|
|
58001
|
-
ChoiceGroup: coreComponents.ChoiceGroup,
|
|
58002
|
-
Checkbox: coreComponents.Checkbox
|
|
58003
|
-
};
|
|
58004
|
-
var getComponent = function getComponent(name) {
|
|
58005
|
-
return FLOW_COMPONENTS[name] || null;
|
|
58006
|
-
};
|
|
58007
|
-
var componentAdapters = {
|
|
58008
|
-
Input: function Input(stepData, flowData, handlers) {
|
|
58009
|
-
var _stepData$props;
|
|
58010
|
-
return _objectSpread2({
|
|
58011
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58012
|
-
label: ((_stepData$props = stepData.props) === null || _stepData$props === void 0 ? void 0 : _stepData$props.label) || '',
|
|
58013
|
-
value: flowData[stepData.id] || '',
|
|
58014
|
-
onChange: function onChange(e, value) {
|
|
58015
|
-
var _e$target;
|
|
58016
|
-
var inputValue = (e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) != null ? e.target.value : value != null ? value : e;
|
|
58017
|
-
handlers.updateValue(stepData.id, inputValue);
|
|
58018
|
-
},
|
|
58019
|
-
error: handlers.getError(stepData.id)
|
|
58020
|
-
}, stepData.props);
|
|
58021
|
-
},
|
|
58022
|
-
DatePicker: function DatePicker(stepData, flowData, handlers) {
|
|
58023
|
-
var _stepData$validation, _stepData$props2;
|
|
58024
|
-
// Check if this step has been attempted (to conditionally show required validation)
|
|
58025
|
-
// We'll need to pass a function to check this, but for now, don't pass required initially
|
|
58026
|
-
// The validation will be handled by our own error display after attempt
|
|
58027
|
-
var hasRequired = (_stepData$validation = stepData.validation) === null || _stepData$validation === void 0 ? void 0 : _stepData$validation.some(function (r) {
|
|
58028
|
-
return r.type === 'required';
|
|
58029
|
-
});
|
|
58030
|
-
var error = handlers.getError(stepData.id);
|
|
58031
|
-
return _objectSpread2({
|
|
58032
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58033
|
-
label: ((_stepData$props2 = stepData.props) === null || _stepData$props2 === void 0 ? void 0 : _stepData$props2.label) || '',
|
|
58034
|
-
value: flowData[stepData.id] || null,
|
|
58035
|
-
onChange: function onChange(date) {
|
|
58036
|
-
return handlers.updateValue(stepData.id, date);
|
|
58037
|
-
},
|
|
58038
|
-
onError: function onError(error) {
|
|
58039
|
-
return handlers.setError(stepData.id, (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
58040
|
-
},
|
|
58041
|
-
// Only show required validation after user has attempted to submit
|
|
58042
|
-
// Pass required only if there's already an error (meaning it was attempted)
|
|
58043
|
-
required: hasRequired && error ? true : false
|
|
58044
|
-
}, stepData.props);
|
|
58045
|
-
},
|
|
58046
|
-
TimeField: function TimeField(stepData, flowData, handlers) {
|
|
58047
|
-
var _stepData$props3;
|
|
58048
|
-
return _objectSpread2({
|
|
58049
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58050
|
-
label: ((_stepData$props3 = stepData.props) === null || _stepData$props3 === void 0 ? void 0 : _stepData$props3.label) || '',
|
|
58051
|
-
value: flowData[stepData.id] || '',
|
|
58052
|
-
onChange: function onChange(e, value) {
|
|
58053
|
-
var _e$target2;
|
|
58054
|
-
var timeValue = value != null ? value : (e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value) != null ? e.target.value : e;
|
|
58055
|
-
handlers.updateValue(stepData.id, timeValue);
|
|
58056
|
-
},
|
|
58057
|
-
error: handlers.getError(stepData.id)
|
|
58058
|
-
}, stepData.props);
|
|
58059
|
-
},
|
|
58060
|
-
Select: function Select(stepData, flowData, handlers) {
|
|
58061
|
-
var _stepData$props4;
|
|
58062
|
-
// Extract options and other props separately to avoid overriding mapped options
|
|
58063
|
-
var _ref = stepData.props || {},
|
|
58064
|
-
rawOptions = _ref.options,
|
|
58065
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
58066
|
-
var mappedOptions = (rawOptions || []).map(function (opt) {
|
|
58067
|
-
return {
|
|
58068
|
-
key: String(opt.value),
|
|
58069
|
-
text: opt.label || opt.text || String(opt.value)
|
|
58070
|
-
};
|
|
58071
|
-
});
|
|
58072
|
-
return _objectSpread2({
|
|
58073
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58074
|
-
label: ((_stepData$props4 = stepData.props) === null || _stepData$props4 === void 0 ? void 0 : _stepData$props4.label) || '',
|
|
58075
|
-
selectedOption: flowData[stepData.id] || undefined,
|
|
58076
|
-
options: mappedOptions,
|
|
58077
|
-
onChange: function onChange(e, option) {
|
|
58078
|
-
var _option$data;
|
|
58079
|
-
handlers.updateValue(stepData.id, option === null || option === void 0 ? void 0 : option.key);
|
|
58080
|
-
// Auto-navigate if nextStepId exists in option
|
|
58081
|
-
if (option !== null && option !== void 0 && (_option$data = option.data) !== null && _option$data !== void 0 && _option$data.nextStepId) {
|
|
58082
|
-
handlers.goToStep(option.data.nextStepId);
|
|
58083
|
-
}
|
|
58084
|
-
}
|
|
58085
|
-
}, otherProps);
|
|
58086
|
-
},
|
|
58087
|
-
ChoiceGroup: function ChoiceGroup(stepData, flowData, handlers) {
|
|
58088
|
-
var _stepData$props5, _stepData$props6;
|
|
58089
|
-
return _objectSpread2({
|
|
58090
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58091
|
-
label: ((_stepData$props5 = stepData.props) === null || _stepData$props5 === void 0 ? void 0 : _stepData$props5.label) || '',
|
|
58092
|
-
selected: flowData[stepData.id] || undefined,
|
|
58093
|
-
options: (stepData.options || []).map(function (opt) {
|
|
58094
|
-
return {
|
|
58095
|
-
key: String(opt.value),
|
|
58096
|
-
text: opt.label || String(opt.value)
|
|
58097
|
-
};
|
|
58098
|
-
}),
|
|
58099
|
-
onChange: function onChange(e, option) {
|
|
58100
|
-
var _stepData$options;
|
|
58101
|
-
handlers.updateValue(stepData.id, option === null || option === void 0 ? void 0 : option.key);
|
|
58102
|
-
// Auto-navigate if nextStepId exists in option
|
|
58103
|
-
var originalOption = (_stepData$options = stepData.options) === null || _stepData$options === void 0 ? void 0 : _stepData$options.find(function (o) {
|
|
58104
|
-
return String(o.value) === (option === null || option === void 0 ? void 0 : option.key);
|
|
58105
|
-
});
|
|
58106
|
-
if (originalOption !== null && originalOption !== void 0 && originalOption.nextStepId) {
|
|
58107
|
-
handlers.goToStep(originalOption.nextStepId);
|
|
58108
|
-
}
|
|
58109
|
-
},
|
|
58110
|
-
horizontalLayout: ((_stepData$props6 = stepData.props) === null || _stepData$props6 === void 0 ? void 0 : _stepData$props6.horizontalLayout) || false
|
|
58111
|
-
}, stepData.props);
|
|
58112
|
-
},
|
|
58113
|
-
Checkbox: function Checkbox(stepData, flowData, handlers) {
|
|
58114
|
-
var _stepData$props7;
|
|
58115
|
-
return _objectSpread2({
|
|
58116
|
-
// Only use label from props, not from heading (heading is displayed separately)
|
|
58117
|
-
label: ((_stepData$props7 = stepData.props) === null || _stepData$props7 === void 0 ? void 0 : _stepData$props7.label) || '',
|
|
58118
|
-
checked: Boolean(flowData[stepData.id]),
|
|
58119
|
-
onChange: function onChange(e, checked) {
|
|
58120
|
-
return handlers.updateValue(stepData.id, checked);
|
|
58121
|
-
}
|
|
58122
|
-
}, stepData.props);
|
|
58123
|
-
}
|
|
58124
|
-
};
|
|
58125
|
-
var getPropAdapter = function getPropAdapter(componentName) {
|
|
58126
|
-
return componentAdapters[componentName] || null;
|
|
58127
|
-
};
|
|
58128
|
-
var valueFormatters = {
|
|
58129
|
-
DatePicker: function DatePicker(date, stepData) {
|
|
58130
|
-
if (!date) return '';
|
|
58131
|
-
if (date instanceof Date) {
|
|
58132
|
-
return date.toLocaleDateString('en-US', {
|
|
58133
|
-
year: 'numeric',
|
|
58134
|
-
month: 'long',
|
|
58135
|
-
day: 'numeric'
|
|
58136
|
-
});
|
|
58137
|
-
}
|
|
58138
|
-
return String(date);
|
|
58139
|
-
},
|
|
58140
|
-
TimeField: function TimeField(time) {
|
|
58141
|
-
if (!time) return '';
|
|
58142
|
-
return typeof time === 'string' ? time : String(time);
|
|
58143
|
-
},
|
|
58144
|
-
Select: function Select(key, stepData) {
|
|
58145
|
-
var _stepData$props8, _stepData$props8$opti;
|
|
58146
|
-
if (!key) return '';
|
|
58147
|
-
var option = (_stepData$props8 = stepData.props) === null || _stepData$props8 === void 0 ? void 0 : (_stepData$props8$opti = _stepData$props8.options) === null || _stepData$props8$opti === void 0 ? void 0 : _stepData$props8$opti.find(function (opt) {
|
|
58148
|
-
return String(opt.value) === String(key);
|
|
58149
|
-
});
|
|
58150
|
-
return (option === null || option === void 0 ? void 0 : option.label) || (option === null || option === void 0 ? void 0 : option.text) || String(key);
|
|
58151
|
-
},
|
|
58152
|
-
ChoiceGroup: function ChoiceGroup(key, stepData) {
|
|
58153
|
-
var _stepData$options2;
|
|
58154
|
-
if (!key) return '';
|
|
58155
|
-
var option = (_stepData$options2 = stepData.options) === null || _stepData$options2 === void 0 ? void 0 : _stepData$options2.find(function (opt) {
|
|
58156
|
-
return String(opt.value) === String(key);
|
|
58157
|
-
});
|
|
58158
|
-
return (option === null || option === void 0 ? void 0 : option.label) || String(key);
|
|
58159
|
-
},
|
|
58160
|
-
Input: function Input(value) {
|
|
58161
|
-
return String(value || '');
|
|
58162
|
-
},
|
|
58163
|
-
Checkbox: function Checkbox(value, stepData) {
|
|
58164
|
-
// Handle multiple checkboxes (array) or single checkbox (boolean)
|
|
58165
|
-
if (Array.isArray(value)) {
|
|
58166
|
-
if (stepData !== null && stepData !== void 0 && stepData.checkboxOptions && Array.isArray(stepData.checkboxOptions)) {
|
|
58167
|
-
// Map selected values to their labels
|
|
58168
|
-
return value.map(function (v) {
|
|
58169
|
-
var option = stepData.checkboxOptions.find(function (opt) {
|
|
58170
|
-
return String(opt.value || opt.id) === String(v);
|
|
58171
|
-
});
|
|
58172
|
-
return (option === null || option === void 0 ? void 0 : option.label) || (option === null || option === void 0 ? void 0 : option.text) || String(v);
|
|
58173
|
-
}).join(', ');
|
|
58174
|
-
}
|
|
58175
|
-
return value.join(', ');
|
|
58176
|
-
}
|
|
58177
|
-
return value ? 'yes' : 'no';
|
|
58178
|
-
}
|
|
58179
|
-
};
|
|
58180
|
-
var getValueFormatter = function getValueFormatter(componentName) {
|
|
58181
|
-
return valueFormatters[componentName] || function (v) {
|
|
58182
|
-
return String(v || '');
|
|
58183
|
-
};
|
|
58184
|
-
};
|
|
58185
|
-
|
|
58186
|
-
var validateFlowConfig = function validateFlowConfig(flowConfig) {
|
|
58187
|
-
var errors = [];
|
|
58188
|
-
var stepIds = new Set();
|
|
58189
|
-
|
|
58190
|
-
// Validate step IDs are unique
|
|
58191
|
-
flowConfig.steps.forEach(function (step) {
|
|
58192
|
-
if (stepIds.has(step.id)) {
|
|
58193
|
-
errors.push("Duplicate step ID: \"".concat(step.id, "\""));
|
|
58194
|
-
}
|
|
58195
|
-
stepIds.add(step.id);
|
|
58196
|
-
});
|
|
58197
|
-
|
|
58198
|
-
// Validate step references
|
|
58199
|
-
flowConfig.steps.forEach(function (step) {
|
|
58200
|
-
if (step.nextStepId && !stepIds.has(step.nextStepId)) {
|
|
58201
|
-
errors.push("Step \"".concat(step.id, "\" references non-existent step \"").concat(step.nextStepId, "\""));
|
|
58202
|
-
}
|
|
58203
|
-
});
|
|
58204
|
-
|
|
58205
|
-
// Validate component names
|
|
58206
|
-
flowConfig.steps.forEach(function (step) {
|
|
58207
|
-
if (step.component && !getComponent(step.component)) {
|
|
58208
|
-
errors.push("Step \"".concat(step.id, "\" uses unknown component \"").concat(step.component, "\""));
|
|
58209
|
-
}
|
|
58210
|
-
});
|
|
58211
|
-
return errors;
|
|
58212
|
-
};
|
|
58213
|
-
var isLastStep = function isLastStep(currentStep, steps) {
|
|
58214
|
-
return !currentStep.nextStepId || !steps.find(function (s) {
|
|
58215
|
-
return s.id === currentStep.nextStepId;
|
|
58216
|
-
});
|
|
58217
|
-
};
|
|
58218
|
-
var validateStep = function validateStep(step, value) {
|
|
58219
|
-
var errors = [];
|
|
58220
|
-
if (!step.validation) return errors;
|
|
58221
|
-
step.validation.forEach(function (rule) {
|
|
58222
|
-
if (rule.type === 'required') {
|
|
58223
|
-
// For single checkbox, required means it must be true
|
|
58224
|
-
// For multiple checkboxes (checkboxOptions), required means at least one must be selected
|
|
58225
|
-
if (step.component === 'Checkbox') {
|
|
58226
|
-
if (step.checkboxOptions && Array.isArray(step.checkboxOptions)) {
|
|
58227
|
-
// Multiple checkboxes - check if array has at least one item
|
|
58228
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
58229
|
-
errors.push(rule.message || 'Please select at least one option');
|
|
58230
|
-
}
|
|
58231
|
-
} else {
|
|
58232
|
-
// Single checkbox - must be true
|
|
58233
|
-
if (value !== true) {
|
|
58234
|
-
errors.push(rule.message || 'This field is required');
|
|
58235
|
-
}
|
|
58236
|
-
}
|
|
58237
|
-
} else {
|
|
58238
|
-
if (value === null || value === undefined || value === '') {
|
|
58239
|
-
errors.push(rule.message || 'This field is required');
|
|
58240
|
-
}
|
|
58241
|
-
}
|
|
58242
|
-
} else if (rule.type === 'minLength' && typeof value === 'string') {
|
|
58243
|
-
if (value.length < rule.value) {
|
|
58244
|
-
errors.push(rule.message || "Minimum length is ".concat(rule.value));
|
|
58245
|
-
}
|
|
58246
|
-
} else if (rule.type === 'pattern' && rule.value instanceof RegExp) {
|
|
58247
|
-
if (!rule.value.test(String(value))) {
|
|
58248
|
-
errors.push(rule.message || 'Invalid format');
|
|
58249
|
-
}
|
|
58250
|
-
}
|
|
58251
|
-
});
|
|
58252
|
-
return errors;
|
|
58253
|
-
};
|
|
58254
|
-
var formatAnswer = function formatAnswer(template, flowData, steps) {
|
|
58255
|
-
if (!template) return null;
|
|
58256
|
-
return template.replace(/\$\{([^}]+)\}/g, function (match, stepId) {
|
|
58257
|
-
var step = steps.find(function (s) {
|
|
58258
|
-
return s.id === stepId;
|
|
58259
|
-
});
|
|
58260
|
-
if (!step) return match; // Keep placeholder if step not found
|
|
58261
|
-
|
|
58262
|
-
var value = flowData[stepId];
|
|
58263
|
-
if (value === null || value === undefined) return '';
|
|
58264
|
-
var formatter = getValueFormatter(step.component || 'Input');
|
|
58265
|
-
return formatter(value, step);
|
|
58266
|
-
});
|
|
58267
|
-
};
|
|
58268
|
-
var useGuidedFlow = function useGuidedFlow(flowConfig) {
|
|
58269
|
-
var _errors$currentStep$i;
|
|
58270
|
-
var _useState = React.useState(0),
|
|
58271
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58272
|
-
currentStepIndex = _useState2[0],
|
|
58273
|
-
setCurrentStepIndex = _useState2[1];
|
|
58274
|
-
var _useState3 = React.useState({}),
|
|
58275
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
58276
|
-
flowData = _useState4[0],
|
|
58277
|
-
setFlowData = _useState4[1];
|
|
58278
|
-
var _useState5 = React.useState({}),
|
|
58279
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
58280
|
-
errors = _useState6[0],
|
|
58281
|
-
setErrors = _useState6[1];
|
|
58282
|
-
var _useState7 = React.useState([]),
|
|
58283
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
58284
|
-
configErrors = _useState8[0],
|
|
58285
|
-
setConfigErrors = _useState8[1];
|
|
58286
|
-
// Track if the last step was explicitly submitted - must be before early return
|
|
58287
|
-
var _useState9 = React.useState(false),
|
|
58288
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
58289
|
-
lastStepSubmitted = _useState0[0],
|
|
58290
|
-
setLastStepSubmitted = _useState0[1];
|
|
58291
|
-
// Track which steps have been attempted (to show errors only after attempt)
|
|
58292
|
-
var _useState1 = React.useState(new Set()),
|
|
58293
|
-
_useState10 = _slicedToArray(_useState1, 2),
|
|
58294
|
-
attemptedSteps = _useState10[0],
|
|
58295
|
-
setAttemptedSteps = _useState10[1];
|
|
58296
|
-
|
|
58297
|
-
// Validate config on mount
|
|
58298
|
-
React.useEffect(function () {
|
|
58299
|
-
if (flowConfig) {
|
|
58300
|
-
var validationErrors = validateFlowConfig(flowConfig);
|
|
58301
|
-
setConfigErrors(validationErrors);
|
|
58302
|
-
}
|
|
58303
|
-
}, [flowConfig]);
|
|
58304
|
-
if (!flowConfig || !flowConfig.steps || flowConfig.steps.length === 0) {
|
|
58305
|
-
return {
|
|
58306
|
-
currentStep: null,
|
|
58307
|
-
flowData: {},
|
|
58308
|
-
errors: {},
|
|
58309
|
-
isComplete: false,
|
|
58310
|
-
configErrors: ['Invalid flow configuration'],
|
|
58311
|
-
updateValue: function updateValue() {},
|
|
58312
|
-
setError: function setError() {},
|
|
58313
|
-
getError: function getError() {
|
|
58314
|
-
return undefined;
|
|
58315
|
-
},
|
|
58316
|
-
goToNextStep: function () {
|
|
58317
|
-
var _goToNextStep = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
58318
|
-
return _regenerator().w(function (_context) {
|
|
58319
|
-
while (1) switch (_context.n) {
|
|
58320
|
-
case 0:
|
|
58321
|
-
return _context.a(2, false);
|
|
58322
|
-
}
|
|
58323
|
-
}, _callee);
|
|
58324
|
-
}));
|
|
58325
|
-
function goToNextStep() {
|
|
58326
|
-
return _goToNextStep.apply(this, arguments);
|
|
58327
|
-
}
|
|
58328
|
-
return goToNextStep;
|
|
58329
|
-
}(),
|
|
58330
|
-
goToStep: function goToStep() {},
|
|
58331
|
-
submitStep: function () {
|
|
58332
|
-
var _submitStep = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
58333
|
-
return _regenerator().w(function (_context2) {
|
|
58334
|
-
while (1) switch (_context2.n) {
|
|
58335
|
-
case 0:
|
|
58336
|
-
return _context2.a(2, false);
|
|
58337
|
-
}
|
|
58338
|
-
}, _callee2);
|
|
58339
|
-
}));
|
|
58340
|
-
function submitStep() {
|
|
58341
|
-
return _submitStep.apply(this, arguments);
|
|
58342
|
-
}
|
|
58343
|
-
return submitStep;
|
|
58344
|
-
}(),
|
|
58345
|
-
resetFlow: function resetFlow() {},
|
|
58346
|
-
formatAnswer: function formatAnswer() {
|
|
58347
|
-
return null;
|
|
58348
|
-
},
|
|
58349
|
-
validateFlow: function validateFlow() {
|
|
58350
|
-
return [];
|
|
58351
|
-
}
|
|
58352
|
-
};
|
|
58353
|
-
}
|
|
58354
|
-
var currentStep = flowConfig.steps[currentStepIndex];
|
|
58355
|
-
var isLast = currentStep && isLastStep(currentStep, flowConfig.steps);
|
|
58356
|
-
// Check if current step has a value (handle arrays for multiple checkboxes)
|
|
58357
|
-
var currentValue = currentStep ? flowData[currentStep.id] : null;
|
|
58358
|
-
var hasCurrentValue = currentStep && currentValue !== undefined && currentValue !== null && (Array.isArray(currentValue) ? currentValue.length > 0 : currentValue !== '');
|
|
58359
|
-
var hasCurrentErrors = currentStep && ((_errors$currentStep$i = errors[currentStep.id]) === null || _errors$currentStep$i === void 0 ? void 0 : _errors$currentStep$i.length) > 0;
|
|
58360
|
-
// isComplete should only be true when last step is explicitly submitted, not just when value exists
|
|
58361
|
-
var isComplete = lastStepSubmitted && isLast && hasCurrentValue && !hasCurrentErrors;
|
|
58362
|
-
var updateValue = function updateValue(stepId, value) {
|
|
58363
|
-
setFlowData(function (prev) {
|
|
58364
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty$2({}, stepId, value));
|
|
58365
|
-
});
|
|
58366
|
-
// Clear error when value changes
|
|
58367
|
-
setErrors(function (prev) {
|
|
58368
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty$2({}, stepId, []));
|
|
58369
|
-
});
|
|
58370
|
-
};
|
|
58371
|
-
var setError = function setError(stepId, error) {
|
|
58372
|
-
setErrors(function (prev) {
|
|
58373
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty$2({}, stepId, Array.isArray(error) ? error : [error]));
|
|
58374
|
-
});
|
|
58375
|
-
};
|
|
58376
|
-
var getError = function getError(stepId) {
|
|
58377
|
-
// Only return error if this step has been attempted
|
|
58378
|
-
if (!attemptedSteps.has(stepId)) {
|
|
58379
|
-
return undefined;
|
|
58380
|
-
}
|
|
58381
|
-
var stepErrors = errors[stepId];
|
|
58382
|
-
return stepErrors !== null && stepErrors !== void 0 && stepErrors.length ? stepErrors[0] : undefined;
|
|
58383
|
-
};
|
|
58384
|
-
var goToNextStep = /*#__PURE__*/function () {
|
|
58385
|
-
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
58386
|
-
var stepErrors, nextIndex;
|
|
58387
|
-
return _regenerator().w(function (_context3) {
|
|
58388
|
-
while (1) switch (_context3.n) {
|
|
58389
|
-
case 0:
|
|
58390
|
-
if (currentStep) {
|
|
58391
|
-
_context3.n = 1;
|
|
58392
|
-
break;
|
|
58393
|
-
}
|
|
58394
|
-
return _context3.a(2, false);
|
|
58395
|
-
case 1:
|
|
58396
|
-
// Mark this step as attempted
|
|
58397
|
-
setAttemptedSteps(function (prev) {
|
|
58398
|
-
return new Set([].concat(_toConsumableArray(prev), [currentStep.id]));
|
|
58399
|
-
});
|
|
58400
|
-
stepErrors = validateStep(currentStep, flowData[currentStep.id]);
|
|
58401
|
-
if (!(stepErrors.length > 0)) {
|
|
58402
|
-
_context3.n = 2;
|
|
58403
|
-
break;
|
|
58404
|
-
}
|
|
58405
|
-
setError(currentStep.id, stepErrors);
|
|
58406
|
-
return _context3.a(2, false);
|
|
58407
|
-
case 2:
|
|
58408
|
-
if (!isLastStep(currentStep, flowConfig.steps)) {
|
|
58409
|
-
_context3.n = 3;
|
|
58410
|
-
break;
|
|
58411
|
-
}
|
|
58412
|
-
setLastStepSubmitted(true);
|
|
58413
|
-
return _context3.a(2, true);
|
|
58414
|
-
case 3:
|
|
58415
|
-
if (currentStep.nextStepId) {
|
|
58416
|
-
nextIndex = flowConfig.steps.findIndex(function (s) {
|
|
58417
|
-
return s.id === currentStep.nextStepId;
|
|
58418
|
-
});
|
|
58419
|
-
if (nextIndex !== -1) {
|
|
58420
|
-
setCurrentStepIndex(nextIndex);
|
|
58421
|
-
}
|
|
58422
|
-
}
|
|
58423
|
-
return _context3.a(2, true);
|
|
58424
|
-
}
|
|
58425
|
-
}, _callee3);
|
|
58426
|
-
}));
|
|
58427
|
-
return function goToNextStep() {
|
|
58428
|
-
return _ref.apply(this, arguments);
|
|
58429
|
-
};
|
|
58430
|
-
}();
|
|
58431
|
-
var goToStep = function goToStep(stepId) {
|
|
58432
|
-
var stepIndex = flowConfig.steps.findIndex(function (s) {
|
|
58433
|
-
return s.id === stepId;
|
|
58434
|
-
});
|
|
58435
|
-
if (stepIndex !== -1) {
|
|
58436
|
-
setCurrentStepIndex(stepIndex);
|
|
58437
|
-
}
|
|
58438
|
-
};
|
|
58439
|
-
var submitStep = /*#__PURE__*/function () {
|
|
58440
|
-
var _ref2 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
58441
|
-
return _regenerator().w(function (_context4) {
|
|
58442
|
-
while (1) switch (_context4.n) {
|
|
58443
|
-
case 0:
|
|
58444
|
-
_context4.n = 1;
|
|
58445
|
-
return goToNextStep();
|
|
58446
|
-
case 1:
|
|
58447
|
-
return _context4.a(2, _context4.v);
|
|
58448
|
-
}
|
|
58449
|
-
}, _callee4);
|
|
58450
|
-
}));
|
|
58451
|
-
return function submitStep() {
|
|
58452
|
-
return _ref2.apply(this, arguments);
|
|
58453
|
-
};
|
|
58454
|
-
}();
|
|
58455
|
-
var resetFlow = function resetFlow() {
|
|
58456
|
-
setCurrentStepIndex(0);
|
|
58457
|
-
setFlowData({});
|
|
58458
|
-
setErrors({});
|
|
58459
|
-
setLastStepSubmitted(false);
|
|
58460
|
-
setAttemptedSteps(new Set());
|
|
58461
|
-
};
|
|
58462
|
-
var formatAnswerString = function formatAnswerString() {
|
|
58463
|
-
return formatAnswer(flowConfig.answer, flowData, flowConfig.steps);
|
|
58464
|
-
};
|
|
58465
|
-
return {
|
|
58466
|
-
currentStep: currentStep,
|
|
58467
|
-
flowData: flowData,
|
|
58468
|
-
errors: errors,
|
|
58469
|
-
isComplete: isComplete,
|
|
58470
|
-
configErrors: configErrors,
|
|
58471
|
-
updateValue: updateValue,
|
|
58472
|
-
setError: setError,
|
|
58473
|
-
getError: getError,
|
|
58474
|
-
goToNextStep: goToNextStep,
|
|
58475
|
-
goToStep: goToStep,
|
|
58476
|
-
submitStep: submitStep,
|
|
58477
|
-
resetFlow: resetFlow,
|
|
58478
|
-
formatAnswer: formatAnswerString,
|
|
58479
|
-
validateFlow: function validateFlow() {
|
|
58480
|
-
return validateFlowConfig(flowConfig);
|
|
58481
|
-
}
|
|
58482
|
-
};
|
|
58483
|
-
};
|
|
58484
|
-
|
|
58485
|
-
var css_248z$3 = ".utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n box-shadow: 0 0px 6px #c1c1c1;\r\n overflow: hidden;\r\n display: flex;\r\n flex-direction: column;\r\n background: #fff;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--spinner {\r\n position: absolute;\r\n background: rgba(0, 0, 0, 0.5);\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader {\r\n /* background: #1d5ab9; */\r\n display: flex;\r\n justify-content: space-between;\r\n padding: 15px;\r\n align-items: center;\r\n border-bottom: 1px solid #d1d1d1;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--title {\r\n font-size: 20px;\r\n font-weight: 700;\r\n line-height: 24px;\r\n /* color: #fff; */\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody {\r\n flex: 1;\r\n padding: 12px;\r\n overflow: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatVisible {\r\n padding-top: 56px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer {\r\n padding: 8px 0;\r\n border-bottom: 1px solid #d1d1d1;\r\n display: flex;\r\n justify-content: end;\r\n align-items: center;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatVisible .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer {\r\n position: absolute;\r\n width: calc(100% - 72px);\r\n top: 57px;\r\n background: #fff;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messagesContainer {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 16px;\r\n gap: 16px;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatButton,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatButton {\r\n display: flex;\r\n align-items: center;\r\n grid-gap: 6px;\r\n gap: 6px;\r\n cursor: pointer;\r\n border: 1px solid #d1d1d1;\r\n border-radius: 4px;\r\n padding: 6px 12px;\r\n font-weight: 600;\r\n font-size: 14px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message {\r\n display: flex;\r\n align-items: flex-start;\r\n grid-gap: 10px;\r\n gap: 10px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--user {\r\n justify-content: flex-end;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--welcomeQuestion {\r\n margin-top: 5px;\r\n margin-left: 36px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions {\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionWrapper {\r\n display: flex;\r\n flex-direction: row-reverse;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionContainer {\r\n max-width: 95%;\r\n word-break: break-all;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestion {\r\n border: 1px solid #3261bd;\r\n border-radius: 16px;\r\n padding: 6px 8px;\r\n font-size: 14px;\r\n color: #3261bd;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestion:hover {\r\n background-color: #f5f5f5;\r\n border-color: #3261bd;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--agentIcon {\r\n width: 26px;\r\n border-radius: 50%;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble {\r\n background-color: #f5f5f5;\r\n border-radius: 0px 12px 12px 12px;\r\n padding: 10px 15px;\r\n max-width: 85%;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--error {\r\n border: 1px solid #f1bbbc;\r\n background: #fdf6f6;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--user .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble {\r\n background: #3261bd;\r\n color: #fff;\r\n border-radius: 12px 0px 12px 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--feedbackContainer {\r\n display: flex;\r\n grid-gap: 8px;\r\n gap: 8px;\r\n margin-top: 10px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--feedbackContainer i {\r\n cursor: pointer;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p {\r\n margin: 0;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p a {\r\n color: #1e54ad;\r\n text-decoration: underline;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p ol,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p ul {\r\n padding-left: 15px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowFooter {\r\n border-top: 1px solid #d1d1d1;\r\n padding: 16px 24px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer {\r\n display: flex;\r\n align-items: center;\r\n border: 1px solid #616161;\r\n border-radius: 4px;\r\n padding: 6px 8px;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--disabled {\r\n background-color: #fafafa;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input {\r\n border: none;\r\n outline: none;\r\n flex-grow: 1;\r\n font-size: 14px !important;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-webkit-input-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-moz-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-ms-input-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::placeholder {\r\n color: #757575;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 10px;\r\n width: 75px;\r\n background-color: #f5f5f5;\r\n border-radius: 0px 12px 12px 12px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot {\r\n width: 8px;\r\n height: 8px;\r\n margin: 0 3px;\r\n background-color: #3261bd;\r\n border-radius: 50%;\r\n display: inline-block;\r\n -webkit-animation: utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce 1.2s infinite ease-in-out both;\r\n animation: utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce 1.2s infinite ease-in-out both;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot:nth-child(1) {\r\n -webkit-animation-delay: -0.32s;\r\n animation-delay: -0.32s;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot:nth-child(2) {\r\n -webkit-animation-delay: -0.16s;\r\n animation-delay: -0.16s;\r\n}\r\n\r\n@-webkit-keyframes utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce {\r\n 0%,\r\n 80%,\r\n 100% {\r\n -webkit-transform: scale(0);\r\n transform: scale(0);\r\n }\r\n 40% {\r\n -webkit-transform: scale(1);\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n@keyframes utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce {\r\n 0%,\r\n 80%,\r\n 100% {\r\n -webkit-transform: scale(0);\r\n transform: scale(0);\r\n }\r\n 40% {\r\n -webkit-transform: scale(1);\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarWrapper {\r\n height: 100vh;\r\n background-color: rgba(0,0,0,.5);\r\n display: flex;\r\n justify-content: flex-end;\r\n transition: max-width 0.25s ease-in-out, width 0.25s ease-in-out, opacity 0.25s ease-in-out;\r\n overflow: hidden;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarWrapper.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--visible {\r\n max-width: 400px;\r\n width: 400px;\r\n opacity: 1;\r\n pointer-events: auto;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarWrapper.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--hidden {\r\n max-width: 0px;\r\n width: 0px;\r\n opacity: 0;\r\n pointer-events: none;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarPanel {\r\n width: 400px;\r\n max-width: 400px;\r\n height: calc(100vh - 48px);\r\n background-color: white;\r\n overflow-y: auto;\r\n transition: -webkit-transform 0.25s ease-in-out;\r\n transition: transform 0.25s ease-in-out;\r\n transition: transform 0.25s ease-in-out, -webkit-transform 0.25s ease-in-out;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarPanel.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--visible {\r\n -webkit-transform: translateX(0);\r\n transform: translateX(0);\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarPanel.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--hidden {\r\n -webkit-transform: translateX(100%);\r\n transform: translateX(100%);\r\n}\r\n\r\n/* Flow Step Styles */\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--flowStepContainer {\r\n padding: 16px;\r\n margin: 12px 0;\r\n background-color: #fff;\r\n border-radius: 8px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepHeading {\r\n font-size: 16px;\r\n font-weight: 600;\r\n margin: 0 0 12px 0;\r\n color: #333;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepDescription {\r\n font-size: 14px;\r\n color: #666;\r\n margin: 0 0 16px 0;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionsContainer {\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n margin-top: 12px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionButton {\r\n display: flex;\r\n align-items: center;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n padding: 12px 16px;\r\n border: 1px solid #d1d1d1;\r\n border-radius: 8px;\r\n background-color: #fff;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionButton:hover {\r\n background-color: #f5f5f5;\r\n border-color: #3261bd;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper {\r\n margin: 16px 0;\r\n}\r\n\r\n/* Apply border-radius to Input component */\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper input,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-TextField-fieldGroup,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-TextField-fieldGroup input {\r\n border-radius: 8px !important;\r\n}\r\n\r\n/* Apply border-radius to Select component (Dropdown) */\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Dropdown-container,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Dropdown,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Dropdown-title,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Dropdown-titleIsPlaceHolder {\r\n border-radius: 8px !important;\r\n}\r\n\r\n/* Apply border-radius to Button component */\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper button,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Button,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Button--primary,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper .ms-Button--default {\r\n border-radius: 4px !important;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--validationError {\r\n color: #d32f2f;\r\n font-size: 12px;\r\n margin-top: 8px;\r\n padding: 8px;\r\n background-color: #fdf6f6;\r\n border: 1px solid #f1bbbc;\r\n border-radius: 4px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--renderError {\r\n color: #d32f2f;\r\n font-size: 12px;\r\n margin-top: 8px;\r\n padding: 8px;\r\n background-color: #fff3cd;\r\n border: 1px solid #ffc107;\r\n border-radius: 4px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback {\r\n padding: 16px;\r\n background-color: #fff3cd;\r\n border: 1px solid #ffc107;\r\n border-radius: 4px;\r\n color: #856404;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback p {\r\n margin: 0;\r\n font-size: 14px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions {\r\n margin-top: 16px;\r\n display: flex;\r\n justify-content: flex-end;\r\n}\r\n\r\n/* Apply border-radius to Button component in stepActions */\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions button,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions .ms-Button,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions .ms-Button--primary,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions .ms-Button--default {\r\n border-radius: 4px !important;\r\n}\r\n";
|
|
57949
|
+
var css_248z$3 = ".utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper {\r\n position: absolute;\r\n /* right: 50px;\r\n bottom: 30px; */\r\n z-index: 9999;\r\n height: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatIcon {\r\n position: absolute;\r\n right: 0;\r\n bottom: 0px;\r\n background: #1d5ab9;\r\n border-radius: 50%;\r\n width: 60px;\r\n height: 60px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n border: 5px solid #fff;\r\n box-shadow: 0 0px 6px #c1c1c1;\r\n cursor: pointer;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n position: absolute;\r\n /* right: 0;\r\n bottom: 68px; */\r\n box-shadow: 0 0px 6px #c1c1c1;\r\n height: 600px;\r\n width: 500px;\r\n border-radius: 8px;\r\n overflow: hidden;\r\n display: flex;\r\n flex-direction: column;\r\n background: #fff;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--spinner{\r\n position: absolute;\r\n background: rgba(0, 0, 0, 0.5);\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader {\r\n background: #1d5ab9;\r\n display: flex;\r\n justify-content: space-between;\r\n padding: 15px;\r\n align-items: center;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--title {\r\n font-size: 16px;\r\n font-weight: 600;\r\n line-height: 22px;\r\n color: #fff;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody {\r\n flex: 1;\r\n padding: 12px 36px;\r\n overflow: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatVisible {\r\n padding-top: 56px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer {\r\n padding: 8px 0;\r\n border-bottom: 1px solid #d1d1d1;\r\n display: flex;\r\n justify-content: end;\r\n align-items: center;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatVisible .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer {\r\n position: absolute;\r\n width: calc(100% - 72px);\r\n top: 57px;\r\n background: #fff;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messagesContainer {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 16px;\r\n gap: 16px;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatButton {\r\n display: flex;\r\n align-items: center;\r\n grid-gap: 6px;\r\n gap: 6px;\r\n cursor: pointer;\r\n border: 1px solid #d1d1d1;\r\n border-radius: 4px;\r\n padding: 6px 12px;\r\n font-weight: 600;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message {\r\n display: flex;\r\n align-items: flex-start;\r\n grid-gap: 10px;\r\n gap: 10px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--user {\r\n justify-content: flex-end;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--welcomeQuestion {\r\n margin-top: 5px;\r\n margin-left: 36px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions {\r\n display: flex;\r\n flex-direction: column;\r\n grid-gap: 12px;\r\n gap: 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionWrapper {\r\n display: flex;\r\n flex-direction: row-reverse;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionContainer {\r\n max-width: 95%;\r\n word-break: break-all;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestion {\r\n border: 1px solid #3261bd;\r\n border-radius: 16px;\r\n padding: 6px 8px;\r\n font-size: 14px;\r\n color: #3261bd;\r\n cursor: pointer;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--agentIcon {\r\n width: 26px;\r\n border-radius: 50%;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble {\r\n background-color: #f5f5f5;\r\n border-radius: 0px 12px 12px 12px;\r\n padding: 10px 15px;\r\n max-width: 85%;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--error {\r\n border: 1px solid #f1bbbc;\r\n background: #fdf6f6;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--user .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble {\r\n background: #3261bd;\r\n color: #fff;\r\n border-radius: 12px 0px 12px 12px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--feedbackContainer {\r\n display: flex;\r\n grid-gap: 8px;\r\n gap: 8px;\r\n margin-top: 10px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--feedbackContainer i {\r\n cursor: pointer;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p {\r\n margin: 0;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p a {\r\n color: #1e54ad;\r\n text-decoration: underline;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p ol,\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowBody .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble p ul {\r\n padding-left: 15px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowFooter {\r\n border-top: 1px solid #d1d1d1;\r\n padding: 16px 24px;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer {\r\n display: flex;\r\n align-items: center;\r\n border: 1px solid #ddd;\r\n border-radius: 12px;\r\n padding: 10px 15px;\r\n cursor: auto;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--disabled {\r\n background-color: #fafafa;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input {\r\n border: none;\r\n outline: none;\r\n flex-grow: 1;\r\n font-size: 14px !important;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-webkit-input-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-moz-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::-ms-input-placeholder {\r\n color: #757575;\r\n}\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--inputContainer input:disabled::placeholder {\r\n color: #757575;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 10px;\r\n width: 75px;\r\n background-color: #f5f5f5;\r\n border-radius: 0px 12px 12px 12px;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot {\r\n width: 8px;\r\n height: 8px;\r\n margin: 0 3px;\r\n background-color: #3261bd;\r\n border-radius: 50%;\r\n display: inline-block;\r\n -webkit-animation: utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce 1.2s infinite ease-in-out both;\r\n animation: utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce 1.2s infinite ease-in-out both;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot:nth-child(1) {\r\n -webkit-animation-delay: -0.32s;\r\n animation-delay: -0.32s;\r\n}\r\n\r\n.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot:nth-child(2) {\r\n -webkit-animation-delay: -0.16s;\r\n animation-delay: -0.16s;\r\n}\r\n\r\n@-webkit-keyframes utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce {\r\n 0%,\r\n 80%,\r\n 100% {\r\n -webkit-transform: scale(0);\r\n transform: scale(0);\r\n }\r\n 40% {\r\n -webkit-transform: scale(1);\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n@keyframes utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce {\r\n 0%,\r\n 80%,\r\n 100% {\r\n -webkit-transform: scale(0);\r\n transform: scale(0);\r\n }\r\n 40% {\r\n -webkit-transform: scale(1);\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n@media (max-width: 575px) {\r\n /* .mihelpAgentWrapper {\r\n right: 20px;\r\n bottom: 100px;\r\n } */\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper.utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--iphoneChrome {\r\n bottom: 125px;\r\n }\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 450px;\r\n }\r\n}\r\n\r\n@media (max-width: 475px) {\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 400px;\r\n }\r\n}\r\n\r\n@media (max-width: 425px) {\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 350px;\r\n }\r\n}\r\n\r\n@media (max-width: 375px) {\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 325px;\r\n }\r\n}\r\n\r\n@media (max-width: 350px) {\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 300px;\r\n }\r\n}\r\n\r\n@media (max-width: 325px) {\r\n .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow {\r\n width: 275px;\r\n }\r\n}\r\n";
|
|
58486
57950
|
styleInject(css_248z$3);
|
|
58487
57951
|
|
|
58488
|
-
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
58489
|
-
function ErrorBoundary(props) {
|
|
58490
|
-
var _this;
|
|
58491
|
-
_classCallCheck$3(this, ErrorBoundary);
|
|
58492
|
-
_this = _callSuper(this, ErrorBoundary, [props]);
|
|
58493
|
-
_this.state = {
|
|
58494
|
-
hasError: false,
|
|
58495
|
-
error: null
|
|
58496
|
-
};
|
|
58497
|
-
return _this;
|
|
58498
|
-
}
|
|
58499
|
-
_inherits$2(ErrorBoundary, _React$Component);
|
|
58500
|
-
return _createClass$2(ErrorBoundary, [{
|
|
58501
|
-
key: "componentDidCatch",
|
|
58502
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
58503
|
-
if (this.props.onError) {
|
|
58504
|
-
this.props.onError(error, errorInfo);
|
|
58505
|
-
}
|
|
58506
|
-
}
|
|
58507
|
-
}, {
|
|
58508
|
-
key: "render",
|
|
58509
|
-
value: function render() {
|
|
58510
|
-
if (this.state.hasError) {
|
|
58511
|
-
return this.props.fallback || /*#__PURE__*/React__default["default"].createElement("div", null, "Something went wrong");
|
|
58512
|
-
}
|
|
58513
|
-
return this.props.children;
|
|
58514
|
-
}
|
|
58515
|
-
}], [{
|
|
58516
|
-
key: "getDerivedStateFromError",
|
|
58517
|
-
value: function getDerivedStateFromError(error) {
|
|
58518
|
-
return {
|
|
58519
|
-
hasError: true,
|
|
58520
|
-
error: error
|
|
58521
|
-
};
|
|
58522
|
-
}
|
|
58523
|
-
}]);
|
|
58524
|
-
}(React__default["default"].Component);
|
|
58525
|
-
var FlowStepRenderer = function FlowStepRenderer(_ref) {
|
|
58526
|
-
var step = _ref.step,
|
|
58527
|
-
flowData = _ref.flowData,
|
|
58528
|
-
handlers = _ref.handlers,
|
|
58529
|
-
isComplete = _ref.isComplete;
|
|
58530
|
-
var _useState = React.useState(null),
|
|
58531
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58532
|
-
renderError = _useState2[0],
|
|
58533
|
-
setRenderError = _useState2[1];
|
|
58534
|
-
var componentRef = React.useRef(null);
|
|
58535
|
-
if (!step) return null;
|
|
58536
|
-
|
|
58537
|
-
// Question step (options only, no component)
|
|
58538
|
-
if (step.options && !step.component) {
|
|
58539
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58540
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--flowStepContainer"
|
|
58541
|
-
}, step.heading && /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
58542
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepHeading"
|
|
58543
|
-
}, step.heading), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58544
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionsContainer"
|
|
58545
|
-
}, step.options.map(function (option, index) {
|
|
58546
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58547
|
-
key: index,
|
|
58548
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionButton",
|
|
58549
|
-
onClick: function onClick() {
|
|
58550
|
-
handlers.updateValue(step.id, option.value);
|
|
58551
|
-
if (option.nextStepId) {
|
|
58552
|
-
handlers.goToStep(option.nextStepId);
|
|
58553
|
-
} else if (step.nextStepId) {
|
|
58554
|
-
handlers.goToStep(step.nextStepId);
|
|
58555
|
-
}
|
|
58556
|
-
}
|
|
58557
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", null, option.label));
|
|
58558
|
-
})));
|
|
58559
|
-
}
|
|
58560
|
-
|
|
58561
|
-
// Multiple checkboxes step (special case)
|
|
58562
|
-
if (step.component === 'Checkbox' && step.checkboxOptions && Array.isArray(step.checkboxOptions)) {
|
|
58563
|
-
var Checkbox = getComponent('Checkbox');
|
|
58564
|
-
var selectedValues = flowData[step.id] || [];
|
|
58565
|
-
var isArray = Array.isArray(selectedValues);
|
|
58566
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58567
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--flowStepContainer"
|
|
58568
|
-
}, step.heading && /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
58569
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepHeading"
|
|
58570
|
-
}, step.heading), step.description && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
58571
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepDescription"
|
|
58572
|
-
}, step.description), /*#__PURE__*/React__default["default"].createElement("form", {
|
|
58573
|
-
onSubmit: function onSubmit(e) {
|
|
58574
|
-
e.preventDefault();
|
|
58575
|
-
e.stopPropagation();
|
|
58576
|
-
return false;
|
|
58577
|
-
},
|
|
58578
|
-
onKeyDown: function onKeyDown(e) {
|
|
58579
|
-
if (e.key === 'Enter') {
|
|
58580
|
-
e.preventDefault();
|
|
58581
|
-
e.stopPropagation();
|
|
58582
|
-
}
|
|
58583
|
-
},
|
|
58584
|
-
style: {
|
|
58585
|
-
display: 'contents'
|
|
58586
|
-
}
|
|
58587
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58588
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper"
|
|
58589
|
-
}, /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, {
|
|
58590
|
-
fallback: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58591
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback"
|
|
58592
|
-
}, /*#__PURE__*/React__default["default"].createElement("p", null, "Error rendering checkboxes. Please try again.")),
|
|
58593
|
-
onError: function onError(error) {
|
|
58594
|
-
console.error('Checkbox render error:', error);
|
|
58595
|
-
setRenderError(error.message);
|
|
58596
|
-
}
|
|
58597
|
-
}, step.checkboxOptions.map(function (option, index) {
|
|
58598
|
-
var optionValue = option.value || option.id || String(index);
|
|
58599
|
-
var isChecked = isArray ? selectedValues.includes(optionValue) : false;
|
|
58600
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58601
|
-
key: index,
|
|
58602
|
-
style: {
|
|
58603
|
-
marginBottom: '12px'
|
|
58604
|
-
}
|
|
58605
|
-
}, /*#__PURE__*/React__default["default"].createElement(Checkbox, _extends$1({
|
|
58606
|
-
label: option.label || option.text || String(optionValue),
|
|
58607
|
-
checked: isChecked,
|
|
58608
|
-
onChange: function onChange(e, checked) {
|
|
58609
|
-
var currentValues = isArray ? _toConsumableArray(selectedValues) : [];
|
|
58610
|
-
var newValues;
|
|
58611
|
-
if (checked) {
|
|
58612
|
-
newValues = [].concat(_toConsumableArray(currentValues), [optionValue]);
|
|
58613
|
-
} else {
|
|
58614
|
-
newValues = currentValues.filter(function (v) {
|
|
58615
|
-
return v !== optionValue;
|
|
58616
|
-
});
|
|
58617
|
-
}
|
|
58618
|
-
handlers.updateValue(step.id, newValues);
|
|
58619
|
-
}
|
|
58620
|
-
}, option.props || {})));
|
|
58621
|
-
}))), handlers.getError(step.id) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58622
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--validationError"
|
|
58623
|
-
}, handlers.getError(step.id)), renderError && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58624
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--renderError"
|
|
58625
|
-
}, renderError), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58626
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions"
|
|
58627
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Button, {
|
|
58628
|
-
primary: true,
|
|
58629
|
-
type: "button",
|
|
58630
|
-
onClick: (/*#__PURE__*/function () {
|
|
58631
|
-
var _ref2 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(e) {
|
|
58632
|
-
return _regenerator().w(function (_context) {
|
|
58633
|
-
while (1) switch (_context.n) {
|
|
58634
|
-
case 0:
|
|
58635
|
-
e.preventDefault();
|
|
58636
|
-
e.stopPropagation();
|
|
58637
|
-
_context.n = 1;
|
|
58638
|
-
return handlers.submitStep();
|
|
58639
|
-
case 1:
|
|
58640
|
-
_context.v;
|
|
58641
|
-
case 2:
|
|
58642
|
-
return _context.a(2);
|
|
58643
|
-
}
|
|
58644
|
-
}, _callee);
|
|
58645
|
-
}));
|
|
58646
|
-
return function (_x) {
|
|
58647
|
-
return _ref2.apply(this, arguments);
|
|
58648
|
-
};
|
|
58649
|
-
}()),
|
|
58650
|
-
disabled: isComplete
|
|
58651
|
-
}, isComplete ? 'Complete' : step.nextStepId ? 'Continue' : 'Submit'))));
|
|
58652
|
-
}
|
|
58653
|
-
|
|
58654
|
-
// Form step (with component)
|
|
58655
|
-
if (step.component) {
|
|
58656
|
-
var Component = getComponent(step.component);
|
|
58657
|
-
if (!Component) {
|
|
58658
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58659
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback"
|
|
58660
|
-
}, /*#__PURE__*/React__default["default"].createElement("p", null, "Error: Component \"", step.component, "\" not found"));
|
|
58661
|
-
}
|
|
58662
|
-
var adapter = getPropAdapter(step.component);
|
|
58663
|
-
if (!adapter) {
|
|
58664
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58665
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback"
|
|
58666
|
-
}, /*#__PURE__*/React__default["default"].createElement("p", null, "Error: No adapter found for component \"", step.component, "\""));
|
|
58667
|
-
}
|
|
58668
|
-
var adaptedProps;
|
|
58669
|
-
try {
|
|
58670
|
-
adaptedProps = adapter(step, flowData, handlers);
|
|
58671
|
-
} catch (error) {
|
|
58672
|
-
console.error('Error adapting props:', error);
|
|
58673
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58674
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback"
|
|
58675
|
-
}, /*#__PURE__*/React__default["default"].createElement("p", null, "Error: Failed to prepare component props"));
|
|
58676
|
-
}
|
|
58677
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58678
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--flowStepContainer"
|
|
58679
|
-
}, step.heading && /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
58680
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepHeading"
|
|
58681
|
-
}, step.heading), step.description && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
58682
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepDescription"
|
|
58683
|
-
}, step.description), /*#__PURE__*/React__default["default"].createElement("form", {
|
|
58684
|
-
onSubmit: function onSubmit(e) {
|
|
58685
|
-
e.preventDefault();
|
|
58686
|
-
e.stopPropagation();
|
|
58687
|
-
return false;
|
|
58688
|
-
},
|
|
58689
|
-
onKeyDown: function onKeyDown(e) {
|
|
58690
|
-
// Prevent Enter key from submitting form
|
|
58691
|
-
if (e.key === 'Enter') {
|
|
58692
|
-
e.preventDefault();
|
|
58693
|
-
e.stopPropagation();
|
|
58694
|
-
}
|
|
58695
|
-
},
|
|
58696
|
-
style: {
|
|
58697
|
-
display: 'contents'
|
|
58698
|
-
}
|
|
58699
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58700
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper"
|
|
58701
|
-
}, /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, {
|
|
58702
|
-
fallback: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58703
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback"
|
|
58704
|
-
}, /*#__PURE__*/React__default["default"].createElement("p", null, "Error rendering component. Please try again.")),
|
|
58705
|
-
onError: function onError(error) {
|
|
58706
|
-
console.error('Component render error:', error);
|
|
58707
|
-
setRenderError(error.message);
|
|
58708
|
-
}
|
|
58709
|
-
}, /*#__PURE__*/React__default["default"].createElement(Component, _extends$1({
|
|
58710
|
-
ref: componentRef
|
|
58711
|
-
}, adaptedProps, {
|
|
58712
|
-
"aria-label": step.heading || "Step: ".concat(step.id),
|
|
58713
|
-
onKeyDown: function onKeyDown(e) {
|
|
58714
|
-
// Prevent Enter key from submitting when typing in input
|
|
58715
|
-
if (e.key === 'Enter' && e.target.tagName !== 'BUTTON') {
|
|
58716
|
-
e.preventDefault();
|
|
58717
|
-
e.stopPropagation();
|
|
58718
|
-
}
|
|
58719
|
-
}
|
|
58720
|
-
})))), handlers.getError(step.id) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58721
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--validationError"
|
|
58722
|
-
}, handlers.getError(step.id)), renderError && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58723
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--renderError"
|
|
58724
|
-
}, renderError), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58725
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions"
|
|
58726
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Button, {
|
|
58727
|
-
primary: true,
|
|
58728
|
-
type: "button",
|
|
58729
|
-
onClick: (/*#__PURE__*/function () {
|
|
58730
|
-
var _ref3 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2(e) {
|
|
58731
|
-
return _regenerator().w(function (_context2) {
|
|
58732
|
-
while (1) switch (_context2.n) {
|
|
58733
|
-
case 0:
|
|
58734
|
-
e.preventDefault();
|
|
58735
|
-
e.stopPropagation();
|
|
58736
|
-
_context2.n = 1;
|
|
58737
|
-
return handlers.submitStep();
|
|
58738
|
-
case 1:
|
|
58739
|
-
_context2.v;
|
|
58740
|
-
// If this is the last step and validation passed, flow will complete
|
|
58741
|
-
case 2:
|
|
58742
|
-
return _context2.a(2);
|
|
58743
|
-
}
|
|
58744
|
-
}, _callee2);
|
|
58745
|
-
}));
|
|
58746
|
-
return function (_x2) {
|
|
58747
|
-
return _ref3.apply(this, arguments);
|
|
58748
|
-
};
|
|
58749
|
-
}()),
|
|
58750
|
-
disabled: isComplete
|
|
58751
|
-
}, isComplete ? 'Complete' : step.nextStepId ? 'Continue' : 'Submit'))));
|
|
58752
|
-
}
|
|
58753
|
-
return null;
|
|
58754
|
-
};
|
|
58755
|
-
|
|
58756
57952
|
var _styleModuleImportMap$2 = {
|
|
58757
57953
|
"./MiHelpAgent.css": {
|
|
57954
|
+
"mihelpAgentWrapper": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--mihelpAgentWrapper",
|
|
57955
|
+
"chatIcon": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatIcon",
|
|
58758
57956
|
"chatWindow": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow",
|
|
58759
57957
|
"spinner": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--spinner",
|
|
58760
57958
|
"chatWindowHeader": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader",
|
|
@@ -58781,20 +57979,7 @@ var _styleModuleImportMap$2 = {
|
|
|
58781
57979
|
"chatbotLoader": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatbotLoader",
|
|
58782
57980
|
"dot": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--dot",
|
|
58783
57981
|
"bounce": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--bounce",
|
|
58784
|
-
"
|
|
58785
|
-
"visible": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--visible",
|
|
58786
|
-
"hidden": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--hidden",
|
|
58787
|
-
"sidebarPanel": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--sidebarPanel",
|
|
58788
|
-
"flowStepContainer": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--flowStepContainer",
|
|
58789
|
-
"stepHeading": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepHeading",
|
|
58790
|
-
"stepDescription": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepDescription",
|
|
58791
|
-
"optionsContainer": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionsContainer",
|
|
58792
|
-
"optionButton": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--optionButton",
|
|
58793
|
-
"componentWrapper": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--componentWrapper",
|
|
58794
|
-
"validationError": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--validationError",
|
|
58795
|
-
"renderError": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--renderError",
|
|
58796
|
-
"errorFallback": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--errorFallback",
|
|
58797
|
-
"stepActions": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--stepActions"
|
|
57982
|
+
"iphoneChrome": "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--iphoneChrome"
|
|
58798
57983
|
}
|
|
58799
57984
|
};
|
|
58800
57985
|
var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
@@ -58811,66 +57996,284 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
58811
57996
|
contextTopMessagesCount = _ref$contextTopMessag === void 0 ? 10 : _ref$contextTopMessag,
|
|
58812
57997
|
_ref$contextChunks = _ref.contextChunks,
|
|
58813
57998
|
contextChunks = _ref$contextChunks === void 0 ? 30 : _ref$contextChunks,
|
|
58814
|
-
mihelpAgentRef = _ref.mihelpAgentRef
|
|
58815
|
-
_ref$chatBotVisible = _ref.chatBotVisible,
|
|
58816
|
-
chatBotVisible = _ref$chatBotVisible === void 0 ? false : _ref$chatBotVisible,
|
|
58817
|
-
setChatBotVisible = _ref.setChatBotVisible,
|
|
58818
|
-
_ref$notificationsCou = _ref.notificationsCount,
|
|
58819
|
-
notificationsCount = _ref$notificationsCou === void 0 ? 0 : _ref$notificationsCou,
|
|
58820
|
-
_ref$sideBarTopValue = _ref.sideBarTopValue,
|
|
58821
|
-
sideBarTopValue = _ref$sideBarTopValue === void 0 ? 0 : _ref$sideBarTopValue;
|
|
57999
|
+
mihelpAgentRef = _ref.mihelpAgentRef;
|
|
58822
58000
|
var _useState = React.useState(false),
|
|
58823
58001
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58824
|
-
|
|
58825
|
-
|
|
58002
|
+
showChatWindow = _useState2[0],
|
|
58003
|
+
setShowChatWindow = _useState2[1];
|
|
58826
58004
|
var _useState3 = React.useState(false),
|
|
58827
58005
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
58828
|
-
|
|
58829
|
-
|
|
58006
|
+
isLoading = _useState4[0],
|
|
58007
|
+
setIsLoading = _useState4[1];
|
|
58830
58008
|
var _useState5 = React.useState(false),
|
|
58831
58009
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
58832
|
-
|
|
58833
|
-
_useState6[1];
|
|
58010
|
+
isFeedbackLoading = _useState6[0],
|
|
58011
|
+
setIsFeedbackLoading = _useState6[1];
|
|
58012
|
+
var _useState7 = React.useState(false),
|
|
58013
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
58014
|
+
collectionError = _useState8[0];
|
|
58015
|
+
_useState8[1];
|
|
58834
58016
|
var retryCount = React.useRef(0);
|
|
58835
58017
|
var messagesContainerRef = React.useRef(null);
|
|
58836
58018
|
var inputContainerRef = React.useRef(null);
|
|
58837
|
-
var inputRef = React.useRef(null);
|
|
58838
58019
|
var spinnerRef = React.useRef(null);
|
|
58839
58020
|
var welcomeQuestionRef = React.useRef(null);
|
|
58840
|
-
var
|
|
58841
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
58842
|
-
messageError = _useState8[0],
|
|
58843
|
-
setMessageError = _useState8[1];
|
|
58844
|
-
var _useState9 = React.useState([]),
|
|
58021
|
+
var _useState9 = React.useState(false),
|
|
58845
58022
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
58846
|
-
|
|
58847
|
-
|
|
58023
|
+
messageError = _useState0[0],
|
|
58024
|
+
setMessageError = _useState0[1];
|
|
58848
58025
|
var _useState1 = React.useState([]),
|
|
58849
58026
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
58850
|
-
|
|
58851
|
-
|
|
58852
|
-
var _useState11 = React.useState(
|
|
58027
|
+
conversations = _useState10[0],
|
|
58028
|
+
setConversations = _useState10[1];
|
|
58029
|
+
var _useState11 = React.useState([]),
|
|
58853
58030
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
58854
|
-
|
|
58855
|
-
|
|
58856
|
-
var _useState13 = React.useState(
|
|
58031
|
+
quickReplyList = _useState12[0],
|
|
58032
|
+
setQuickReplyList = _useState12[1];
|
|
58033
|
+
var _useState13 = React.useState(''),
|
|
58857
58034
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
58858
|
-
|
|
58859
|
-
|
|
58035
|
+
message = _useState14[0],
|
|
58036
|
+
setMessage = _useState14[1];
|
|
58860
58037
|
var _useState15 = React.useState(null),
|
|
58861
58038
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
58862
|
-
|
|
58863
|
-
|
|
58864
|
-
var _useState17 = React.useState(
|
|
58039
|
+
currentContext = _useState16[0],
|
|
58040
|
+
setCurrentContext = _useState16[1];
|
|
58041
|
+
var _useState17 = React.useState(null),
|
|
58865
58042
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
58866
|
-
|
|
58867
|
-
|
|
58868
|
-
var _useState19 = React.useState(
|
|
58043
|
+
lastSentFromApp = _useState18[0],
|
|
58044
|
+
setLastSentFromApp = _useState18[1];
|
|
58045
|
+
var _useState19 = React.useState({}),
|
|
58869
58046
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
58870
|
-
|
|
58871
|
-
|
|
58872
|
-
var
|
|
58873
|
-
|
|
58047
|
+
feedbacks = _useState20[0],
|
|
58048
|
+
setFeedbacks = _useState20[1];
|
|
58049
|
+
var _useState21 = React.useState({
|
|
58050
|
+
x: 0,
|
|
58051
|
+
y: 0
|
|
58052
|
+
}),
|
|
58053
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
58054
|
+
position = _useState22[0],
|
|
58055
|
+
setPosition = _useState22[1];
|
|
58056
|
+
var _useState23 = React.useState({
|
|
58057
|
+
x: 50,
|
|
58058
|
+
y: -68
|
|
58059
|
+
}),
|
|
58060
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
58061
|
+
chatPosition = _useState24[0],
|
|
58062
|
+
setChatPosition = _useState24[1];
|
|
58063
|
+
var _useState25 = React.useState(false),
|
|
58064
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
58065
|
+
isDragging = _useState26[0],
|
|
58066
|
+
setIsDragging = _useState26[1];
|
|
58067
|
+
var _useState27 = React.useState({
|
|
58068
|
+
x: 0,
|
|
58069
|
+
y: 0
|
|
58070
|
+
}),
|
|
58071
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
58072
|
+
offset = _useState28[0],
|
|
58073
|
+
setOffset = _useState28[1];
|
|
58074
|
+
var _useState29 = React.useState(false),
|
|
58075
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
58076
|
+
dragged = _useState30[0],
|
|
58077
|
+
setDragged = _useState30[1];
|
|
58078
|
+
var _useState31 = React.useState(500),
|
|
58079
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
58080
|
+
chatWindowWidth = _useState32[0],
|
|
58081
|
+
setChatWindowWidth = _useState32[1];
|
|
58082
|
+
var _useState33 = React.useState(0),
|
|
58083
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
58084
|
+
windowInnerWidthForMobile = _useState34[0],
|
|
58085
|
+
setWindowInnerWidthForMobile = _useState34[1];
|
|
58086
|
+
var _useState35 = React.useState(600),
|
|
58087
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
58088
|
+
chatWindowHeight = _useState36[0],
|
|
58089
|
+
setchatWindowHeight = _useState36[1]; //update this if changed in css
|
|
58090
|
+
|
|
58091
|
+
var chatIconSize = 60; //update this if changed in css
|
|
58092
|
+
|
|
58093
|
+
React.useEffect(function () {
|
|
58094
|
+
var updateChatWindowWidth = function updateChatWindowWidth() {
|
|
58095
|
+
var width = window.innerWidth;
|
|
58096
|
+
var newWidth = 500;
|
|
58097
|
+
|
|
58098
|
+
//Update these values if changed in css
|
|
58099
|
+
if (width <= 575) newWidth = 450;
|
|
58100
|
+
if (width <= 475) newWidth = 400;
|
|
58101
|
+
if (width <= 425) newWidth = 350;
|
|
58102
|
+
if (width <= 375) newWidth = 325;
|
|
58103
|
+
if (width <= 350) newWidth = 300;
|
|
58104
|
+
if (width <= 325) newWidth = 275;
|
|
58105
|
+
setChatWindowWidth(newWidth);
|
|
58106
|
+
setWindowInnerWidthForMobile(width);
|
|
58107
|
+
};
|
|
58108
|
+
updateChatWindowWidth();
|
|
58109
|
+
window.addEventListener('resize', updateChatWindowWidth);
|
|
58110
|
+
return function () {
|
|
58111
|
+
return window.removeEventListener('resize', updateChatWindowWidth);
|
|
58112
|
+
};
|
|
58113
|
+
}, []);
|
|
58114
|
+
React.useEffect(function () {
|
|
58115
|
+
var updateInitialPosition = function updateInitialPosition() {
|
|
58116
|
+
var bufferForMobile = window.innerWidth <= 575 ? 40 : 0;
|
|
58117
|
+
setPosition({
|
|
58118
|
+
x: window.innerWidth - chatIconSize + bufferForMobile,
|
|
58119
|
+
y: window.innerHeight - chatIconSize + 30
|
|
58120
|
+
});
|
|
58121
|
+
};
|
|
58122
|
+
updateInitialPosition();
|
|
58123
|
+
window.addEventListener('resize', updateInitialPosition);
|
|
58124
|
+
return function () {
|
|
58125
|
+
return window.removeEventListener('resize', updateInitialPosition);
|
|
58126
|
+
};
|
|
58127
|
+
}, []);
|
|
58128
|
+
var handleStart = function handleStart(e) {
|
|
58129
|
+
var _e$target;
|
|
58130
|
+
var target = e.target;
|
|
58131
|
+
if (inputContainerRef.current && inputContainerRef.current.contains(target) || messagesContainerRef.current && messagesContainerRef.current.contains(target) || spinnerRef.current && spinnerRef.current.contains(target) || e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest('#chatCloseIcon')) {
|
|
58132
|
+
return;
|
|
58133
|
+
}
|
|
58134
|
+
e.preventDefault();
|
|
58135
|
+
setIsDragging(true);
|
|
58136
|
+
setDragged(false);
|
|
58137
|
+
var clientX = e.touches ? e.touches[0].clientX : e.clientX;
|
|
58138
|
+
var clientY = e.touches ? e.touches[0].clientY : e.clientY;
|
|
58139
|
+
setOffset({
|
|
58140
|
+
x: clientX - position.x,
|
|
58141
|
+
y: clientY - position.y
|
|
58142
|
+
});
|
|
58143
|
+
};
|
|
58144
|
+
var handleMove = function handleMove(e) {
|
|
58145
|
+
var _e$target2;
|
|
58146
|
+
if (e !== null && e !== void 0 && (_e$target2 = e.target) !== null && _e$target2 !== void 0 && _e$target2.closest('#chatCloseIcon')) return;
|
|
58147
|
+
if (isDragging) {
|
|
58148
|
+
setDragged(true);
|
|
58149
|
+
var clientX = e.touches ? e.touches[0].clientX : e.clientX;
|
|
58150
|
+
var clientY = e.touches ? e.touches[0].clientY : e.clientY;
|
|
58151
|
+
var newX = clientX - offset.x;
|
|
58152
|
+
var newY = clientY - offset.y;
|
|
58153
|
+
|
|
58154
|
+
// chat icon has to stay within set screen bounds
|
|
58155
|
+
newX = Math.max(chatIconSize + 10, Math.min(newX, window.innerWidth - 20));
|
|
58156
|
+
newY = Math.max(chatIconSize + 20, Math.min(newY, window.innerHeight - chatIconSize + 30));
|
|
58157
|
+
setPosition({
|
|
58158
|
+
x: newX,
|
|
58159
|
+
y: newY
|
|
58160
|
+
});
|
|
58161
|
+
}
|
|
58162
|
+
};
|
|
58163
|
+
var handleEnd = function handleEnd() {
|
|
58164
|
+
setIsDragging(false);
|
|
58165
|
+
setTimeout(function () {
|
|
58166
|
+
return setDragged(false);
|
|
58167
|
+
}, 100);
|
|
58168
|
+
};
|
|
58169
|
+
React.useEffect(function () {
|
|
58170
|
+
if (!isDragging) {
|
|
58171
|
+
adjustChatWindowPosition();
|
|
58172
|
+
if (showChatWindow) {
|
|
58173
|
+
adjustChatIconPosition();
|
|
58174
|
+
}
|
|
58175
|
+
}
|
|
58176
|
+
}, [isDragging, position, showChatWindow]);
|
|
58177
|
+
React.useEffect(function () {
|
|
58178
|
+
var isSmallDevice = windowInnerWidthForMobile < 1000;
|
|
58179
|
+
if (showChatWindow && isSmallDevice && !dragged) {
|
|
58180
|
+
adjustChatWindowPosition();
|
|
58181
|
+
}
|
|
58182
|
+
}, [position, dragged]);
|
|
58183
|
+
var adjustChatWindowPosition = function adjustChatWindowPosition() {
|
|
58184
|
+
if (chatWindowHeight + chatIconSize + 20 > window.innerHeight) {
|
|
58185
|
+
return setchatWindowHeight(window.innerHeight - chatIconSize - 20);
|
|
58186
|
+
}
|
|
58187
|
+
// if (chatWindowHeight + chatIconSize + 20 > window.innerHeight) return
|
|
58188
|
+
var bufferForMobile = window.innerWidth <= 575 ? 40 : 0;
|
|
58189
|
+
// let chatX = 0 - chatIconSize + bufferForMobile
|
|
58190
|
+
var chatX = 0 - chatIconSize;
|
|
58191
|
+
var chatY = -chatWindowHeight - chatIconSize - 10; // Default: Open above
|
|
58192
|
+
|
|
58193
|
+
// Adjust horizontally
|
|
58194
|
+
if (position.x + chatWindowWidth > window.innerWidth + bufferForMobile) {
|
|
58195
|
+
chatX = -chatWindowWidth; // Move left if overflowing right
|
|
58196
|
+
}
|
|
58197
|
+
|
|
58198
|
+
// Adjust vertically
|
|
58199
|
+
if (position.y < chatWindowHeight) {
|
|
58200
|
+
chatY = 10; // Move below if there's not enough space above
|
|
58201
|
+
}
|
|
58202
|
+
setChatPosition({
|
|
58203
|
+
x: chatX,
|
|
58204
|
+
y: chatY
|
|
58205
|
+
});
|
|
58206
|
+
};
|
|
58207
|
+
var adjustChatIconPosition = function adjustChatIconPosition() {
|
|
58208
|
+
// if (chatWindowHeight + chatIconSize + 20 > window.innerHeight) {
|
|
58209
|
+
// return setchatWindowHeight(500)
|
|
58210
|
+
// }
|
|
58211
|
+
var newX = position.x;
|
|
58212
|
+
var newY = position.y;
|
|
58213
|
+
var isSmallDevice = windowInnerWidthForMobile < 1000;
|
|
58214
|
+
var middleX = windowInnerWidthForMobile / 2; // Middle of the screen
|
|
58215
|
+
var closerToLeft = position.x < middleX; // Check if icon is closer to left or right
|
|
58216
|
+
|
|
58217
|
+
// Move chat icon up if chat window is overflowing at the bottom
|
|
58218
|
+
if (position.y < chatWindowHeight && window.innerHeight - position.y < chatWindowHeight) {
|
|
58219
|
+
newY = position.y - (chatWindowHeight - (window.innerHeight - position.y)) - 20;
|
|
58220
|
+
}
|
|
58221
|
+
|
|
58222
|
+
// Move chat icon down if chat window is overflowing at the top
|
|
58223
|
+
else if (position.y > chatWindowHeight && position.y < chatWindowHeight + chatIconSize + 10) {
|
|
58224
|
+
newY = chatWindowHeight + chatIconSize + 20;
|
|
58225
|
+
}
|
|
58226
|
+
|
|
58227
|
+
// In Mobile, move chat icon to the nearest screen edge (left or right)
|
|
58228
|
+
if (isSmallDevice) {
|
|
58229
|
+
newX = closerToLeft ? 70 : windowInnerWidthForMobile - 10;
|
|
58230
|
+
}
|
|
58231
|
+
if (newX !== position.x || newY !== position.y) {
|
|
58232
|
+
setPosition({
|
|
58233
|
+
x: newX,
|
|
58234
|
+
y: newY
|
|
58235
|
+
});
|
|
58236
|
+
}
|
|
58237
|
+
};
|
|
58238
|
+
React.useEffect(function () {
|
|
58239
|
+
if (chatWindowHeight !== 600) {
|
|
58240
|
+
adjustChatWindowPosition();
|
|
58241
|
+
// adjustChatIconPosition()
|
|
58242
|
+
}
|
|
58243
|
+
}, [chatWindowHeight]);
|
|
58244
|
+
React.useEffect(function () {
|
|
58245
|
+
if (isDragging) {
|
|
58246
|
+
document.addEventListener('mousemove', handleMove);
|
|
58247
|
+
document.addEventListener('mouseup', handleEnd);
|
|
58248
|
+
document.addEventListener('touchmove', handleMove, {
|
|
58249
|
+
passive: false
|
|
58250
|
+
});
|
|
58251
|
+
document.addEventListener('touchend', handleEnd);
|
|
58252
|
+
} else {
|
|
58253
|
+
document.removeEventListener('mousemove', handleMove);
|
|
58254
|
+
document.removeEventListener('mouseup', handleEnd);
|
|
58255
|
+
document.removeEventListener('touchmove', handleMove);
|
|
58256
|
+
document.removeEventListener('touchend', handleEnd);
|
|
58257
|
+
}
|
|
58258
|
+
return function () {
|
|
58259
|
+
document.removeEventListener('mousemove', handleMove);
|
|
58260
|
+
document.removeEventListener('mouseup', handleEnd);
|
|
58261
|
+
document.removeEventListener('touchmove', handleMove);
|
|
58262
|
+
document.removeEventListener('touchend', handleEnd);
|
|
58263
|
+
};
|
|
58264
|
+
}, [isDragging]);
|
|
58265
|
+
var handleChatIconClick = function handleChatIconClick() {
|
|
58266
|
+
if (!dragged) {
|
|
58267
|
+
setShowChatWindow(function (prev) {
|
|
58268
|
+
return !prev;
|
|
58269
|
+
});
|
|
58270
|
+
}
|
|
58271
|
+
};
|
|
58272
|
+
React.useEffect(function () {
|
|
58273
|
+
if (showChatWindow) {
|
|
58274
|
+
adjustChatIconPosition();
|
|
58275
|
+
}
|
|
58276
|
+
}, [showChatWindow]);
|
|
58874
58277
|
var saveCurrentContext = function saveCurrentContext(conversationsToBeSaved) {
|
|
58875
58278
|
var _systemPrompts;
|
|
58876
58279
|
var systemPrompts = conversationsToBeSaved.filter(function (c) {
|
|
@@ -58946,7 +58349,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
58946
58349
|
}, []);
|
|
58947
58350
|
var chatBodyRef = React.useRef(null);
|
|
58948
58351
|
var previousConversationLengthRef = React.useRef(conversations.length);
|
|
58949
|
-
var
|
|
58352
|
+
var previousShowChatWindowRef = React.useRef(showChatWindow);
|
|
58950
58353
|
var scroll = function scroll() {
|
|
58951
58354
|
chatBodyRef.current && chatBodyRef.current.scrollTo({
|
|
58952
58355
|
top: chatBodyRef.current.scrollHeight,
|
|
@@ -59092,99 +58495,15 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59092
58495
|
}();
|
|
59093
58496
|
var handleReply = function handleReply(reply) {
|
|
59094
58497
|
if (isLoading || collectionError || !reply) return;
|
|
59095
|
-
|
|
59096
|
-
// Check if reply is a flow config object
|
|
59097
|
-
if (_typeof$1(reply) === 'object' && reply !== null && reply.type === 'flow') {
|
|
59098
|
-
setActiveFlow(reply);
|
|
59099
|
-
// Add user message only, don't add agent response - just show the flow directly
|
|
59100
|
-
var _newConversations = _toConsumableArray(conversations);
|
|
59101
|
-
_newConversations.push({
|
|
59102
|
-
role: 'user',
|
|
59103
|
-
content: typeof reply === 'string' ? reply : reply.text || reply.initialMessage || ''
|
|
59104
|
-
});
|
|
59105
|
-
setConversations(_newConversations);
|
|
59106
|
-
setMessage('');
|
|
59107
|
-
return;
|
|
59108
|
-
}
|
|
59109
|
-
|
|
59110
|
-
// Handle plain string or quickReply object
|
|
59111
|
-
var replyText = typeof reply === 'string' ? reply : (reply === null || reply === void 0 ? void 0 : reply.text) || '';
|
|
59112
|
-
if (!replyText) return;
|
|
59113
58498
|
var newConversations = _toConsumableArray(conversations);
|
|
59114
58499
|
newConversations.push({
|
|
59115
58500
|
role: 'user',
|
|
59116
|
-
content:
|
|
58501
|
+
content: reply
|
|
59117
58502
|
});
|
|
59118
58503
|
setConversations(newConversations);
|
|
59119
58504
|
_send(newConversations);
|
|
59120
58505
|
setMessage('');
|
|
59121
58506
|
};
|
|
59122
|
-
|
|
59123
|
-
// Use flow hook when flow is active
|
|
59124
|
-
var flowHook = useGuidedFlow(activeFlow);
|
|
59125
|
-
|
|
59126
|
-
// Flow completion handler
|
|
59127
|
-
var handleFlowComplete = React__default["default"].useCallback(/*#__PURE__*/_asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
59128
|
-
var messageContent, newConversations;
|
|
59129
|
-
return _regenerator().w(function (_context2) {
|
|
59130
|
-
while (1) switch (_context2.n) {
|
|
59131
|
-
case 0:
|
|
59132
|
-
if (!(!activeFlow || !flowHook.isComplete || flowCompletedRef.current)) {
|
|
59133
|
-
_context2.n = 1;
|
|
59134
|
-
break;
|
|
59135
|
-
}
|
|
59136
|
-
return _context2.a(2);
|
|
59137
|
-
case 1:
|
|
59138
|
-
flowCompletedRef.current = true;
|
|
59139
|
-
if (activeFlow.answer) {
|
|
59140
|
-
// Use template string
|
|
59141
|
-
messageContent = flowHook.formatAnswer() || JSON.stringify(flowHook.flowData);
|
|
59142
|
-
} else {
|
|
59143
|
-
// Use JSON
|
|
59144
|
-
messageContent = JSON.stringify(flowHook.flowData);
|
|
59145
|
-
}
|
|
59146
|
-
newConversations = _toConsumableArray(conversations);
|
|
59147
|
-
newConversations.push({
|
|
59148
|
-
role: 'user',
|
|
59149
|
-
content: messageContent
|
|
59150
|
-
});
|
|
59151
|
-
setConversations(newConversations);
|
|
59152
|
-
_send(newConversations);
|
|
59153
|
-
setActiveFlow(null);
|
|
59154
|
-
flowHook.resetFlow();
|
|
59155
|
-
setMessage('');
|
|
59156
|
-
flowCompletedRef.current = false;
|
|
59157
|
-
case 2:
|
|
59158
|
-
return _context2.a(2);
|
|
59159
|
-
}
|
|
59160
|
-
}, _callee2);
|
|
59161
|
-
})), [activeFlow, flowHook, conversations]);
|
|
59162
|
-
|
|
59163
|
-
// Watch for flow completion
|
|
59164
|
-
React.useEffect(function () {
|
|
59165
|
-
if (activeFlow && flowHook.isComplete && !flowCompletedRef.current) {
|
|
59166
|
-
handleFlowComplete();
|
|
59167
|
-
}
|
|
59168
|
-
}, [flowHook.isComplete, activeFlow, handleFlowComplete]);
|
|
59169
|
-
|
|
59170
|
-
// Reset flow when switching to a different flow (but persist when sidebar closes/reopens)
|
|
59171
|
-
React.useEffect(function () {
|
|
59172
|
-
if (activeFlow) {
|
|
59173
|
-
// If switching to a different flow, reset the previous one
|
|
59174
|
-
if (previousFlowIdRef.current && previousFlowIdRef.current !== activeFlow.id) {
|
|
59175
|
-
flowCompletedRef.current = false;
|
|
59176
|
-
if (flowHook.resetFlow) {
|
|
59177
|
-
flowHook.resetFlow();
|
|
59178
|
-
}
|
|
59179
|
-
}
|
|
59180
|
-
previousFlowIdRef.current = activeFlow.id;
|
|
59181
|
-
} else {
|
|
59182
|
-
// Flow was cleared (e.g., new conversation or completion)
|
|
59183
|
-
previousFlowIdRef.current = null;
|
|
59184
|
-
}
|
|
59185
|
-
// Reset completion flag when flow changes
|
|
59186
|
-
flowCompletedRef.current = false;
|
|
59187
|
-
}, [activeFlow === null || activeFlow === void 0 ? void 0 : activeFlow.id, flowHook]);
|
|
59188
58507
|
var handleKeyup = function handleKeyup(e) {
|
|
59189
58508
|
if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 && !isLoading && !collectionError) {
|
|
59190
58509
|
handleReply(message);
|
|
@@ -59192,22 +58511,15 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59192
58511
|
};
|
|
59193
58512
|
React.useEffect(function () {
|
|
59194
58513
|
var conversationLengthChanged = previousConversationLengthRef.current !== conversations.length;
|
|
59195
|
-
var
|
|
59196
|
-
if (conversations.length && (conversationLengthChanged ||
|
|
59197
|
-
|
|
59198
|
-
var scrollTimeout = setTimeout(function () {
|
|
59199
|
-
scroll();
|
|
59200
|
-
}, 250);
|
|
59201
|
-
return function () {
|
|
59202
|
-
return clearTimeout(scrollTimeout);
|
|
59203
|
-
};
|
|
58514
|
+
var chatWindowJustOpened = !previousShowChatWindowRef.current && showChatWindow && conversations.length;
|
|
58515
|
+
if (showChatWindow && conversations.length && (conversationLengthChanged || chatWindowJustOpened)) {
|
|
58516
|
+
scroll();
|
|
59204
58517
|
}
|
|
59205
58518
|
previousConversationLengthRef.current = conversations.length;
|
|
59206
|
-
|
|
59207
|
-
}, [conversations
|
|
58519
|
+
previousShowChatWindowRef.current = showChatWindow;
|
|
58520
|
+
}, [conversations, showChatWindow]);
|
|
59208
58521
|
React.useEffect(function () {
|
|
59209
58522
|
if (messageError) {
|
|
59210
|
-
console.log('***scrolling 2');
|
|
59211
58523
|
scroll();
|
|
59212
58524
|
}
|
|
59213
58525
|
}, [messageError]);
|
|
@@ -59228,29 +58540,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59228
58540
|
}
|
|
59229
58541
|
var replies = _toConsumableArray(quickReplies.slice(0, 3));
|
|
59230
58542
|
replies.forEach(function (reply, index) {
|
|
59231
|
-
|
|
59232
|
-
|
|
59233
|
-
|
|
59234
|
-
|
|
59235
|
-
|
|
59236
|
-
} else if (_typeof$1(reply) === 'object' && reply !== null) {
|
|
59237
|
-
// Validate flow config
|
|
59238
|
-
if (reply.type === 'flow') {
|
|
59239
|
-
if (!reply.id || !reply.steps || !Array.isArray(reply.steps)) {
|
|
59240
|
-
throw new Error("quickReplies[".concat(index, "] flow config is invalid"));
|
|
59241
|
-
}
|
|
59242
|
-
} else if (reply.type === 'quickReply') {
|
|
59243
|
-
if (!reply.text || typeof reply.text !== 'string') {
|
|
59244
|
-
throw new Error("quickReplies[".concat(index, "] quickReply must have text property"));
|
|
59245
|
-
}
|
|
59246
|
-
if (reply.text.length > 100) {
|
|
59247
|
-
throw new Error("quickReplies[".concat(index, "] text exceeds the 100 character limit"));
|
|
59248
|
-
}
|
|
59249
|
-
} else {
|
|
59250
|
-
throw new Error("quickReplies[".concat(index, "] must be a string or have type 'quickReply' or 'flow'"));
|
|
59251
|
-
}
|
|
59252
|
-
} else {
|
|
59253
|
-
throw new Error("quickReplies[".concat(index, "] must be a string or object"));
|
|
58543
|
+
if (typeof reply !== 'string') {
|
|
58544
|
+
throw new Error("quickReplies[".concat(index, "] must be a string"));
|
|
58545
|
+
}
|
|
58546
|
+
if (reply.length > 100) {
|
|
58547
|
+
throw new Error("quickReplies[".concat(index, "] exceeds the 100 character limit"));
|
|
59254
58548
|
}
|
|
59255
58549
|
});
|
|
59256
58550
|
setQuickReplyList(replies);
|
|
@@ -59266,20 +58560,14 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59266
58560
|
storage$1.setLocalItem('mihelpAgentLastSentApp', '');
|
|
59267
58561
|
setMessageError(false);
|
|
59268
58562
|
setCurrentContext(null);
|
|
59269
|
-
// Reset active flow to show quick replies again
|
|
59270
|
-
setActiveFlow(null);
|
|
59271
|
-
flowCompletedRef.current = false;
|
|
59272
|
-
if (flowHook && flowHook.resetFlow) {
|
|
59273
|
-
flowHook.resetFlow();
|
|
59274
|
-
}
|
|
59275
58563
|
};
|
|
59276
58564
|
var handleDownload = /*#__PURE__*/function () {
|
|
59277
|
-
var
|
|
59278
|
-
var input, originalHeight, originalOverflow, originalMaxHeight, canvas, imgData, pdf, pdfWidth, pdfHeight, padding, imgProps, imgWidth, imgHeight, heightLeft,
|
|
59279
|
-
return _regenerator().w(function (
|
|
59280
|
-
while (1) switch (
|
|
58565
|
+
var _ref3 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
58566
|
+
var input, originalHeight, originalOverflow, originalMaxHeight, canvas, imgData, pdf, pdfWidth, pdfHeight, padding, imgProps, imgWidth, imgHeight, heightLeft, _position, _t2;
|
|
58567
|
+
return _regenerator().w(function (_context2) {
|
|
58568
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
59281
58569
|
case 0:
|
|
59282
|
-
|
|
58570
|
+
_context2.p = 0;
|
|
59283
58571
|
setIsFeedbackLoading(true);
|
|
59284
58572
|
welcomeQuestionRef.current.style.marginLeft = '0px';
|
|
59285
58573
|
input = messagesContainerRef.current; // Save original styles
|
|
@@ -59289,12 +58577,12 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59289
58577
|
input.style.height = input.scrollHeight + 'px';
|
|
59290
58578
|
input.style.overflow = 'visible';
|
|
59291
58579
|
input.style.maxHeight = 'none';
|
|
59292
|
-
|
|
58580
|
+
_context2.n = 1;
|
|
59293
58581
|
return new Promise(function (res) {
|
|
59294
58582
|
return setTimeout(res, 100);
|
|
59295
58583
|
});
|
|
59296
58584
|
case 1:
|
|
59297
|
-
|
|
58585
|
+
_context2.n = 2;
|
|
59298
58586
|
return html2canvas(input, {
|
|
59299
58587
|
scale: 2,
|
|
59300
58588
|
useCORS: true,
|
|
@@ -59304,7 +58592,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59304
58592
|
}
|
|
59305
58593
|
});
|
|
59306
58594
|
case 2:
|
|
59307
|
-
canvas =
|
|
58595
|
+
canvas = _context2.v;
|
|
59308
58596
|
imgData = canvas.toDataURL('image/png');
|
|
59309
58597
|
pdf = new E$1('p', 'mm', 'a4');
|
|
59310
58598
|
pdfWidth = pdf.internal.pageSize.getWidth();
|
|
@@ -59314,13 +58602,13 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59314
58602
|
imgWidth = pdfWidth - 2 * padding;
|
|
59315
58603
|
imgHeight = imgProps.height * imgWidth / imgProps.width;
|
|
59316
58604
|
heightLeft = imgHeight;
|
|
59317
|
-
|
|
59318
|
-
pdf.addImage(imgData, 'PNG', padding,
|
|
58605
|
+
_position = 0;
|
|
58606
|
+
pdf.addImage(imgData, 'PNG', padding, _position, imgWidth, imgHeight);
|
|
59319
58607
|
heightLeft -= pdfHeight;
|
|
59320
58608
|
while (heightLeft > 0) {
|
|
59321
|
-
|
|
58609
|
+
_position = heightLeft - imgHeight;
|
|
59322
58610
|
pdf.addPage();
|
|
59323
|
-
pdf.addImage(imgData, 'PNG', padding,
|
|
58611
|
+
pdf.addImage(imgData, 'PNG', padding, _position, imgWidth, imgHeight);
|
|
59324
58612
|
heightLeft -= pdfHeight;
|
|
59325
58613
|
}
|
|
59326
58614
|
pdf.save('Conversation.pdf');
|
|
@@ -59331,29 +58619,29 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59331
58619
|
input.style.maxHeight = originalMaxHeight;
|
|
59332
58620
|
welcomeQuestionRef.current.style.marginLeft = '36px';
|
|
59333
58621
|
setIsFeedbackLoading(false);
|
|
59334
|
-
|
|
58622
|
+
_context2.n = 4;
|
|
59335
58623
|
break;
|
|
59336
58624
|
case 3:
|
|
59337
|
-
|
|
59338
|
-
_t2 =
|
|
58625
|
+
_context2.p = 3;
|
|
58626
|
+
_t2 = _context2.v;
|
|
59339
58627
|
console.log(_t2);
|
|
59340
58628
|
welcomeQuestionRef.current.style.marginLeft = '36px';
|
|
59341
58629
|
setIsFeedbackLoading(false);
|
|
59342
58630
|
case 4:
|
|
59343
|
-
return
|
|
58631
|
+
return _context2.a(2);
|
|
59344
58632
|
}
|
|
59345
|
-
},
|
|
58633
|
+
}, _callee2, null, [[0, 3]]);
|
|
59346
58634
|
}));
|
|
59347
58635
|
return function handleDownload() {
|
|
59348
|
-
return
|
|
58636
|
+
return _ref3.apply(this, arguments);
|
|
59349
58637
|
};
|
|
59350
58638
|
}();
|
|
59351
58639
|
var updateFeedback = /*#__PURE__*/function () {
|
|
59352
|
-
var
|
|
58640
|
+
var _ref4 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(feedback, Currentconversation, conversations) {
|
|
59353
58641
|
var _storage$getLocalItem3, _storage$getLocalItem4;
|
|
59354
58642
|
var payload, feedbackEndpoint, endpoint, newConversations, _t3;
|
|
59355
|
-
return _regenerator().w(function (
|
|
59356
|
-
while (1) switch (
|
|
58643
|
+
return _regenerator().w(function (_context3) {
|
|
58644
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
59357
58645
|
case 0:
|
|
59358
58646
|
setMessageError(false);
|
|
59359
58647
|
payload = {
|
|
@@ -59361,17 +58649,17 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59361
58649
|
};
|
|
59362
58650
|
feedbackEndpoint = (_storage$getLocalItem3 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : (_storage$getLocalItem4 = _storage$getLocalItem3.endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpChatFeedback;
|
|
59363
58651
|
if (feedbackEndpoint) {
|
|
59364
|
-
|
|
58652
|
+
_context3.n = 1;
|
|
59365
58653
|
break;
|
|
59366
58654
|
}
|
|
59367
58655
|
console.log('MiHelpAgent: feedback endpoint missing from config');
|
|
59368
58656
|
setMessageError(true);
|
|
59369
|
-
return
|
|
58657
|
+
return _context3.a(2);
|
|
59370
58658
|
case 1:
|
|
59371
58659
|
endpoint = "".concat(feedbackEndpoint, "/").concat(Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.feedbackId);
|
|
59372
58660
|
setIsFeedbackLoading(true);
|
|
59373
|
-
|
|
59374
|
-
|
|
58661
|
+
_context3.p = 2;
|
|
58662
|
+
_context3.n = 3;
|
|
59375
58663
|
return fetcher.put(endpoint, payload, {
|
|
59376
58664
|
headers: {
|
|
59377
58665
|
'Content-Type': 'application/json'
|
|
@@ -59385,44 +58673,44 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59385
58673
|
});
|
|
59386
58674
|
setConversations(newConversations);
|
|
59387
58675
|
storage$1.setLocalItem('mihelpAgentConversations', newConversations);
|
|
59388
|
-
|
|
58676
|
+
_context3.n = 5;
|
|
59389
58677
|
break;
|
|
59390
58678
|
case 4:
|
|
59391
|
-
|
|
59392
|
-
_t3 =
|
|
58679
|
+
_context3.p = 4;
|
|
58680
|
+
_t3 = _context3.v;
|
|
59393
58681
|
console.log('MiHelpAgent: failed to update feedback', _t3);
|
|
59394
58682
|
setMessageError(true);
|
|
59395
58683
|
case 5:
|
|
59396
|
-
|
|
58684
|
+
_context3.p = 5;
|
|
59397
58685
|
setIsFeedbackLoading(false);
|
|
59398
|
-
return
|
|
58686
|
+
return _context3.f(5);
|
|
59399
58687
|
case 6:
|
|
59400
|
-
return
|
|
58688
|
+
return _context3.a(2);
|
|
59401
58689
|
}
|
|
59402
|
-
},
|
|
58690
|
+
}, _callee3, null, [[2, 4, 5, 6]]);
|
|
59403
58691
|
}));
|
|
59404
58692
|
return function updateFeedback(_x2, _x3, _x4) {
|
|
59405
|
-
return
|
|
58693
|
+
return _ref4.apply(this, arguments);
|
|
59406
58694
|
};
|
|
59407
58695
|
}();
|
|
59408
58696
|
var handleFeedback = /*#__PURE__*/function () {
|
|
59409
|
-
var
|
|
58697
|
+
var _ref5 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4(feedback, Currentconversation, conversations) {
|
|
59410
58698
|
var _storage$getLocalItem5, _storage$getLocalItem6;
|
|
59411
58699
|
var conversationsUntilCurrentMessage, lastFeedbackIndex, chatHistoryAfterLastFeedback, chatHistoryWithoutSystemPrompts, payload, endpoint, response, newConversations, newFeedbacks, _t4;
|
|
59412
|
-
return _regenerator().w(function (
|
|
59413
|
-
while (1) switch (
|
|
58700
|
+
return _regenerator().w(function (_context4) {
|
|
58701
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
59414
58702
|
case 0:
|
|
59415
58703
|
if (!((Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.feedback) === feedback)) {
|
|
59416
|
-
|
|
58704
|
+
_context4.n = 1;
|
|
59417
58705
|
break;
|
|
59418
58706
|
}
|
|
59419
|
-
return
|
|
58707
|
+
return _context4.a(2);
|
|
59420
58708
|
case 1:
|
|
59421
58709
|
if (!(Currentconversation !== null && Currentconversation !== void 0 && Currentconversation.feedback)) {
|
|
59422
|
-
|
|
58710
|
+
_context4.n = 2;
|
|
59423
58711
|
break;
|
|
59424
58712
|
}
|
|
59425
|
-
return
|
|
58713
|
+
return _context4.a(2, updateFeedback(feedback, Currentconversation, conversations));
|
|
59426
58714
|
case 2:
|
|
59427
58715
|
setMessageError(false);
|
|
59428
58716
|
conversationsUntilCurrentMessage = _toConsumableArray(conversations).slice(0, conversations.findIndex(function (c) {
|
|
@@ -59447,23 +58735,23 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59447
58735
|
};
|
|
59448
58736
|
endpoint = (_storage$getLocalItem5 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem5 === void 0 ? void 0 : (_storage$getLocalItem6 = _storage$getLocalItem5.endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpChatFeedback;
|
|
59449
58737
|
if (endpoint) {
|
|
59450
|
-
|
|
58738
|
+
_context4.n = 3;
|
|
59451
58739
|
break;
|
|
59452
58740
|
}
|
|
59453
58741
|
console.log('MiHelpAgent: feedback endpoint missing from config');
|
|
59454
58742
|
setMessageError(true);
|
|
59455
|
-
return
|
|
58743
|
+
return _context4.a(2);
|
|
59456
58744
|
case 3:
|
|
59457
58745
|
setIsFeedbackLoading(true);
|
|
59458
|
-
|
|
59459
|
-
|
|
58746
|
+
_context4.p = 4;
|
|
58747
|
+
_context4.n = 5;
|
|
59460
58748
|
return fetcher.post(endpoint, payload, {
|
|
59461
58749
|
headers: {
|
|
59462
58750
|
'Content-Type': 'application/json'
|
|
59463
58751
|
}
|
|
59464
58752
|
});
|
|
59465
58753
|
case 5:
|
|
59466
|
-
response =
|
|
58754
|
+
response = _context4.v;
|
|
59467
58755
|
newConversations = conversations.map(function (conversation) {
|
|
59468
58756
|
var _response$data3;
|
|
59469
58757
|
return (conversation === null || conversation === void 0 ? void 0 : conversation.id) === (Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.id) ? _objectSpread2(_objectSpread2({}, conversation), {}, {
|
|
@@ -59476,56 +58764,81 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59476
58764
|
setConversations(newConversations);
|
|
59477
58765
|
storage$1.setLocalItem('mihelpAgentConversations', newConversations);
|
|
59478
58766
|
storage$1.setLocalItem('mihelpAgentFeedbacks', newFeedbacks);
|
|
59479
|
-
|
|
58767
|
+
_context4.n = 7;
|
|
59480
58768
|
break;
|
|
59481
58769
|
case 6:
|
|
59482
|
-
|
|
59483
|
-
_t4 =
|
|
58770
|
+
_context4.p = 6;
|
|
58771
|
+
_t4 = _context4.v;
|
|
59484
58772
|
console.log('MiHelpAgent: failed to submit feedback', _t4);
|
|
59485
58773
|
setMessageError(true);
|
|
59486
58774
|
case 7:
|
|
59487
|
-
|
|
58775
|
+
_context4.p = 7;
|
|
59488
58776
|
setIsFeedbackLoading(false);
|
|
59489
|
-
return
|
|
58777
|
+
return _context4.f(7);
|
|
59490
58778
|
case 8:
|
|
59491
|
-
return
|
|
58779
|
+
return _context4.a(2);
|
|
59492
58780
|
}
|
|
59493
|
-
},
|
|
58781
|
+
}, _callee4, null, [[4, 6, 7, 8]]);
|
|
59494
58782
|
}));
|
|
59495
58783
|
return function handleFeedback(_x5, _x6, _x7) {
|
|
59496
|
-
return
|
|
58784
|
+
return _ref5.apply(this, arguments);
|
|
59497
58785
|
};
|
|
59498
58786
|
}();
|
|
59499
|
-
var
|
|
58787
|
+
var isChromeOnIPhone = function isChromeOnIPhone() {
|
|
58788
|
+
var userAgent = navigator.userAgent;
|
|
58789
|
+
var isIPhone = /iPhone/i.test(userAgent);
|
|
58790
|
+
var isChrome = /CriOS/i.test(userAgent);
|
|
58791
|
+
return isIPhone && isChrome;
|
|
58792
|
+
};
|
|
58793
|
+
var chatbotUI = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58794
|
+
onMouseDown: handleStart,
|
|
58795
|
+
onTouchStart: handleStart,
|
|
58796
|
+
style: {
|
|
58797
|
+
left: "".concat(position.x, "px"),
|
|
58798
|
+
top: "".concat(position.y, "px"),
|
|
58799
|
+
cursor: 'grab'
|
|
58800
|
+
},
|
|
58801
|
+
className: _getClassName("mihelpAgentWrapper ".concat(isChromeOnIPhone() ? 'iphoneChrome' : ''), _styleModuleImportMap$2, {
|
|
58802
|
+
"handleMissingStyleName": "warn"
|
|
58803
|
+
})
|
|
58804
|
+
}, showChatWindow && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59500
58805
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindow",
|
|
59501
58806
|
style: {
|
|
59502
|
-
|
|
59503
|
-
|
|
59504
|
-
|
|
59505
|
-
left: 0,
|
|
59506
|
-
top: 0
|
|
58807
|
+
left: "".concat(chatPosition.x, "px"),
|
|
58808
|
+
top: "".concat(chatPosition.y, "px"),
|
|
58809
|
+
height: chatWindowHeight
|
|
59507
58810
|
}
|
|
59508
58811
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59509
58812
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowHeader"
|
|
59510
58813
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
59511
58814
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--title"
|
|
59512
|
-
}, "MiHelp Bot"),
|
|
58815
|
+
}, "MiHelp Bot"), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
58816
|
+
onClick: function onClick() {
|
|
58817
|
+
return setShowChatWindow(false);
|
|
58818
|
+
},
|
|
58819
|
+
id: "chatCloseIcon"
|
|
58820
|
+
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
58821
|
+
name: "xmark",
|
|
58822
|
+
variant: "light",
|
|
59513
58823
|
style: {
|
|
59514
|
-
|
|
59515
|
-
|
|
59516
|
-
|
|
58824
|
+
color: '#fff',
|
|
58825
|
+
fontSize: '20px',
|
|
58826
|
+
cursor: 'pointer'
|
|
59517
58827
|
}
|
|
58828
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58829
|
+
ref: chatBodyRef,
|
|
58830
|
+
className: _getClassName("chatWindowBody ".concat(conversations.length > 0 ? 'newChatVisible' : ''), _styleModuleImportMap$2, {
|
|
58831
|
+
"handleMissingStyleName": "warn"
|
|
58832
|
+
})
|
|
58833
|
+
}, conversations.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58834
|
+
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatContainer"
|
|
59518
58835
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59519
58836
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatButton",
|
|
59520
|
-
onClick: handleDownload
|
|
59521
|
-
style: {
|
|
59522
|
-
background: 'transparent',
|
|
59523
|
-
border: '1px solid #D1D1D1',
|
|
59524
|
-
padding: '4px 12px'
|
|
59525
|
-
}
|
|
58837
|
+
onClick: handleDownload
|
|
59526
58838
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
59527
58839
|
name: "arrow-down-to-line",
|
|
59528
58840
|
style: {
|
|
58841
|
+
color: '#000',
|
|
59529
58842
|
fontSize: '16px'
|
|
59530
58843
|
}
|
|
59531
58844
|
}), /*#__PURE__*/React__default["default"].createElement("span", null, "Export")), /*#__PURE__*/React__default["default"].createElement(coreComponents.Tooltip, {
|
|
@@ -59533,23 +58846,14 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59533
58846
|
position: "leftCenter"
|
|
59534
58847
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59535
58848
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--newChatButton",
|
|
59536
|
-
onClick: handleNewConversation
|
|
59537
|
-
style: {
|
|
59538
|
-
background: 'transparent',
|
|
59539
|
-
border: '1px solid #D1D1D1',
|
|
59540
|
-
padding: '4px 12px'
|
|
59541
|
-
}
|
|
58849
|
+
onClick: handleNewConversation
|
|
59542
58850
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
59543
58851
|
name: "rotate-right",
|
|
59544
58852
|
style: {
|
|
58853
|
+
color: '#000',
|
|
59545
58854
|
fontSize: '16px'
|
|
59546
58855
|
}
|
|
59547
|
-
}), /*#__PURE__*/React__default["default"].createElement("span", null, "Restart"))))
|
|
59548
|
-
ref: chatBodyRef,
|
|
59549
|
-
className: _getClassName("chatWindowBody", _styleModuleImportMap$2, {
|
|
59550
|
-
"handleMissingStyleName": "warn"
|
|
59551
|
-
})
|
|
59552
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58856
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", null, "Restart Chat")))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59553
58857
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messagesContainer",
|
|
59554
58858
|
ref: messagesContainerRef
|
|
59555
58859
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -59571,14 +58875,10 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59571
58875
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messageBubble"
|
|
59572
58876
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
59573
58877
|
"data-chat-id": "agent-message-2"
|
|
59574
|
-
}, "How can I help you today?")))), !conversations.length &&
|
|
58878
|
+
}, "How can I help you today?")))), !conversations.length && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59575
58879
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestions"
|
|
59576
58880
|
}, quickReplyList.map(function (reply, i) {
|
|
59577
|
-
// Handle both string and object types
|
|
59578
|
-
var replyText = typeof reply === 'string' ? reply : reply.type === 'quickReply' ? reply.text : reply.type === 'flow' ? reply.initialMessage || reply.id : '';
|
|
59579
|
-
var replyKey = _typeof$1(reply) === 'object' && reply.id ? reply.id : i;
|
|
59580
58881
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59581
|
-
key: replyKey,
|
|
59582
58882
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionWrapper"
|
|
59583
58883
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59584
58884
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--quickQuestionContainer"
|
|
@@ -59589,7 +58889,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59589
58889
|
}
|
|
59590
58890
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
59591
58891
|
"data-chat-id": "quickReply-message-".concat(i + 1)
|
|
59592
|
-
},
|
|
58892
|
+
}, reply))));
|
|
59593
58893
|
})), function () {
|
|
59594
58894
|
var userCount = 0;
|
|
59595
58895
|
var agentCount = 2;
|
|
@@ -59646,12 +58946,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59646
58946
|
"data-chat-id": testId
|
|
59647
58947
|
}, conversation === null || conversation === void 0 ? void 0 : conversation.content)));
|
|
59648
58948
|
});
|
|
59649
|
-
}(),
|
|
59650
|
-
step: flowHook.currentStep,
|
|
59651
|
-
flowData: flowHook.flowData,
|
|
59652
|
-
handlers: flowHook,
|
|
59653
|
-
isComplete: flowHook.isComplete
|
|
59654
|
-
}), isLoading && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
58949
|
+
}(), isLoading && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59655
58950
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--message"
|
|
59656
58951
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
59657
58952
|
src: "/assets/images/mihelpIcons/icon-sparkle.svg",
|
|
@@ -59685,15 +58980,10 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59685
58980
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatWindowFooter"
|
|
59686
58981
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59687
58982
|
ref: inputContainerRef,
|
|
59688
|
-
|
|
59689
|
-
var _inputRef$current;
|
|
59690
|
-
return !activeFlow && ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus());
|
|
59691
|
-
},
|
|
59692
|
-
className: _getClassName("inputContainer ".concat(collectionError || activeFlow !== null ? 'disabled' : ''), _styleModuleImportMap$2, {
|
|
58983
|
+
className: _getClassName("inputContainer ".concat(collectionError ? 'disabled' : ''), _styleModuleImportMap$2, {
|
|
59693
58984
|
"handleMissingStyleName": "warn"
|
|
59694
58985
|
})
|
|
59695
58986
|
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
59696
|
-
ref: inputRef,
|
|
59697
58987
|
type: "text",
|
|
59698
58988
|
placeholder: "Ask a Question",
|
|
59699
58989
|
value: message,
|
|
@@ -59701,13 +58991,10 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59701
58991
|
return setMessage(e.target.value);
|
|
59702
58992
|
},
|
|
59703
58993
|
onKeyUp: handleKeyup,
|
|
59704
|
-
disabled: collectionError
|
|
58994
|
+
disabled: collectionError
|
|
59705
58995
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
59706
|
-
onClick: function onClick(
|
|
59707
|
-
|
|
59708
|
-
if (!activeFlow) {
|
|
59709
|
-
handleReply(message);
|
|
59710
|
-
}
|
|
58996
|
+
onClick: function onClick() {
|
|
58997
|
+
return handleReply(message);
|
|
59711
58998
|
}
|
|
59712
58999
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
59713
59000
|
name: "paper-plane-top",
|
|
@@ -59715,33 +59002,26 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
59715
59002
|
style: {
|
|
59716
59003
|
color: '#616161',
|
|
59717
59004
|
fontSize: '20px',
|
|
59718
|
-
cursor: isLoading || collectionError
|
|
59005
|
+
cursor: isLoading || collectionError ? 'auto' : 'pointer'
|
|
59719
59006
|
},
|
|
59720
|
-
disabled: isLoading || collectionError
|
|
59007
|
+
disabled: isLoading || collectionError
|
|
59721
59008
|
})))), isFeedbackLoading && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59722
59009
|
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--spinner",
|
|
59723
59010
|
ref: spinnerRef
|
|
59724
59011
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Spinner, {
|
|
59725
59012
|
size: "60px"
|
|
59726
|
-
})))
|
|
59727
|
-
|
|
59728
|
-
onClick:
|
|
59729
|
-
|
|
59730
|
-
|
|
59731
|
-
|
|
59732
|
-
"handleMissingStyleName": "warn"
|
|
59733
|
-
})
|
|
59734
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
59735
|
-
onClick: function onClick(e) {
|
|
59736
|
-
return e.stopPropagation();
|
|
59737
|
-
},
|
|
59013
|
+
}))), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
59014
|
+
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--chatIcon",
|
|
59015
|
+
onClick: handleChatIconClick
|
|
59016
|
+
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
59017
|
+
name: "comment-sparkle-custom",
|
|
59018
|
+
variant: "light",
|
|
59738
59019
|
style: {
|
|
59739
|
-
|
|
59740
|
-
|
|
59741
|
-
|
|
59742
|
-
|
|
59743
|
-
|
|
59744
|
-
}, chatWindowContent));
|
|
59020
|
+
color: '#fff',
|
|
59021
|
+
fontSize: '22px'
|
|
59022
|
+
}
|
|
59023
|
+
})));
|
|
59024
|
+
return ReactDOM__default["default"].createPortal(chatbotUI, document.body);
|
|
59745
59025
|
};
|
|
59746
59026
|
|
|
59747
59027
|
/**
|
|
@@ -71031,9 +70311,9 @@ var AppFrame = function AppFrame(props) {
|
|
|
71031
70311
|
chatBotEnabled = _useState4[0],
|
|
71032
70312
|
setChatBotEnabled = _useState4[1];
|
|
71033
70313
|
var _useState5 = React.useState(false),
|
|
71034
|
-
_useState6 = _slicedToArray(_useState5, 2)
|
|
71035
|
-
_useState6[0]
|
|
71036
|
-
|
|
70314
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
70315
|
+
isLandscapeInMobile = _useState6[0],
|
|
70316
|
+
setIsLandscapeInMobile = _useState6[1];
|
|
71037
70317
|
// const [activeSubmenu, setActiveSubmenu] = useState(null)
|
|
71038
70318
|
var _useState7 = React.useState([]),
|
|
71039
70319
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
@@ -71048,18 +70328,6 @@ var AppFrame = function AppFrame(props) {
|
|
|
71048
70328
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
71049
70329
|
isNavBarOpen = _useState10[0],
|
|
71050
70330
|
setIsNavBarOpen = _useState10[1];
|
|
71051
|
-
var _useState11 = React.useState(false),
|
|
71052
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
71053
|
-
chatBotVisible = _useState12[0],
|
|
71054
|
-
setChatBotVisible = _useState12[1];
|
|
71055
|
-
var _useState13 = React.useState(0),
|
|
71056
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
71057
|
-
notificationsCount = _useState14[0],
|
|
71058
|
-
setNotificationsCount = _useState14[1];
|
|
71059
|
-
var _useState15 = React.useState(0),
|
|
71060
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
71061
|
-
sideBarTopValue = _useState16[0],
|
|
71062
|
-
setSideBarTopValue = _useState16[1];
|
|
71063
70331
|
var setChatBotEnableStatus = function setChatBotEnableStatus() {
|
|
71064
70332
|
var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
71065
70333
|
var tileData = findAppData(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tiles, coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tileOverrides) || {};
|
|
@@ -71177,13 +70445,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
71177
70445
|
ActionComponent: props === null || props === void 0 ? void 0 : props.ActionComponent,
|
|
71178
70446
|
searchComponent: props.searchComponent,
|
|
71179
70447
|
showNavIconInHeader: props === null || props === void 0 ? void 0 : props.showNavIconInHeader,
|
|
71180
|
-
setIsNavBarOpen: setIsNavBarOpen
|
|
71181
|
-
chatBotVisible: chatBotVisible,
|
|
71182
|
-
setChatBotVisible: setChatBotVisible,
|
|
71183
|
-
onNotificationsAndHeightChange: function onNotificationsAndHeightChange(count, height) {
|
|
71184
|
-
setNotificationsCount(count || 0);
|
|
71185
|
-
setSideBarTopValue(height || 0);
|
|
71186
|
-
}
|
|
70448
|
+
setIsNavBarOpen: setIsNavBarOpen
|
|
71187
70449
|
})), /*#__PURE__*/React__default["default"].createElement("main", {
|
|
71188
70450
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppContainer"
|
|
71189
70451
|
}, props.showNavigation && storage$1.isAuthenticated ? /*#__PURE__*/React__default["default"].createElement(NavigationBar, {
|
|
@@ -71204,19 +70466,12 @@ var AppFrame = function AppFrame(props) {
|
|
|
71204
70466
|
isNavBarOpen: isNavBarOpen,
|
|
71205
70467
|
showLevel3Navigation: props.showLevel3Navigation
|
|
71206
70468
|
}) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
71207
|
-
style: {
|
|
71208
|
-
display: 'flex',
|
|
71209
|
-
height: '100%',
|
|
71210
|
-
position: 'relative'
|
|
71211
|
-
}
|
|
71212
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
71213
70469
|
style: {
|
|
71214
70470
|
marginLeft: props.showNavigation && !(props !== null && props !== void 0 && props.showNavIconInHeader) ? navigationWidth : '0px',
|
|
71215
70471
|
height: '100%',
|
|
71216
|
-
transition: 'all 0.5s ease-in-out'
|
|
71217
|
-
flex: 1
|
|
70472
|
+
transition: 'all 0.5s ease-in-out'
|
|
71218
70473
|
}
|
|
71219
|
-
}, props.children), chatBotEnabled && /*#__PURE__*/React__default["default"].createElement(MiHelpAgent, {
|
|
70474
|
+
}, props.children), chatBotEnabled && !isLandscapeInMobile && /*#__PURE__*/React__default["default"].createElement(MiHelpAgent, {
|
|
71220
70475
|
quickReplies: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro = props.mihelpAgentProps) === null || _props$mihelpAgentPro === void 0 ? void 0 : _props$mihelpAgentPro.quickReplies,
|
|
71221
70476
|
collection: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro2 = props.mihelpAgentProps) === null || _props$mihelpAgentPro2 === void 0 ? void 0 : _props$mihelpAgentPro2.collection,
|
|
71222
70477
|
systemPrompt: (props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro3 = props.mihelpAgentProps) === null || _props$mihelpAgentPro3 === void 0 ? void 0 : _props$mihelpAgentPro3.systemPrompt) || defaultSystemPrompt,
|
|
@@ -71224,12 +70479,8 @@ var AppFrame = function AppFrame(props) {
|
|
|
71224
70479
|
contextMessagesCount: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro5 = props.mihelpAgentProps) === null || _props$mihelpAgentPro5 === void 0 ? void 0 : _props$mihelpAgentPro5.contextMessagesCount,
|
|
71225
70480
|
contextTopMessagesCount: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro6 = props.mihelpAgentProps) === null || _props$mihelpAgentPro6 === void 0 ? void 0 : _props$mihelpAgentPro6.contextTopMessagesCount,
|
|
71226
70481
|
contextChunks: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro7 = props.mihelpAgentProps) === null || _props$mihelpAgentPro7 === void 0 ? void 0 : _props$mihelpAgentPro7.contextChunksCount,
|
|
71227
|
-
mihelpAgentRef: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro8 = props.mihelpAgentProps) === null || _props$mihelpAgentPro8 === void 0 ? void 0 : _props$mihelpAgentPro8.mihelpAgentRef
|
|
71228
|
-
|
|
71229
|
-
setChatBotVisible: setChatBotVisible,
|
|
71230
|
-
notificationsCount: notificationsCount,
|
|
71231
|
-
sideBarTopValue: sideBarTopValue
|
|
71232
|
-
}))))))));
|
|
70482
|
+
mihelpAgentRef: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro8 = props.mihelpAgentProps) === null || _props$mihelpAgentPro8 === void 0 ? void 0 : _props$mihelpAgentPro8.mihelpAgentRef
|
|
70483
|
+
})))))));
|
|
71233
70484
|
};
|
|
71234
70485
|
AppFrame.defaultProps = {
|
|
71235
70486
|
handleScrolling: true,
|