@meetelise/chat 1.20.165 → 1.20.166

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.20.165",
3
+ "version": "1.20.166",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -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=!0,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`
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=!1,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
@@ -3861,7 +3861,6 @@ otherwise there's some empty space at the bottom of the button, which interferes
3861
3861
  display: flex;
3862
3862
  justify-content: center;
3863
3863
  align-items: center;
3864
- margin-right: 40px;
3865
3864
  }
3866
3865
  #typeMobile-bttn:hover > #typeMobile-inner {
3867
3866
  background: #eaecf4;
@@ -49,7 +49,6 @@ export class HealthChat extends LitElement {
49
49
  display: flex;
50
50
  justify-content: center;
51
51
  align-items: center;
52
- margin-right: 40px;
53
52
  }
54
53
  #typeMobile-bttn:hover > #typeMobile-inner {
55
54
  background: #eaecf4;
@@ -85,9 +84,8 @@ export class HealthChat extends LitElement {
85
84
  @state()
86
85
  private currentLeadSource: string | null = null;
87
86
 
88
- // Default to open
89
87
  @state()
90
- private displayPubnubChat = true;
88
+ private displayPubnubChat = false;
91
89
 
92
90
  @state()
93
91
  private myPubnub: MyPubnub | null = null;
@@ -120,7 +120,7 @@ export class PubnubChat extends LitElement {
120
120
 
121
121
  render(): TemplateResult {
122
122
  if (!this.buildingSlug) {
123
- return html``; // error here
123
+ return html``; // error should be here
124
124
  }
125
125
 
126
126
  if (!this.building) {