@meetelise/chat 1.59.2 → 1.59.3

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.
@@ -54,6 +54,9 @@ export declare class EmailUsWindow extends LitElement {
54
54
  hasBrokerNameError: boolean;
55
55
  brokerEmailError: string | null;
56
56
  hasSubmittedForm: boolean;
57
+ /** The backend matched the submitter's own email to a broker the org already has: it made no lead and emailed
58
+ * them their submission link, so the confirmation mustn't promise that the leasing team will be in touch. */
59
+ isKnownBroker: boolean;
57
60
  windowHeight: number;
58
61
  hasSubmissionError: boolean;
59
62
  isSubmitting: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.59.2",
3
+ "version": "1.59.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
@@ -4302,7 +4302,7 @@ xmlns="http://www.w3.org/2000/svg"
4302
4302
  border-radius: 0px 0px 0px 0px;
4303
4303
  }
4304
4304
  }
4305
- `,mu([pe({type:String})],bu.prototype,"height",void 0),mu([pe({type:String})],bu.prototype,"width",void 0),mu([pe({type:Boolean})],bu.prototype,"useRoundedBorders",void 0),mu([pe({type:String})],bu.prototype,"headerText",void 0),mu([pe({attribute:!1})],bu.prototype,"onCloseClick",void 0),mu([fe()],bu.prototype,"isMobileSized",void 0),mu([pe({attribute:!0})],bu.prototype,"useGradientDesign",void 0),bu=mu([ce("details-window")],bu);var yu=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 vu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{Xl(e,this)},this.movedFocusInside=!1,this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.brokerIntakeEnabled=!1,this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.message="",this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.hasBrokerPhoneError=!1,this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,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=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone);t&&n?(this.brokerFirstName=this.firstName,this.brokerLastName=this.lastName,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=!!this.phoneNumberE164,this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null):t||this.firstName||this.lastName||this.email||this.phoneNumber||(this.firstName=this.brokerFirstName,this.lastName=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1),this.isBrokerReferral=t,this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1,this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onChangeBrokerField=e=>t=>{t.target&&(this[e]=t.target.value)},this.baseHeight=()=>525+(this.brokerIntakeEnabled&&this.isBrokerReferral?143:0),this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?Yo(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1;const e=this.brokerReferral();e&&(this.hasBrokerNameError=Ko(e),this.brokerEmailError=Xo(e,this.email),this.hasBrokerPhoneError=!!this.brokerPhone&&!this.brokerPhoneIsValid),this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&Lr(this.email)||(this.hasEmailError=!0),this.phoneNumberE164||(this.hasPhoneNumberError=!0),this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(this.isSubmitting)return;if(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError||this.hasBrokerNameError||this.brokerEmailError||this.hasBrokerPhoneError)return;const a=this.phoneNumberE164;if(a)try{this.isSubmitting=!0,this.windowHeight=this.baseHeight()+60;const s=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource;await wu(this.firstName,this.lastName,this.email,a,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(s?[s,aa(this.orgSlug)]:[aa(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}),this.brokerReferral()),null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}else this.hasPhoneNumberError=!0},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError,this.hasBrokerNameError,!!this.brokerEmailError,this.hasBrokerPhoneError].filter(e=>e).length,this.renderBrokerToggle=()=>H`
4305
+ `,mu([pe({type:String})],bu.prototype,"height",void 0),mu([pe({type:String})],bu.prototype,"width",void 0),mu([pe({type:Boolean})],bu.prototype,"useRoundedBorders",void 0),mu([pe({type:String})],bu.prototype,"headerText",void 0),mu([pe({attribute:!1})],bu.prototype,"onCloseClick",void 0),mu([fe()],bu.prototype,"isMobileSized",void 0),mu([pe({attribute:!0})],bu.prototype,"useGradientDesign",void 0),bu=mu([ce("details-window")],bu);var yu=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 vu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{Xl(e,this)},this.movedFocusInside=!1,this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.brokerIntakeEnabled=!1,this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.message="",this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.hasBrokerPhoneError=!1,this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasSubmittedForm=!1,this.isKnownBroker=!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=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone);t&&n?(this.brokerFirstName=this.firstName,this.brokerLastName=this.lastName,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=!!this.phoneNumberE164,this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null):t||this.firstName||this.lastName||this.email||this.phoneNumber||(this.firstName=this.brokerFirstName,this.lastName=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1),this.isBrokerReferral=t,this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1,this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onChangeBrokerField=e=>t=>{t.target&&(this[e]=t.target.value)},this.baseHeight=()=>525+(this.brokerIntakeEnabled&&this.isBrokerReferral?143:0),this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?Yo(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1;const e=this.brokerReferral();e&&(this.hasBrokerNameError=Ko(e),this.brokerEmailError=Xo(e,this.email),this.hasBrokerPhoneError=!!this.brokerPhone&&!this.brokerPhoneIsValid),this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&Lr(this.email)||(this.hasEmailError=!0),this.phoneNumberE164||(this.hasPhoneNumberError=!0),this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(this.isSubmitting)return;if(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError||this.hasBrokerNameError||this.brokerEmailError||this.hasBrokerPhoneError)return;const a=this.phoneNumberE164;if(a)try{this.isSubmitting=!0,this.windowHeight=this.baseHeight()+60;const s=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,{knownBroker:l}=await wu(this.firstName,this.lastName,this.email,a,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(s?[s,aa(this.orgSlug)]:[aa(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}),this.brokerReferral());null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.isKnownBroker=l,this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}else this.hasPhoneNumberError=!0},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError,this.hasBrokerNameError,!!this.brokerEmailError,this.hasBrokerPhoneError].filter(e=>e).length,this.renderBrokerToggle=()=>H`
4306
4306
  <label class="email-us__broker-toggle">
4307
4307
  <span>Are you a broker or locator?</span>
4308
4308
  <input
@@ -4402,7 +4402,7 @@ xmlns="http://www.w3.org/2000/svg"
4402
4402
  </div>
4403
4403
  <div class="email-us__vertical-spacer"></div>
4404
4404
  <div class="email-us__submitted-info">
4405
- ${this.isBrokerReferral?"Thank you for the referral. A member of our leasing team will contact your client.":"Thank you for your message. A member of our leasing team will contact you."}
4405
+ ${this.isKnownBroker?"It looks like you're a broker or locator. We've emailed you a link where you can submit your client.":this.isBrokerReferral?"Thank you for the referral. A member of our leasing team will contact your client.":"Thank you for your message. A member of our leasing team will contact you."}
4406
4406
  </div>
4407
4407
  </div>
4408
4408
  </details-window>
@@ -4641,7 +4641,7 @@ xmlns="http://www.w3.org/2000/svg"
4641
4641
  width: 50%;
4642
4642
  }
4643
4643
  }
4644
- `,Me],yu([pe({attribute:!1})],vu.prototype,"leadSources",void 0),yu([pe({attribute:!1})],vu.prototype,"onCloseClicked",void 0),yu([pe({attribute:!0})],vu.prototype,"chatId",void 0),yu([pe({attribute:!1})],vu.prototype,"buildingId",void 0),yu([pe({attribute:!0})],vu.prototype,"buildingSlug",void 0),yu([pe({attribute:!0})],vu.prototype,"orgSlug",void 0),yu([pe({attribute:!0})],vu.prototype,"buildingName",void 0),yu([pe({attribute:!0})],vu.prototype,"orgLegalName",void 0),yu([pe({attribute:!1})],vu.prototype,"country",void 0),yu([pe({attribute:!1})],vu.prototype,"buildingState",void 0),yu([pe({attribute:!0})],vu.prototype,"leadSourceClient",void 0),yu([pe({attribute:!0})],vu.prototype,"leadSourceMultitouchClient",void 0),yu([pe({attribute:!0})],vu.prototype,"featureFlagShowDropdown",void 0),yu([pe({attribute:!1})],vu.prototype,"brokerIntakeEnabled",void 0),yu([pe()],vu.prototype,"privatePolicyUrl",void 0),yu([pe()],vu.prototype,"termsOfServiceUrl",void 0),yu([fe()],vu.prototype,"firstName",void 0),yu([fe()],vu.prototype,"lastName",void 0),yu([fe()],vu.prototype,"email",void 0),yu([fe()],vu.prototype,"phoneNumber",void 0),yu([fe()],vu.prototype,"phoneNumberE164",void 0),yu([fe()],vu.prototype,"phoneCountry",void 0),yu([fe()],vu.prototype,"message",void 0),yu([fe()],vu.prototype,"isBrokerReferral",void 0),yu([fe()],vu.prototype,"brokerFirstName",void 0),yu([fe()],vu.prototype,"brokerLastName",void 0),yu([fe()],vu.prototype,"brokerEmail",void 0),yu([fe()],vu.prototype,"brokerFirmName",void 0),yu([fe()],vu.prototype,"brokerPhone",void 0),yu([fe()],vu.prototype,"brokerPhoneE164",void 0),yu([fe()],vu.prototype,"brokerPhoneCountry",void 0),yu([fe()],vu.prototype,"brokerPhoneIsValid",void 0),yu([fe()],vu.prototype,"hasBrokerPhoneError",void 0),yu([ge("me-select#leadSource")],vu.prototype,"selectedLeadSource",void 0),yu([pe({attribute:!0})],vu.prototype,"currentLeadSource",void 0),yu([fe()],vu.prototype,"hasNameError",void 0),yu([fe()],vu.prototype,"hasEmailError",void 0),yu([fe()],vu.prototype,"hasPhoneNumberError",void 0),yu([fe()],vu.prototype,"hasMessageError",void 0),yu([fe()],vu.prototype,"hasBrokerNameError",void 0),yu([fe()],vu.prototype,"brokerEmailError",void 0),yu([fe()],vu.prototype,"hasSubmittedForm",void 0),yu([fe()],vu.prototype,"windowHeight",void 0),yu([fe()],vu.prototype,"hasSubmissionError",void 0),yu([fe()],vu.prototype,"isSubmitting",void 0),vu=yu([ce("email-us-window")],vu);const wu=async(e,t,n,i,o,a,s,u,d,c,h,p)=>{const f=new URLSearchParams(window.location.search),g={email_address:n,building_id:a,lead_sources:d,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(f.entries()),conversation_tracking_id:c,tracking_params:l(s),lead_sources_with_timestamps:(null!=h?h:[]).map(e=>_r({...e})),...Zo(p)};Eo("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:d.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=c?c:null,...p?{isBrokerReferral:!0}:{}}),await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",g,{headers:{"building-slug":u,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},Cu=(e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
4644
+ `,Me],yu([pe({attribute:!1})],vu.prototype,"leadSources",void 0),yu([pe({attribute:!1})],vu.prototype,"onCloseClicked",void 0),yu([pe({attribute:!0})],vu.prototype,"chatId",void 0),yu([pe({attribute:!1})],vu.prototype,"buildingId",void 0),yu([pe({attribute:!0})],vu.prototype,"buildingSlug",void 0),yu([pe({attribute:!0})],vu.prototype,"orgSlug",void 0),yu([pe({attribute:!0})],vu.prototype,"buildingName",void 0),yu([pe({attribute:!0})],vu.prototype,"orgLegalName",void 0),yu([pe({attribute:!1})],vu.prototype,"country",void 0),yu([pe({attribute:!1})],vu.prototype,"buildingState",void 0),yu([pe({attribute:!0})],vu.prototype,"leadSourceClient",void 0),yu([pe({attribute:!0})],vu.prototype,"leadSourceMultitouchClient",void 0),yu([pe({attribute:!0})],vu.prototype,"featureFlagShowDropdown",void 0),yu([pe({attribute:!1})],vu.prototype,"brokerIntakeEnabled",void 0),yu([pe()],vu.prototype,"privatePolicyUrl",void 0),yu([pe()],vu.prototype,"termsOfServiceUrl",void 0),yu([fe()],vu.prototype,"firstName",void 0),yu([fe()],vu.prototype,"lastName",void 0),yu([fe()],vu.prototype,"email",void 0),yu([fe()],vu.prototype,"phoneNumber",void 0),yu([fe()],vu.prototype,"phoneNumberE164",void 0),yu([fe()],vu.prototype,"phoneCountry",void 0),yu([fe()],vu.prototype,"message",void 0),yu([fe()],vu.prototype,"isBrokerReferral",void 0),yu([fe()],vu.prototype,"brokerFirstName",void 0),yu([fe()],vu.prototype,"brokerLastName",void 0),yu([fe()],vu.prototype,"brokerEmail",void 0),yu([fe()],vu.prototype,"brokerFirmName",void 0),yu([fe()],vu.prototype,"brokerPhone",void 0),yu([fe()],vu.prototype,"brokerPhoneE164",void 0),yu([fe()],vu.prototype,"brokerPhoneCountry",void 0),yu([fe()],vu.prototype,"brokerPhoneIsValid",void 0),yu([fe()],vu.prototype,"hasBrokerPhoneError",void 0),yu([ge("me-select#leadSource")],vu.prototype,"selectedLeadSource",void 0),yu([pe({attribute:!0})],vu.prototype,"currentLeadSource",void 0),yu([fe()],vu.prototype,"hasNameError",void 0),yu([fe()],vu.prototype,"hasEmailError",void 0),yu([fe()],vu.prototype,"hasPhoneNumberError",void 0),yu([fe()],vu.prototype,"hasMessageError",void 0),yu([fe()],vu.prototype,"hasBrokerNameError",void 0),yu([fe()],vu.prototype,"brokerEmailError",void 0),yu([fe()],vu.prototype,"hasSubmittedForm",void 0),yu([fe()],vu.prototype,"isKnownBroker",void 0),yu([fe()],vu.prototype,"windowHeight",void 0),yu([fe()],vu.prototype,"hasSubmissionError",void 0),yu([fe()],vu.prototype,"isSubmitting",void 0),vu=yu([ce("email-us-window")],vu);const wu=async(e,t,n,i,o,a,s,u,d,c,h,p)=>{var f;const g=new URLSearchParams(window.location.search),m={email_address:n,building_id:a,lead_sources:d,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(g.entries()),conversation_tracking_id:c,tracking_params:l(s),lead_sources_with_timestamps:(null!=h?h:[]).map(e=>_r({...e})),...Zo(p)};Eo("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:d.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=c?c:null,...p?{isBrokerReferral:!0}:{}});return{knownBroker:!0===(null===(f=(await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",m,{headers:{"building-slug":u,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})).data)||void 0===f?void 0:f.known_broker)}},Cu=(e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
4645
4645
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.95487 2.54301e-07H7.04513C8.51534 -1.22821e-05 9.67985 -2.22686e-05 10.5912 0.121084C11.5292 0.24572 12.2883 0.508324 12.887 1.10005C13.4857 1.69178 13.7514 2.44211 13.8775 3.36914C14 4.26992 14 5.42089 14 6.874V10.126C14 11.5791 14 12.7301 13.8775 13.6309C13.7514 14.5579 13.4857 15.3082 12.887 15.8999C12.2883 16.4917 11.5292 16.7543 10.5912 16.8789C9.67985 17 8.51534 17 7.04513 17H6.95487C5.48466 17 4.32015 17 3.40878 16.8789C2.47084 16.7543 1.71169 16.4917 1.11299 15.8999C0.514304 15.3082 0.248611 14.5579 0.122508 13.6309C-2.25306e-05 12.7301 -1.24266e-05 11.5791 2.57292e-07 10.126V6.87399C-1.24266e-05 5.42088 -2.25306e-05 4.26992 0.122508 3.36914C0.248611 2.44211 0.514304 1.69178 1.11299 1.10005C1.71169 0.508324 2.47084 0.24572 3.40878 0.121084C4.32015 -2.22686e-05 5.48466 -1.22821e-05 6.95487 2.54301e-07ZM2.85118 1.44157C2.45996 1.55714 2.18378 1.71904 1.96152 1.93871C1.62295 2.27335 1.42002 2.73167 1.31181 3.52718C1.20127 4.33975 1.2 5.41089 1.2 6.9186V10.0814C1.2 11.5891 1.20127 12.6602 1.31181 13.4728C1.42002 14.2683 1.62295 14.7267 1.96152 15.0613C2.30009 15.3959 2.76381 15.5965 3.56868 15.7034C4.39081 15.8127 5.47454 15.814 7 15.814C8.52546 15.814 9.60919 15.8127 10.4313 15.7034C11.2362 15.5965 11.6999 15.3959 12.0385 15.0613C12.377 14.7267 12.58 14.2683 12.6882 13.4728C12.7987 12.6602 12.8 11.5891 12.8 10.0814V6.9186C12.8 5.41089 12.7987 4.33975 12.6882 3.52718C12.58 2.73167 12.377 2.27335 12.0385 1.93871C11.8162 1.71905 11.54 1.55714 11.1488 1.44157C10.6194 2.22728 10.2493 2.77349 9.69896 3.1115C9.58916 3.17894 9.47507 3.23928 9.3574 3.29217C8.76366 3.55903 8.09363 3.55868 7.12834 3.55818C7.08613 3.55816 7.04336 3.55814 7 3.55814C6.95664 3.55814 6.91387 3.55816 6.87166 3.55818C5.90637 3.55868 5.23634 3.55903 4.6426 3.29217C4.52493 3.23928 4.41084 3.17894 4.30104 3.1115C3.75069 2.77349 3.38057 2.22729 2.85118 1.44157ZM4.16103 1.2383C4.51629 1.74715 4.70232 1.96157 4.9344 2.10411C5.00028 2.14457 5.06873 2.18078 5.13933 2.21251C5.46646 2.35954 5.85406 2.37209 7 2.37209C8.14594 2.37209 8.53354 2.35954 8.86066 2.21251C8.93127 2.18078 8.99972 2.14457 9.0656 2.10411C9.29768 1.96157 9.48371 1.74715 9.83897 1.2383C9.10278 1.18681 8.18457 1.18605 7 1.18605C5.81543 1.18605 4.89722 1.18681 4.16103 1.2383ZM4 14.0349C4 13.7074 4.26863 13.4419 4.6 13.4419H9.4C9.73137 13.4419 10 13.7074 10 14.0349C10 14.3624 9.73137 14.6279 9.4 14.6279H4.6C4.26863 14.6279 4 14.3624 4 14.0349Z" fill="${e}"/>
4646
4646
  </svg>`,xu={},$u=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Su=async e=>{const t=await(async e=>{if(xu[e])return xu[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return xu[e]=n.data,n.data})(e);return $u.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var Au=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 ku=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{Xl(e,this)},this.movedFocusInside=!1,this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Oe(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await Su(this.buildingId))},this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return H`<a href="tel:${i}"
4647
4647
  >${e}</a
@@ -297,6 +297,10 @@ export class EmailUsWindow extends LitElement {
297
297
  brokerEmailError: string | null = null;
298
298
  @state()
299
299
  hasSubmittedForm = false;
300
+ /** The backend matched the submitter's own email to a broker the org already has: it made no lead and emailed
301
+ * them their submission link, so the confirmation mustn't promise that the leasing team will be in touch. */
302
+ @state()
303
+ isKnownBroker = false;
300
304
  @state()
301
305
  windowHeight = 525;
302
306
  @state()
@@ -499,7 +503,7 @@ export class EmailUsWindow extends LitElement {
499
503
  this.selectedLeadSource && this.selectedLeadSource.value
500
504
  ? this.selectedLeadSource.value
501
505
  : this.currentLeadSource;
502
- await createEmail(
506
+ const { knownBroker } = await createEmail(
503
507
  this.firstName,
504
508
  this.lastName,
505
509
  this.email,
@@ -536,6 +540,7 @@ export class EmailUsWindow extends LitElement {
536
540
  });
537
541
  this.leadSourceClient?.resetLeadSource();
538
542
  this.leadSourceMultitouchClient?.resetLeadSourceTouchpoints();
543
+ this.isKnownBroker = knownBroker;
539
544
  this.hasSubmittedForm = true;
540
545
  this.isSubmitting = false;
541
546
  // Remove the height of the button when it leaves the loading state
@@ -687,7 +692,9 @@ export class EmailUsWindow extends LitElement {
687
692
  </div>
688
693
  <div class="email-us__vertical-spacer"></div>
689
694
  <div class="email-us__submitted-info">
690
- ${this.isBrokerReferral
695
+ ${this.isKnownBroker
696
+ ? "It looks like you're a broker or locator. We've emailed you a link where you can submit your client."
697
+ : this.isBrokerReferral
691
698
  ? "Thank you for the referral. A member of our leasing team will contact your client."
692
699
  : "Thank you for your message. A member of our leasing team will contact you."}
693
700
  </div>
@@ -873,7 +880,7 @@ const createEmail = async (
873
880
  chatId?: string | null,
874
881
  leadSourcesWithTimestamps?: LeadSourceSubmittedListItem[],
875
882
  broker?: BrokerReferral | null
876
- ) => {
883
+ ): Promise<{ knownBroker: boolean }> => {
877
884
  const queryParams = new URLSearchParams(window.location.search);
878
885
  const requestBody = {
879
886
  email_address: email,
@@ -906,7 +913,7 @@ const createEmail = async (
906
913
  // A flag only: the broker's own details stay out of the data layer.
907
914
  ...(broker ? { isBrokerReferral: true } : {}),
908
915
  });
909
- await axios.post(
916
+ const response = await axios.post<{ known_broker?: boolean }>(
910
917
  "https://app.meetelise.com/platformApi/state/create/emailMe",
911
918
  requestBody,
912
919
  {
@@ -917,4 +924,5 @@ const createEmail = async (
917
924
  },
918
925
  }
919
926
  );
927
+ return { knownBroker: response.data?.known_broker === true };
920
928
  };
@@ -85,6 +85,53 @@ it("sends a broker referral with the client as the prospect and the broker field
85
85
  expect(JSON.stringify(event)).not.to.contain("bea@realty.example.com");
86
86
  });
87
87
 
88
+ const submittedText = async (emailUs: EmailUsWindow): Promise<string> => {
89
+ await emailUs.updateComplete;
90
+ return (
91
+ emailUs.shadowRoot
92
+ ?.querySelector(".email-us__submitted-info")
93
+ ?.textContent?.trim() ?? ""
94
+ );
95
+ };
96
+
97
+ it("tells a known broker writing in as the lead that they've been emailed their submission link", async () => {
98
+ const requests = captureRequests();
99
+ const emailUs = createForm({ brokerIntakeEnabled: true });
100
+ document.body.appendChild(emailUs);
101
+
102
+ const submission = emailUs.onClick();
103
+ requests[0].respond(
104
+ 200,
105
+ { "Content-Type": "application/json" },
106
+ JSON.stringify({ status: "ok", known_broker: true })
107
+ );
108
+ await submission;
109
+
110
+ expect(await submittedText(emailUs)).to.contain(
111
+ "We've emailed you a link where you can submit your client."
112
+ );
113
+ emailUs.remove();
114
+ });
115
+
116
+ it("tells any other lead the leasing team will be in touch", async () => {
117
+ const requests = captureRequests();
118
+ const emailUs = createForm({ brokerIntakeEnabled: true });
119
+ document.body.appendChild(emailUs);
120
+
121
+ const submission = emailUs.onClick();
122
+ requests[0].respond(
123
+ 200,
124
+ { "Content-Type": "application/json" },
125
+ JSON.stringify({ status: "ok" })
126
+ );
127
+ await submission;
128
+
129
+ expect(await submittedText(emailUs)).to.equal(
130
+ "Thank you for your message. A member of our leasing team will contact you."
131
+ );
132
+ emailUs.remove();
133
+ });
134
+
88
135
  it("sends the broker's phone on a referral email when they gave one", async () => {
89
136
  const requests = captureRequests();
90
137
  const emailUs = createForm({