@meetelise/chat 1.20.166 → 1.20.167
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/dist/index.js
CHANGED
|
@@ -3501,7 +3501,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3501
3501
|
class=${fe({"message-text":!0,"webchat-font__desktop":!un(),"webchat-font__mobile":un()})}
|
|
3502
3502
|
>
|
|
3503
3503
|
Hi I'm Elise. If this is a medical emergency, please call 911.
|
|
3504
|
-
How can I assist you today?
|
|
3504
|
+
How can I assist you today?
|
|
3505
3505
|
</p>
|
|
3506
3506
|
</li>
|
|
3507
3507
|
${this.messages.map((e=>{var t,n;return U`
|
|
@@ -3806,7 +3806,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3806
3806
|
position: fixed;
|
|
3807
3807
|
bottom: 0;
|
|
3808
3808
|
}
|
|
3809
|
-
`,qr([ue({type:String})],Br.prototype,"buildingSlug",void 0),qr([ue({type:String})],Br.prototype,"orgSlug",void 0),qr([ue({type:Object})],Br.prototype,"launcherStyles",void 0),qr([ue()],Br.prototype,"mobileStyles",void 0),qr([ue({type:Boolean})],Br.prototype,"isMinimized",void 0),qr([ue({type:String})],Br.prototype,"brandColor",void 0),qr([le()],Br.prototype,"chatId",void 0),qr([le()],Br.prototype,"analytics",void 0),qr([le()],Br.prototype,"launcher",void 0),qr([le()],Br.prototype,"building",void 0),qr([le()],Br.prototype,"designConcept",void 0),qr([le()],Br.prototype,"leadSources",void 0),qr([le()],Br.prototype,"currentLeadSource",void 0),qr([le()],Br.prototype,"featureFlagShowDropdown",void 0),qr([le()],Br.prototype,"phoneNumberForSource",void 0),qr([le()],Br.prototype,"hasMounted",void 0),qr([le()],Br.prototype,"hideLauncher",void 0),qr([le()],Br.prototype,"isLoading",void 0),qr([le()],Br.prototype,"showTourNextToChat",void 0),qr([le()],Br.prototype,"displayPubnubChat",void 0),qr([le()],Br.prototype,"myPubnub",void 0),qr([le()],Br.prototype,"enabledChatWidgets",void 0),qr([le()],Br.prototype,"webchatConfigHasAutoOpenChat",void 0),qr([le()],Br.prototype,"requiresConsent",void 0),qr([le()],Br.prototype,"privacyPolicyUrl",void 0),Br=qr([ae("me-chat")],Br);const Lr=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Jr=async(e,n)=>{var i;if(!n||!e)return;const r=await async function(e){if(!e)return!1;try{return(await t().get(Gn(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(n);if(!r)return;const o=Lr(["myContactForm","contactus"]);let a;if(!(o&&o instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&jr(n,e,"Could not find form",t?{id:t.id}:void 0))}for(let e=0;e<o.elements.length;e++){const t=o.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){a=t;break}}if(!a)return jr(n,e,"Could not find submit button");const s=()=>({firstName:Lr(["firstname","txtName"]),lastName:Lr(["lastname","txtName2"]),email:Lr(["email","txtEmail"]),phone:Lr(["phonenumber","txtPhone"]),message:Lr(["message","txtComments"])});if(Object.values(s()).some((e=>null===e))){const t=Object.entries(s()).filter((([,e])=>null===e)).map((([e])=>e));return jr(n,e,"Missing the following form elements: "+t.join(", "))}const u=a.textContent,l=a.cloneNode(!0);null===(i=a.parentNode)||void 0===i||i.replaceChild(l,a),l.onclick=async function(t){if(Object.values(s()).forEach((e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")})),!Object.values(s()).every((e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid")))))return;t.preventDefault(),l.textContent="Processing request...",l.disabled=!0;const i={};Object.entries(s()).forEach((([e,t])=>i[e]=null==t?void 0:t.value));const r=await li(e,n),a=await fi(n,document.referrer);if(!r)return jr(n,e,"Could not find building"),null;const d={email_address:i.email,first_name:i.firstName,last_name:i.lastName,phone_number:i.phone,first_message:i.message,building_id:r.id,is_external_form:!0,lead_sources:[...new Set(a?[a,"property-website"]:["property-website"])]},c=JSON.stringify(d);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":n,"org-slug":e},body:c}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return o&&o.reset(),Object.values(s()).forEach((e=>{e&&(e.disabled=!0)})),l.textContent="Submitted",l.disabled=!0,e.json()})).catch((()=>{l.textContent=u}))}},jr=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})};var Hr=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Gr=class extends re{constructor(){super(...arguments),this.healthcareId="",this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!
|
|
3809
|
+
`,qr([ue({type:String})],Br.prototype,"buildingSlug",void 0),qr([ue({type:String})],Br.prototype,"orgSlug",void 0),qr([ue({type:Object})],Br.prototype,"launcherStyles",void 0),qr([ue()],Br.prototype,"mobileStyles",void 0),qr([ue({type:Boolean})],Br.prototype,"isMinimized",void 0),qr([ue({type:String})],Br.prototype,"brandColor",void 0),qr([le()],Br.prototype,"chatId",void 0),qr([le()],Br.prototype,"analytics",void 0),qr([le()],Br.prototype,"launcher",void 0),qr([le()],Br.prototype,"building",void 0),qr([le()],Br.prototype,"designConcept",void 0),qr([le()],Br.prototype,"leadSources",void 0),qr([le()],Br.prototype,"currentLeadSource",void 0),qr([le()],Br.prototype,"featureFlagShowDropdown",void 0),qr([le()],Br.prototype,"phoneNumberForSource",void 0),qr([le()],Br.prototype,"hasMounted",void 0),qr([le()],Br.prototype,"hideLauncher",void 0),qr([le()],Br.prototype,"isLoading",void 0),qr([le()],Br.prototype,"showTourNextToChat",void 0),qr([le()],Br.prototype,"displayPubnubChat",void 0),qr([le()],Br.prototype,"myPubnub",void 0),qr([le()],Br.prototype,"enabledChatWidgets",void 0),qr([le()],Br.prototype,"webchatConfigHasAutoOpenChat",void 0),qr([le()],Br.prototype,"requiresConsent",void 0),qr([le()],Br.prototype,"privacyPolicyUrl",void 0),Br=qr([ae("me-chat")],Br);const Lr=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Jr=async(e,n)=>{var i;if(!n||!e)return;const r=await async function(e){if(!e)return!1;try{return(await t().get(Gn(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(n);if(!r)return;const o=Lr(["myContactForm","contactus"]);let a;if(!(o&&o instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&jr(n,e,"Could not find form",t?{id:t.id}:void 0))}for(let e=0;e<o.elements.length;e++){const t=o.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){a=t;break}}if(!a)return jr(n,e,"Could not find submit button");const s=()=>({firstName:Lr(["firstname","txtName"]),lastName:Lr(["lastname","txtName2"]),email:Lr(["email","txtEmail"]),phone:Lr(["phonenumber","txtPhone"]),message:Lr(["message","txtComments"])});if(Object.values(s()).some((e=>null===e))){const t=Object.entries(s()).filter((([,e])=>null===e)).map((([e])=>e));return jr(n,e,"Missing the following form elements: "+t.join(", "))}const u=a.textContent,l=a.cloneNode(!0);null===(i=a.parentNode)||void 0===i||i.replaceChild(l,a),l.onclick=async function(t){if(Object.values(s()).forEach((e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")})),!Object.values(s()).every((e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid")))))return;t.preventDefault(),l.textContent="Processing request...",l.disabled=!0;const i={};Object.entries(s()).forEach((([e,t])=>i[e]=null==t?void 0:t.value));const r=await li(e,n),a=await fi(n,document.referrer);if(!r)return jr(n,e,"Could not find building"),null;const d={email_address:i.email,first_name:i.firstName,last_name:i.lastName,phone_number:i.phone,first_message:i.message,building_id:r.id,is_external_form:!0,lead_sources:[...new Set(a?[a,"property-website"]:["property-website"])]},c=JSON.stringify(d);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":n,"org-slug":e},body:c}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return o&&o.reset(),Object.values(s()).forEach((e=>{e&&(e.disabled=!0)})),l.textContent="Submitted",l.disabled=!0,e.json()})).catch((()=>{l.textContent=u}))}},jr=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})};var Hr=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Gr=class extends re{constructor(){super(...arguments),this.healthcareId="",this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!un(),this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ae(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{const e=xr(this.healthcareId),t=Or(this.healthcareId,e)?e:Ar(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Ir(this.healthcareId,null,"",this.currentLeadSource,t.leadId),t.initiatedChat&&await this.myPubnub.initializePubnub(e),this.attachOnClickToLauncher()},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(),Tr(this.healthcareId),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 Vi(),U`
|
|
3810
3810
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
3811
3811
|
<div id="aria-describe-info" style="display: none;">
|
|
3812
3812
|
EliseAI widget that allows you to chat with a virtual assistant, book
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
getChatStorageKey,
|
|
20
20
|
isChatKeyValid,
|
|
21
21
|
} from "../handleChatId";
|
|
22
|
+
import { isMobile } from "../utils";
|
|
22
23
|
|
|
23
24
|
@customElement("health-chat")
|
|
24
25
|
export class HealthChat extends LitElement {
|
|
@@ -85,7 +86,7 @@ export class HealthChat extends LitElement {
|
|
|
85
86
|
private currentLeadSource: string | null = null;
|
|
86
87
|
|
|
87
88
|
@state()
|
|
88
|
-
private displayPubnubChat = false;
|
|
89
|
+
private displayPubnubChat = isMobile() ? false : true;
|
|
89
90
|
|
|
90
91
|
@state()
|
|
91
92
|
private myPubnub: MyPubnub | null = null;
|