@meetelise/chat 1.22.14 → 1.22.15
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/package.json
CHANGED
package/public/demo/index.html
CHANGED
|
@@ -156,24 +156,24 @@
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
MEChat.start({
|
|
159
|
-
organization: "test-company",
|
|
160
|
-
building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
|
|
161
|
-
onSstClose: () => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
onWidgetLoaded: onWidgetLoaded,
|
|
159
|
+
// organization: "test-company",
|
|
160
|
+
// building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
|
|
161
|
+
// onSstClose: () => {
|
|
162
|
+
// const meetEliseChats = document.getElementsByTagName("me-chat");
|
|
163
|
+
// if (!meetEliseChats || meetEliseChats.length === 0) {
|
|
164
|
+
// return;
|
|
165
|
+
// }
|
|
166
|
+
// const meetEliseChat = meetEliseChats[0];
|
|
167
|
+
// meetEliseChat.setAttribute("style", "display: none;");
|
|
168
|
+
// },
|
|
169
|
+
// onWidgetLoaded: onWidgetLoaded,
|
|
170
170
|
|
|
171
171
|
// organization: "4c78cac8-017a-4497-8b71-3df15779a83c",
|
|
172
172
|
|
|
173
173
|
// building: "43e3b1bc-d1b2-11ee-acb9-d77ba815aaac",
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
organization: "cardinal-group",
|
|
176
|
+
widgetType: "utilities",
|
|
177
177
|
|
|
178
178
|
// organization: "test-company",
|
|
179
179
|
// building: "e2e-test-yardi-building",
|
package/public/dist/index.js
CHANGED
|
@@ -4815,7 +4815,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4815
4815
|
line-height: 150%;
|
|
4816
4816
|
font-size: 16px;
|
|
4817
4817
|
}
|
|
4818
|
-
`,Po([le({type:String})],Mo.prototype,"healthcareId",void 0),Po([le({type:Number})],Mo.prototype,"right",void 0),Po([le({type:Number})],Mo.prototype,"bottom",void 0),Po([le({type:Number})],Mo.prototype,"top",void 0),Po([le({type:Number})],Mo.prototype,"left",void 0),Po([ue()],Mo.prototype,"launcher",void 0),Po([ue()],Mo.prototype,"currentLeadSource",void 0),Po([ue()],Mo.prototype,"displayPubnubChat",void 0),Po([ue()],Mo.prototype,"myPubnub",void 0),Po([ue()],Mo.prototype,"requiresConsent",void 0),Po([ue()],Mo.prototype,"privacyPolicyUrl",void 0),Po([ue()],Mo.prototype,"isLoading",void 0),Mo=Po([ae("health-chat")],Mo);var Fo=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Do=class extends re{constructor(){super(...arguments),this.orgSlug="",this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=xe(),this.firstUpdated=async()=>{"test-
|
|
4818
|
+
`,Po([le({type:String})],Mo.prototype,"healthcareId",void 0),Po([le({type:Number})],Mo.prototype,"right",void 0),Po([le({type:Number})],Mo.prototype,"bottom",void 0),Po([le({type:Number})],Mo.prototype,"top",void 0),Po([le({type:Number})],Mo.prototype,"left",void 0),Po([ue()],Mo.prototype,"launcher",void 0),Po([ue()],Mo.prototype,"currentLeadSource",void 0),Po([ue()],Mo.prototype,"displayPubnubChat",void 0),Po([ue()],Mo.prototype,"myPubnub",void 0),Po([ue()],Mo.prototype,"requiresConsent",void 0),Po([ue()],Mo.prototype,"privacyPolicyUrl",void 0),Po([ue()],Mo.prototype,"isLoading",void 0),Mo=Po([ae("health-chat")],Mo);var Fo=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Do=class extends re{constructor(){super(...arguments),this.orgSlug="",this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=xe(),this.firstUpdated=async()=>{await async function(e){if(!e)return!1;const i="e2e-test-yardi-building";try{return(await t().get(Ki(i),{params:{building_slug:i,flag_type:"bool",feature_flag:"enable-show-utilities-webchat",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(this.orgSlug)&&await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=Wr(this.orgSlug),t=Vr(this.orgSlug,e)?e:zr(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Yr(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,Lo.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),ci()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),Gr(this.orgSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return vr(),this.isLoading?U``:U`
|
|
4819
4819
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
4820
4820
|
<div id="aria-describe-info" style="display: none;">
|
|
4821
4821
|
EliseAI widget that allows you to chat with a virtual assistant, book
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { isMobile } from "../utils";
|
|
21
21
|
import "./simple-launcher/simple-launcher";
|
|
22
22
|
import { WidgetType } from "../main/MEChat";
|
|
23
|
+
import { fetchFeatureFlagShowUtilities } from "../fetchFeatureFlag";
|
|
23
24
|
|
|
24
25
|
@customElement("utilities-chat")
|
|
25
26
|
export class UtilitiesChat extends LitElement {
|
|
@@ -117,9 +118,13 @@ export class UtilitiesChat extends LitElement {
|
|
|
117
118
|
launcherRef: Ref<Launcher> = createRef();
|
|
118
119
|
|
|
119
120
|
firstUpdated = async (): Promise<void> => {
|
|
120
|
-
|
|
121
|
+
const showShouldUtilities = await fetchFeatureFlagShowUtilities(
|
|
122
|
+
this.orgSlug
|
|
123
|
+
);
|
|
124
|
+
if (!showShouldUtilities) {
|
|
121
125
|
return;
|
|
122
126
|
}
|
|
127
|
+
|
|
123
128
|
const isInMaintenanceMode = false; // TODO: check
|
|
124
129
|
if (isInMaintenanceMode) {
|
|
125
130
|
// eslint-disable-next-line no-console
|
package/src/fetchFeatureFlag.ts
CHANGED
|
@@ -145,3 +145,29 @@ export async function fetchFeatureFlagInsertDNIWebsite(
|
|
|
145
145
|
return false;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
+
|
|
149
|
+
export async function fetchFeatureFlagShowUtilities(
|
|
150
|
+
orgSlug: string
|
|
151
|
+
): Promise<boolean> {
|
|
152
|
+
if (!orgSlug) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const buildingSlug = "e2e-test-yardi-building";
|
|
156
|
+
try {
|
|
157
|
+
const featureFlagResponse = await axios.get(
|
|
158
|
+
featureFlagEndpointV1(buildingSlug),
|
|
159
|
+
{
|
|
160
|
+
params: {
|
|
161
|
+
building_slug: buildingSlug,
|
|
162
|
+
flag_type: "bool",
|
|
163
|
+
feature_flag: "enable-show-utilities-webchat",
|
|
164
|
+
default_str: null,
|
|
165
|
+
default_bool: false,
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
return featureFlagResponse.data;
|
|
170
|
+
} catch (_) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
}
|