@meetelise/chat 1.22.10 → 1.22.11
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
|
@@ -152,17 +152,17 @@
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
MEChat.start({
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
organization: "test-company",
|
|
156
|
+
building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
|
|
157
157
|
|
|
158
158
|
// organization: "4c78cac8-017a-4497-8b71-3df15779a83c",
|
|
159
159
|
|
|
160
160
|
// building: "43e3b1bc-d1b2-11ee-acb9-d77ba815aaac",
|
|
161
161
|
|
|
162
162
|
// organization: "cardinal-group",
|
|
163
|
-
widgetType: "utilities",
|
|
163
|
+
// widgetType: "utilities",
|
|
164
164
|
|
|
165
|
-
organization: "test-company",
|
|
165
|
+
// organization: "test-company",
|
|
166
166
|
// building: "e2e-test-yardi-building",
|
|
167
167
|
// overrideRentgrata: true,
|
|
168
168
|
// onWidgetLoaded: onWidgetLoaded,
|
package/public/dist/index.js
CHANGED
|
@@ -4653,7 +4653,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4653
4653
|
position: fixed;
|
|
4654
4654
|
bottom: 0;
|
|
4655
4655
|
}
|
|
4656
|
-
`,Ao([le({type:String})],Co.prototype,"buildingSlug",void 0),Ao([le({type:String})],Co.prototype,"orgSlug",void 0),Ao([le({type:Object})],Co.prototype,"launcherStyles",void 0),Ao([le()],Co.prototype,"mobileStyles",void 0),Ao([le({type:Boolean})],Co.prototype,"isMinimized",void 0),Ao([le({type:String})],Co.prototype,"brandColor",void 0),Ao([le({type:String})],Co.prototype,"backgroundColor",void 0),Ao([ue()],Co.prototype,"chatId",void 0),Ao([ue()],Co.prototype,"analytics",void 0),Ao([ue()],Co.prototype,"launcher",void 0),Ao([ue()],Co.prototype,"building",void 0),Ao([ue()],Co.prototype,"designConcept",void 0),Ao([ue()],Co.prototype,"leadSources",void 0),Ao([ue()],Co.prototype,"currentLeadSource",void 0),Ao([ue()],Co.prototype,"featureFlagShowDropdown",void 0),Ao([ue()],Co.prototype,"phoneNumberForSource",void 0),Ao([ue()],Co.prototype,"hasMounted",void 0),Ao([ue()],Co.prototype,"hideLauncher",void 0),Ao([ue()],Co.prototype,"isLoading",void 0),Ao([ue()],Co.prototype,"showTourNextToChat",void 0),Ao([ue()],Co.prototype,"displayPubnubChat",void 0),Ao([ue()],Co.prototype,"myPubnub",void 0),Ao([ue()],Co.prototype,"LeadSourceClient",void 0),Ao([le({type:Number})],Co.prototype,"right",void 0),Ao([le({type:Number})],Co.prototype,"bottom",void 0),Ao([le({type:Number})],Co.prototype,"top",void 0),Ao([le({type:Number})],Co.prototype,"left",void 0),Ao([le({attribute:!0})],Co.prototype,"overrideRentgrata",void 0),Ao([le({attribute:!0})],Co.prototype,"widgetType",void 0),Ao([le()],Co.prototype,"onWidgetLoaded",void 0),Ao([ue()],Co.prototype,"enabledChatWidgets",void 0),Ao([ue()],Co.prototype,"webchatConfigHasAutoOpenChat",void 0),Ao([ue()],Co.prototype,"requiresConsent",void 0),Ao([ue()],Co.prototype,"hideMobileFeatures",void 0),Ao([ue()],Co.prototype,"privacyPolicyUrl",void 0),Co=Ao([ae("me-chat")],Co);const Oo=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Io=async(e,i,n)=>{var r;if(!i||!e)return;const o=await async function(e){if(!e)return!1;try{return(await t().get(Ki(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}}(i);if(!o)return;const a=Oo(["myContactForm","contactus","fpa-myContactForm"]);let s;if(!(a&&a instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&No(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(a.parentElement&&"scheduleTourForm"===a.parentElement.id)return No(i,e,"Form is apart of schedule tour form!")}catch(e){console.error("error",e)}for(let e=0;e<a.elements.length;e++){const t=a.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){s=t;break}if("fpa-contact-submit"===t.getAttribute("id")){s=t;break}}if(!s)return No(i,e,"Could not find submit button");const l=()=>({firstName:Oo(["firstname","txtName","fpa-firstname"]),lastName:Oo(["lastname","txtName2","fpa-lastname"]),email:Oo(["email","txtEmail","fpa-email"]),phone:Oo(["phonenumber","txtPhone","fpa-phonenumber"]),message:Oo(["message","txtComments","fpa-email"])});if(Object.values(l()).some((e=>null===e))){const t=Object.entries(l()).filter((([,e])=>null===e)).map((([e])=>e));return No(i,e,"Missing the following form elements: "+t.join(", "))}const u=s.textContent,d=s.cloneNode(!0);null===(r=s.parentNode)||void 0===r||r.replaceChild(d,s),d.onclick=async function(t){if(Object.values(l()).forEach((e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")})),!Object.values(l()).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(),d.textContent="Processing request...",d.disabled=!0;const r={};Object.entries(l()).forEach((([e,t])=>r[e]=null==t?void 0:t.value));const o=await Sn(e,i);if(!o)return No(i,e,"Could not find building"),null;const s={email_address:r.email,first_name:r.firstName,last_name:r.lastName,phone_number:r.phone,first_message:r.message,building_id:o.id,is_external_form:!0,lead_sources:[...new Set(n?[n,fn(e)]:[fn(e)])]},c=JSON.stringify(s);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:c}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return a&&a.reset(),Object.values(l()).forEach((e=>{e&&(e.disabled=!0)})),d.textContent="Submitted",d.disabled=!0,e.json()})).catch((()=>{d.textContent=u}))}},No=(e,t,i,n)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:i,url:window.location.href,formIdInfo:n});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})},Eo=l`
|
|
4656
|
+
`,Ao([le({type:String})],Co.prototype,"buildingSlug",void 0),Ao([le({type:String})],Co.prototype,"orgSlug",void 0),Ao([le({type:Object})],Co.prototype,"launcherStyles",void 0),Ao([le()],Co.prototype,"mobileStyles",void 0),Ao([le({type:Boolean})],Co.prototype,"isMinimized",void 0),Ao([le({type:String})],Co.prototype,"brandColor",void 0),Ao([le({type:String})],Co.prototype,"backgroundColor",void 0),Ao([ue()],Co.prototype,"chatId",void 0),Ao([ue()],Co.prototype,"analytics",void 0),Ao([ue()],Co.prototype,"launcher",void 0),Ao([ue()],Co.prototype,"building",void 0),Ao([ue()],Co.prototype,"designConcept",void 0),Ao([ue()],Co.prototype,"leadSources",void 0),Ao([ue()],Co.prototype,"currentLeadSource",void 0),Ao([ue()],Co.prototype,"featureFlagShowDropdown",void 0),Ao([ue()],Co.prototype,"phoneNumberForSource",void 0),Ao([ue()],Co.prototype,"hasMounted",void 0),Ao([ue()],Co.prototype,"hideLauncher",void 0),Ao([ue()],Co.prototype,"isLoading",void 0),Ao([ue()],Co.prototype,"showTourNextToChat",void 0),Ao([ue()],Co.prototype,"displayPubnubChat",void 0),Ao([ue()],Co.prototype,"myPubnub",void 0),Ao([ue()],Co.prototype,"LeadSourceClient",void 0),Ao([le({type:Number})],Co.prototype,"right",void 0),Ao([le({type:Number})],Co.prototype,"bottom",void 0),Ao([le({type:Number})],Co.prototype,"top",void 0),Ao([le({type:Number})],Co.prototype,"left",void 0),Ao([le({attribute:!0})],Co.prototype,"overrideRentgrata",void 0),Ao([le({attribute:!0})],Co.prototype,"widgetType",void 0),Ao([le()],Co.prototype,"onWidgetLoaded",void 0),Ao([ue()],Co.prototype,"enabledChatWidgets",void 0),Ao([ue()],Co.prototype,"webchatConfigHasAutoOpenChat",void 0),Ao([ue()],Co.prototype,"requiresConsent",void 0),Ao([ue()],Co.prototype,"hideMobileFeatures",void 0),Ao([ue()],Co.prototype,"privacyPolicyUrl",void 0),Co=Ao([ae("me-chat")],Co);const Oo=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Io=async(e,i,n)=>{var r;if(!i||!e)return;const o=await async function(e){if(!e)return!1;try{return(await t().get(Ki(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}}(i);if(!o)return;const a=Oo(["myContactForm","contactus","fpa-myContactForm","contact-form"]);let s;if(!(a&&a instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&No(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(a.parentElement&&"scheduleTourForm"===a.parentElement.id)return No(i,e,"Form is apart of schedule tour form!")}catch(e){console.error("error",e)}for(let e=0;e<a.elements.length;e++){const t=a.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){s=t;break}if("fpa-contact-submit"===t.getAttribute("id")){s=t;break}if(t.classList.contains("form__field--submit")){s=t;break}}if(!s)return No(i,e,"Could not find submit button");const l=()=>({firstName:Oo(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:Oo(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:Oo(["email","txtEmail","fpa-email","Form_Email"]),phone:Oo(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:Oo(["message","txtComments","fpa-email","Form_Message"])});if(Object.values(l()).some((e=>null===e))){const t=Object.entries(l()).filter((([,e])=>null===e)).map((([e])=>e));return No(i,e,"Missing the following form elements: "+t.join(", "))}const u=s.textContent,d=s.cloneNode(!0);null===(r=s.parentNode)||void 0===r||r.replaceChild(d,s),d.onclick=async function(t){if(Object.values(l()).forEach((e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")})),!Object.values(l()).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(),d.textContent="Processing request...",d.disabled=!0;const r={};Object.entries(l()).forEach((([e,t])=>r[e]=null==t?void 0:t.value));const o=await Sn(e,i);if(!o)return No(i,e,"Could not find building"),null;const s={email_address:r.email,first_name:r.firstName,last_name:r.lastName,phone_number:r.phone,first_message:r.message,building_id:o.id,is_external_form:!0,lead_sources:[...new Set(n?[n,fn(e)]:[fn(e)])]},c=JSON.stringify(s);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:c}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return a&&a.reset(),Object.values(l()).forEach((e=>{e&&(e.disabled=!0)})),d.textContent="Submitted",d.disabled=!0,e.json()})).catch((()=>{d.textContent=u}))}},No=(e,t,i,n)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:i,url:window.location.href,formIdInfo:n});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})},Eo=l`
|
|
4657
4657
|
.chat-launcher {
|
|
4658
4658
|
position: fixed;
|
|
4659
4659
|
}
|
|
@@ -952,6 +952,7 @@ const overrideContactUsForm = async (
|
|
|
952
952
|
"myContactForm",
|
|
953
953
|
"contactus",
|
|
954
954
|
"fpa-myContactForm",
|
|
955
|
+
"contact-form",
|
|
955
956
|
]);
|
|
956
957
|
let btn = undefined;
|
|
957
958
|
|
|
@@ -997,6 +998,11 @@ const overrideContactUsForm = async (
|
|
|
997
998
|
btn = element;
|
|
998
999
|
break;
|
|
999
1000
|
}
|
|
1001
|
+
// for entrata forms https://arrelloapts.com/contact/
|
|
1002
|
+
if (element.classList.contains("form__field--submit")) {
|
|
1003
|
+
btn = element;
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1000
1006
|
}
|
|
1001
1007
|
|
|
1002
1008
|
if (!btn) {
|
|
@@ -1015,30 +1021,34 @@ const overrideContactUsForm = async (
|
|
|
1015
1021
|
"firstname",
|
|
1016
1022
|
"txtName",
|
|
1017
1023
|
"fpa-firstname",
|
|
1024
|
+
"Form_FirstName",
|
|
1018
1025
|
]) as HTMLInputElement | null;
|
|
1019
1026
|
const lastName = findElementById([
|
|
1020
1027
|
"lastname",
|
|
1021
1028
|
"txtName2",
|
|
1022
1029
|
"fpa-lastname",
|
|
1030
|
+
"Form_LastName",
|
|
1023
1031
|
]) as HTMLInputElement | null;
|
|
1024
1032
|
const email = findElementById([
|
|
1025
1033
|
"email",
|
|
1026
1034
|
"txtEmail",
|
|
1027
1035
|
"fpa-email",
|
|
1036
|
+
"Form_Email",
|
|
1028
1037
|
]) as HTMLInputElement | null;
|
|
1029
1038
|
const phone = findElementById([
|
|
1030
1039
|
"phonenumber",
|
|
1031
1040
|
"txtPhone",
|
|
1032
1041
|
"fpa-phonenumber",
|
|
1042
|
+
"Form_Phone",
|
|
1033
1043
|
]) as HTMLInputElement | null;
|
|
1034
1044
|
const message = findElementById([
|
|
1035
1045
|
"message",
|
|
1036
1046
|
"txtComments",
|
|
1037
1047
|
"fpa-email",
|
|
1048
|
+
"Form_Message",
|
|
1038
1049
|
]) as HTMLTextAreaElement | null;
|
|
1039
1050
|
|
|
1040
1051
|
const formElements = { firstName, lastName, email, phone, message };
|
|
1041
|
-
|
|
1042
1052
|
return formElements;
|
|
1043
1053
|
};
|
|
1044
1054
|
|