@copart/ops-tool-kit 1.10.20-alpha.3 → 1.10.20-alpha.5
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 +142 -34
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -33,7 +33,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
34
|
|
|
35
35
|
const name$r = "@copart/ops-tool-kit";
|
|
36
|
-
const version$5 = "1.10.20-alpha.
|
|
36
|
+
const version$5 = "1.10.20-alpha.5";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -9481,14 +9481,14 @@ fetcher.getCoreAppPermissions = getCoreAppPermissions;
|
|
|
9481
9481
|
fetcher.getInnovationHubToken = getInnovationHubToken;
|
|
9482
9482
|
fetcher.getUserScopes = getUserScopes;
|
|
9483
9483
|
|
|
9484
|
-
var getRouteName = function getRouteName() {
|
|
9484
|
+
var getRouteName$1 = function getRouteName() {
|
|
9485
9485
|
return window.location.pathname.split('/').splice(1)[0];
|
|
9486
9486
|
};
|
|
9487
9487
|
var regexCountry = /\.co\.([a-z]{2})/;
|
|
9488
9488
|
var regexCobaltCountry = /\.copart\.([a-z]{2})/;
|
|
9489
|
-
var isLogoutRoute = ['logout'].includes(getRouteName());
|
|
9490
|
-
var isAuthRoute = ['login', 'logout', ''].includes(getRouteName());
|
|
9491
|
-
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
9489
|
+
var isLogoutRoute = ['logout'].includes(getRouteName$1());
|
|
9490
|
+
var isAuthRoute = ['login', 'logout', ''].includes(getRouteName$1());
|
|
9491
|
+
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName$1());
|
|
9492
9492
|
var getDomain = function getDomain(url) {
|
|
9493
9493
|
var country = url.match(regexCountry);
|
|
9494
9494
|
var countryCode = (country && country.length > 1 && country[1] || 'US').toUpperCase();
|
|
@@ -38080,7 +38080,7 @@ var GoHome = function GoHome(props) {
|
|
|
38080
38080
|
}, props.reason));
|
|
38081
38081
|
};
|
|
38082
38082
|
|
|
38083
|
-
var css_248z$2 = ".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}\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.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}\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}\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 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}\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 .utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--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";
|
|
38083
|
+
var css_248z$2 = ".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.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}\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 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}\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";
|
|
38084
38084
|
styleInject(css_248z$2);
|
|
38085
38085
|
|
|
38086
38086
|
var _styleModuleImportMap$1 = {
|
|
@@ -38138,6 +38138,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38138
38138
|
collectionError = _useState6[0],
|
|
38139
38139
|
setCollectionError = _useState6[1];
|
|
38140
38140
|
var retryCount = React.useRef(0);
|
|
38141
|
+
var messagesContainerRef = React.useRef(null);
|
|
38141
38142
|
var _useState7 = React.useState(false),
|
|
38142
38143
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
38143
38144
|
messageError = _useState8[0],
|
|
@@ -38195,6 +38196,10 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38195
38196
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
38196
38197
|
chatWindowWidth = _useState30[0],
|
|
38197
38198
|
setChatWindowWidth = _useState30[1];
|
|
38199
|
+
var _useState31 = React.useState(0),
|
|
38200
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
38201
|
+
windowInnerWidthForMobile = _useState32[0],
|
|
38202
|
+
setWindowInnerWidthForMobile = _useState32[1];
|
|
38198
38203
|
var chatWindowHeight = 600; //update this if changed in css
|
|
38199
38204
|
var chatIconSize = 60; //update this if changed in css
|
|
38200
38205
|
|
|
@@ -38211,6 +38216,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38211
38216
|
if (width <= 350) newWidth = 300;
|
|
38212
38217
|
if (width <= 325) newWidth = 275;
|
|
38213
38218
|
setChatWindowWidth(newWidth);
|
|
38219
|
+
setWindowInnerWidthForMobile(width);
|
|
38214
38220
|
};
|
|
38215
38221
|
updateChatWindowWidth();
|
|
38216
38222
|
window.addEventListener('resize', updateChatWindowWidth);
|
|
@@ -38220,9 +38226,10 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38220
38226
|
}, []);
|
|
38221
38227
|
React.useEffect(function () {
|
|
38222
38228
|
var updateInitialPosition = function updateInitialPosition() {
|
|
38229
|
+
var bufferForMobile = window.innerWidth <= 575 ? 40 : 0;
|
|
38223
38230
|
setPosition({
|
|
38224
|
-
x: window.innerWidth - chatIconSize,
|
|
38225
|
-
y: window.innerHeight -
|
|
38231
|
+
x: window.innerWidth - chatIconSize + bufferForMobile,
|
|
38232
|
+
y: window.innerHeight - chatIconSize + 30
|
|
38226
38233
|
});
|
|
38227
38234
|
};
|
|
38228
38235
|
updateInitialPosition();
|
|
@@ -38231,42 +38238,68 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38231
38238
|
return window.removeEventListener('resize', updateInitialPosition);
|
|
38232
38239
|
};
|
|
38233
38240
|
}, []);
|
|
38234
|
-
var
|
|
38241
|
+
var handleStart = function handleStart(e) {
|
|
38242
|
+
var target = e.target;
|
|
38243
|
+
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || messagesContainerRef.current && messagesContainerRef.current.contains(target)) {
|
|
38244
|
+
return;
|
|
38245
|
+
}
|
|
38246
|
+
e.preventDefault();
|
|
38235
38247
|
setIsDragging(true);
|
|
38236
38248
|
setDragged(false);
|
|
38249
|
+
var clientX = e.touches ? e.touches[0].clientX : e.clientX;
|
|
38250
|
+
var clientY = e.touches ? e.touches[0].clientY : e.clientY;
|
|
38237
38251
|
setOffset({
|
|
38238
|
-
x:
|
|
38239
|
-
y:
|
|
38252
|
+
x: clientX - position.x,
|
|
38253
|
+
y: clientY - position.y
|
|
38240
38254
|
});
|
|
38241
38255
|
};
|
|
38242
|
-
var
|
|
38256
|
+
var handleMove = function handleMove(e) {
|
|
38257
|
+
var _e$target;
|
|
38258
|
+
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest('#chatCloseIcon')) return;
|
|
38243
38259
|
if (isDragging) {
|
|
38244
38260
|
setDragged(true);
|
|
38245
|
-
var
|
|
38246
|
-
var
|
|
38261
|
+
var clientX = e.touches ? e.touches[0].clientX : e.clientX;
|
|
38262
|
+
var clientY = e.touches ? e.touches[0].clientY : e.clientY;
|
|
38263
|
+
var newX = clientX - offset.x;
|
|
38264
|
+
var newY = clientY - offset.y;
|
|
38247
38265
|
|
|
38248
38266
|
// chat icon has to stay within set screen bounds
|
|
38249
|
-
newX = Math.max(chatIconSize + 10, Math.min(newX, window.innerWidth -
|
|
38250
|
-
newY = Math.max(
|
|
38267
|
+
newX = Math.max(chatIconSize + 10, Math.min(newX, window.innerWidth - 20));
|
|
38268
|
+
newY = Math.max(chatIconSize + 20, Math.min(newY, window.innerHeight - chatIconSize + 30));
|
|
38251
38269
|
setPosition({
|
|
38252
38270
|
x: newX,
|
|
38253
38271
|
y: newY
|
|
38254
38272
|
});
|
|
38255
38273
|
}
|
|
38256
38274
|
};
|
|
38257
|
-
var
|
|
38275
|
+
var handleEnd = function handleEnd() {
|
|
38258
38276
|
setIsDragging(false);
|
|
38259
38277
|
setTimeout(function () {
|
|
38260
38278
|
return setDragged(false);
|
|
38261
38279
|
}, 100);
|
|
38262
|
-
adjustChatWindowPosition();
|
|
38263
38280
|
};
|
|
38281
|
+
React.useEffect(function () {
|
|
38282
|
+
if (!isDragging) {
|
|
38283
|
+
adjustChatWindowPosition();
|
|
38284
|
+
if (showChatWindow) {
|
|
38285
|
+
adjustChatIconPosition();
|
|
38286
|
+
}
|
|
38287
|
+
}
|
|
38288
|
+
}, [isDragging, position, showChatWindow]);
|
|
38289
|
+
React.useEffect(function () {
|
|
38290
|
+
var isMobile = window.innerWidth < 575;
|
|
38291
|
+
if (showChatWindow && isMobile && !dragged) {
|
|
38292
|
+
adjustChatWindowPosition();
|
|
38293
|
+
}
|
|
38294
|
+
}, [position, dragged]);
|
|
38264
38295
|
var adjustChatWindowPosition = function adjustChatWindowPosition() {
|
|
38296
|
+
var bufferForMobile = window.innerWidth <= 575 ? 40 : 0;
|
|
38297
|
+
// let chatX = 0 - chatIconSize + bufferForMobile
|
|
38265
38298
|
var chatX = 0 - chatIconSize;
|
|
38266
38299
|
var chatY = -chatWindowHeight - chatIconSize - 10; // Default: Open above
|
|
38267
38300
|
|
|
38268
38301
|
// Adjust horizontally
|
|
38269
|
-
if (position.x + chatWindowWidth > window.innerWidth) {
|
|
38302
|
+
if (position.x + chatWindowWidth > window.innerWidth + bufferForMobile) {
|
|
38270
38303
|
chatX = -chatWindowWidth; // Move left if overflowing right
|
|
38271
38304
|
}
|
|
38272
38305
|
|
|
@@ -38280,17 +38313,53 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38280
38313
|
y: chatY
|
|
38281
38314
|
});
|
|
38282
38315
|
};
|
|
38316
|
+
var adjustChatIconPosition = function adjustChatIconPosition() {
|
|
38317
|
+
var newX = position.x;
|
|
38318
|
+
var newY = position.y;
|
|
38319
|
+
var isMobile = windowInnerWidthForMobile < 575;
|
|
38320
|
+
var middleX = windowInnerWidthForMobile / 2; // Middle of the screen
|
|
38321
|
+
var closerToLeft = position.x < middleX; // Check if icon is closer to left or right
|
|
38322
|
+
|
|
38323
|
+
// Move chat icon up if chat window is overflowing at the bottom
|
|
38324
|
+
if (position.y < chatWindowHeight && window.innerHeight - position.y < chatWindowHeight) {
|
|
38325
|
+
newY = position.y - (chatWindowHeight - (window.innerHeight - position.y)) - 20;
|
|
38326
|
+
}
|
|
38327
|
+
|
|
38328
|
+
// Move chat icon down if chat window is overflowing at the top
|
|
38329
|
+
else if (position.y > chatWindowHeight && position.y < chatWindowHeight + chatIconSize + 10) {
|
|
38330
|
+
newY = chatWindowHeight + chatIconSize + 20;
|
|
38331
|
+
}
|
|
38332
|
+
|
|
38333
|
+
// In Mobile, move chat icon to the nearest screen edge (left or right)
|
|
38334
|
+
if (isMobile) {
|
|
38335
|
+
newX = closerToLeft ? 70 : windowInnerWidthForMobile - 10;
|
|
38336
|
+
}
|
|
38337
|
+
if (newX !== position.x || newY !== position.y) {
|
|
38338
|
+
setPosition({
|
|
38339
|
+
x: newX,
|
|
38340
|
+
y: newY
|
|
38341
|
+
});
|
|
38342
|
+
}
|
|
38343
|
+
};
|
|
38283
38344
|
React.useEffect(function () {
|
|
38284
38345
|
if (isDragging) {
|
|
38285
|
-
document.addEventListener('mousemove',
|
|
38286
|
-
document.addEventListener('mouseup',
|
|
38346
|
+
document.addEventListener('mousemove', handleMove);
|
|
38347
|
+
document.addEventListener('mouseup', handleEnd);
|
|
38348
|
+
document.addEventListener('touchmove', handleMove, {
|
|
38349
|
+
passive: false
|
|
38350
|
+
});
|
|
38351
|
+
document.addEventListener('touchend', handleEnd);
|
|
38287
38352
|
} else {
|
|
38288
|
-
document.removeEventListener('mousemove',
|
|
38289
|
-
document.removeEventListener('mouseup',
|
|
38353
|
+
document.removeEventListener('mousemove', handleMove);
|
|
38354
|
+
document.removeEventListener('mouseup', handleEnd);
|
|
38355
|
+
document.removeEventListener('touchmove', handleMove);
|
|
38356
|
+
document.removeEventListener('touchend', handleEnd);
|
|
38290
38357
|
}
|
|
38291
38358
|
return function () {
|
|
38292
|
-
document.removeEventListener('mousemove',
|
|
38293
|
-
document.removeEventListener('mouseup',
|
|
38359
|
+
document.removeEventListener('mousemove', handleMove);
|
|
38360
|
+
document.removeEventListener('mouseup', handleEnd);
|
|
38361
|
+
document.removeEventListener('touchmove', handleMove);
|
|
38362
|
+
document.removeEventListener('touchend', handleEnd);
|
|
38294
38363
|
};
|
|
38295
38364
|
}, [isDragging]);
|
|
38296
38365
|
var handleChatIconClick = function handleChatIconClick() {
|
|
@@ -38300,6 +38369,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38300
38369
|
});
|
|
38301
38370
|
}
|
|
38302
38371
|
};
|
|
38372
|
+
React.useEffect(function () {
|
|
38373
|
+
if (showChatWindow) {
|
|
38374
|
+
adjustChatIconPosition();
|
|
38375
|
+
}
|
|
38376
|
+
}, [showChatWindow]);
|
|
38303
38377
|
React.useEffect(function () {
|
|
38304
38378
|
var conversationsFromSession = storage$1.getLocalItem('mihelpAgentConversations');
|
|
38305
38379
|
var conversationsToBeSaved = !isEmpty$2(conversationsFromSession) ? conversationsFromSession : [];
|
|
@@ -38513,8 +38587,9 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38513
38587
|
var isChrome = /CriOS/i.test(userAgent);
|
|
38514
38588
|
return isIPhone && isChrome;
|
|
38515
38589
|
};
|
|
38516
|
-
|
|
38517
|
-
onMouseDown:
|
|
38590
|
+
var chatbotUI = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38591
|
+
onMouseDown: handleStart,
|
|
38592
|
+
onTouchStart: handleStart,
|
|
38518
38593
|
style: {
|
|
38519
38594
|
left: "".concat(position.x, "px"),
|
|
38520
38595
|
top: "".concat(position.y, "px"),
|
|
@@ -38536,7 +38611,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38536
38611
|
}, "MiHelp Bot"), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
38537
38612
|
onClick: function onClick() {
|
|
38538
38613
|
return setShowChatWindow(false);
|
|
38539
|
-
}
|
|
38614
|
+
},
|
|
38615
|
+
id: "chatCloseIcon"
|
|
38540
38616
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
38541
38617
|
name: "xmark",
|
|
38542
38618
|
variant: "light",
|
|
@@ -38565,7 +38641,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38565
38641
|
fontSize: '16px'
|
|
38566
38642
|
}
|
|
38567
38643
|
}), /*#__PURE__*/React__default["default"].createElement("span", null, "Restart Chat")))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38568
|
-
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messagesContainer"
|
|
38644
|
+
className: "utilities_ops-app-frame_MiHelpAgent_MiHelpAgent--messagesContainer",
|
|
38645
|
+
ref: messagesContainerRef
|
|
38569
38646
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38570
38647
|
className: ""
|
|
38571
38648
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -38694,6 +38771,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
|
|
|
38694
38771
|
fontSize: '22px'
|
|
38695
38772
|
}
|
|
38696
38773
|
})));
|
|
38774
|
+
return ReactDOM__default["default"].createPortal(chatbotUI, document.body);
|
|
38697
38775
|
};
|
|
38698
38776
|
|
|
38699
38777
|
var css_248z$1 = ".utilities_ops-app-frame_AppFrame_AppFrame--AppFrame {\r\n background: var(--paleGray);\r\n background: var(--paleGray);\r\n height: 100vh;\r\n max-height: 100vh;\r\n display: flex;\r\n flex-direction: column;\r\n flex-basis: 0;\r\n}\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--header {\r\n flex: 0 1 auto;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n/* Wrapper that contains the app being developed. */\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--AppContainer {\r\n flex: 1 1 auto;\r\n}\r\n";
|
|
@@ -38729,10 +38807,24 @@ var AppFrame = function AppFrame(props) {
|
|
|
38729
38807
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38730
38808
|
appBarMounted = _useState2[0],
|
|
38731
38809
|
setAppBarMounted = _useState2[1];
|
|
38732
|
-
var
|
|
38733
|
-
|
|
38734
|
-
|
|
38735
|
-
|
|
38810
|
+
var _useState3 = React.useState(false),
|
|
38811
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38812
|
+
chatBotEnabled = _useState4[0],
|
|
38813
|
+
setChatBotEnabled = _useState4[1];
|
|
38814
|
+
var _useState5 = React.useState(false),
|
|
38815
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
38816
|
+
isLandscapeInMobile = _useState6[0],
|
|
38817
|
+
setIsLandscapeInMobile = _useState6[1];
|
|
38818
|
+
var setChatBotEnableStatus = function setChatBotEnableStatus() {
|
|
38819
|
+
var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
|
|
38820
|
+
var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
|
|
38821
|
+
var enableChatBot = coreAppConfig.enableChatBot;
|
|
38822
|
+
var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
|
|
38823
|
+
var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot : tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot;
|
|
38824
|
+
console.log("***chatBotEnabled=", chatBotEnabled, coreAppConfig);
|
|
38825
|
+
console.log("***isCoreRoute=", isCoreRoute, enableChatBot, window.location.pathname, !window.location.pathname.includes('embedded'));
|
|
38826
|
+
setChatBotEnabled(chatBotEnabled);
|
|
38827
|
+
};
|
|
38736
38828
|
React.useEffect(function () {
|
|
38737
38829
|
if (appBarMounted) {
|
|
38738
38830
|
var event = new Event('localStorageChanged');
|
|
@@ -38744,10 +38836,26 @@ var AppFrame = function AppFrame(props) {
|
|
|
38744
38836
|
if (props.env) {
|
|
38745
38837
|
window.toolkitEnv = props.env;
|
|
38746
38838
|
}
|
|
38839
|
+
setChatBotEnableStatus();
|
|
38747
38840
|
}, [props]);
|
|
38748
38841
|
var authGuardProps = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
38749
38842
|
setAppBarMounted: setAppBarMounted
|
|
38750
38843
|
});
|
|
38844
|
+
var isMobileLandscape = function isMobileLandscape() {
|
|
38845
|
+
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
38846
|
+
var isMobile = /android|iphone|ipod|blackberry|iemobile|opera mini/i.test(userAgent) && !/ipad|tablet|playbook|silk/i.test(userAgent);
|
|
38847
|
+
var isLandscape = window.innerWidth > window.innerHeight;
|
|
38848
|
+
return isMobile && isLandscape;
|
|
38849
|
+
};
|
|
38850
|
+
React.useEffect(function () {
|
|
38851
|
+
var handleResize = function handleResize() {
|
|
38852
|
+
setIsLandscapeInMobile(isMobileLandscape());
|
|
38853
|
+
};
|
|
38854
|
+
window.addEventListener("resize", handleResize);
|
|
38855
|
+
return function () {
|
|
38856
|
+
return window.removeEventListener("resize", handleResize);
|
|
38857
|
+
};
|
|
38858
|
+
}, []);
|
|
38751
38859
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38752
38860
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppFrame",
|
|
38753
38861
|
style: props.handleScrolling ? SCROLL : NO_SCROLL
|
|
@@ -38773,7 +38881,7 @@ var AppFrame = function AppFrame(props) {
|
|
|
38773
38881
|
pathname: window.location.pathname
|
|
38774
38882
|
})), /*#__PURE__*/React__default["default"].createElement("main", {
|
|
38775
38883
|
className: "utilities_ops-app-frame_AppFrame_AppFrame--AppContainer"
|
|
38776
|
-
}, props.children), chatBotEnabled && /*#__PURE__*/React__default["default"].createElement(MiHelpAgent, {
|
|
38884
|
+
}, props.children), chatBotEnabled && !isLandscapeInMobile && /*#__PURE__*/React__default["default"].createElement(MiHelpAgent, {
|
|
38777
38885
|
quickReplies: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro = props.mihelpAgentProps) === null || _props$mihelpAgentPro === void 0 ? void 0 : _props$mihelpAgentPro.quickReplies,
|
|
38778
38886
|
collection: props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro2 = props.mihelpAgentProps) === null || _props$mihelpAgentPro2 === void 0 ? void 0 : _props$mihelpAgentPro2.collection,
|
|
38779
38887
|
systemPrompt: (props === null || props === void 0 ? void 0 : (_props$mihelpAgentPro3 = props.mihelpAgentProps) === null || _props$mihelpAgentPro3 === void 0 ? void 0 : _props$mihelpAgentPro3.systemPrompt) || defaultSystemPrompt,
|