@meetelise/chat 1.20.96 → 1.20.97
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
|
@@ -2068,7 +2068,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2068
2068
|
border-radius: 0px 0px 0px 0px;
|
|
2069
2069
|
}
|
|
2070
2070
|
}
|
|
2071
|
-
`,Di([de({type:String})],ki.prototype,"height",void 0),Di([de({type:String})],ki.prototype,"width",void 0),Di([de({type:Boolean})],ki.prototype,"useRoundedBorders",void 0),Di([de({type:String})],ki.prototype,"headerText",void 0),Di([de({attribute:!1})],ki.prototype,"onCloseClick",void 0),Di([ce()],ki.prototype,"isMobileSized",void 0),Di([de({attribute:!0})],ki.prototype,"useGradientDesign",void 0),ki=Di([ue("details-window")],ki);const Ui=()=>{window.customElements.get("details-window")||window.customElements.define("details-window",ki)};var qi=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 Bi=class extends ae{constructor(){super(...arguments),this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.featureFlagShowDropdown="",this.phoneNumberInputRef=Oe(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Me(e))return;const t=e.target;this.phoneNumber=Re(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{_e(e)||Me(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email
|
|
2071
|
+
`,Di([de({type:String})],ki.prototype,"height",void 0),Di([de({type:String})],ki.prototype,"width",void 0),Di([de({type:Boolean})],ki.prototype,"useRoundedBorders",void 0),Di([de({type:String})],ki.prototype,"headerText",void 0),Di([de({attribute:!1})],ki.prototype,"onCloseClick",void 0),Di([ce()],ki.prototype,"isMobileSized",void 0),Di([de({attribute:!0})],ki.prototype,"useGradientDesign",void 0),ki=Di([ue("details-window")],ki);const Ui=()=>{window.customElements.get("details-window")||window.customElements.define("details-window",ki)};var qi=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 Bi=class extends ae{constructor(){super(...arguments),this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.featureFlagShowDropdown="",this.phoneNumberInputRef=Oe(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Me(e))return;const t=e.target;this.phoneNumber=Re(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{_e(e)||Me(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email)||(this.hasEmailError=!0),this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0),this.message||(this.hasMessageError=!0),this.windowHeight=525+30*this.getNumErrors()},this.onClick=async()=>{if(!(this.isSubmitting||(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError)))try{this.isSubmitting=!0,this.windowHeight=585;const e=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource;await Li(this.firstName,this.lastName,this.email,this.phoneNumber,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(e?[e,"property-website"]:["property-website"])]),Dn({chatId:this.chatId,website:window.location.origin,referrer:document.referrer,buildingSlug:this.buildingSlug,selectedLeadSource:null!=e?e:""}),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=525}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=525}},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError].filter((e=>e)).length,this.render=()=>(Ui(),Mi(),this.hasSubmittedForm?B`
|
|
2072
2072
|
<details-window
|
|
2073
2073
|
headerText=""
|
|
2074
2074
|
useGradientDesign="true"
|
|
@@ -209,7 +209,8 @@ export class EmailUsWindow extends LitElement {
|
|
|
209
209
|
if (!this.firstName || !this.lastName) {
|
|
210
210
|
this.hasNameError = true;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
213
|
+
if (!this.email || !emailRegex.test(this.email)) {
|
|
213
214
|
this.hasEmailError = true;
|
|
214
215
|
}
|
|
215
216
|
if (!this.phoneNumber || this.phoneNumber.length !== 14) {
|