@meetelise/chat 1.20.122 → 1.20.124

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.122",
3
+ "version": "1.20.124",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -119,8 +119,8 @@
119
119
  import MEChat from "/index.js";
120
120
  MEChat.start({
121
121
  // 123 Main Street
122
- // organization: "test-company",
123
- // building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
122
+ organization: "test-company",
123
+ building: "3fc93384-91f5-11ed-98a3-43f5a2f42588",
124
124
 
125
125
  // organization: "TT",
126
126
  // building: "ffc97070-5c73-11ed-8507-77860136d3bf",
@@ -133,8 +133,12 @@
133
133
  // building: "25fead9e-c76f-11ed-83b2-7b1e7b442e9f",
134
134
 
135
135
  // Taylor Street Apartments
136
- organization: "test-company",
137
- building: "e2e-test-yardi-building",
136
+ // organization: "test-company",
137
+ // building: "e2e-test-yardi-building",
138
+
139
+ // The Qual People
140
+ // organization: "Pacific Urban Residential",
141
+ // building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
138
142
 
139
143
  // organization: "Pacific Urban Residential",
140
144
  // building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
@@ -153,7 +157,7 @@
153
157
  // building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
154
158
 
155
159
  // organization: "sparrow",
156
- // building: "8e87ae6e-eae8-11ed-aae8-fb82f4692a79"
160
+ // building: "a6ce916c-9841-11ed-9474-17ca091a2996",
157
161
  });
158
162
  </script>
159
163
  <main>
@@ -894,7 +894,36 @@ otherwise there's some empty space at the bottom of the button, which interferes
894
894
  .nameInput {
895
895
  width: 100%;
896
896
  }
897
- `;var ii=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 ri=class extends re{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.buildingName="",this.tourType=null,this.shouldShowTourType={[oi.Guided]:!0,[oi.Self]:!0,[oi.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.leadSources=[],this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.brandColor=Fe,this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[oi.Guided]:!!(null===(t=null===(e=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[oi.Self]:!!(null===(i=null===(n=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[oi.Virtual]:!!(null===(o=null===(r=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[oi.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[oi.Guided],[oi.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[oi.Self],[oi.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[oi.Virtual]},1===Object.values(this.shouldShowTourType).reduce(((e,t)=>!0===t?e+1:e),0)?this.tourType=Object.keys(this.shouldShowTourType).find((e=>this.shouldShowTourType[e])):"1ac49f90-6150-11ed-b327-1b3f05e7b9db"===this.buildingSlug&&this.shouldShowTourType[oi.Self]&&(this.tourType=oi.Self),null!==this.tourType?(this.availabilitiesGroupedByDay=await On(ai[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await On(ai[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Re(e)){if("Backspace"===e.key){if(Re(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Re(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&(null===(n=this.emailInput)||void 0===n?void 0:n.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,n;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const i=new URLSearchParams(window.location.search),r=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,o=[...new Set(r?[r,"property-website"]:["property-website"])];Zn("scheduleTourSubmitted",{email:this.email,phone:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,firstName:this.firstNameInput.value,lastName:this.lastNameInput.value,tourType:si[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unitNumbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,originatingSource:o.find((e=>"property-website"!==e))||null});const a={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(n=this.phoneNumber.match(/\d/g))||void 0===n?void 0:n.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:si[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unit_numbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,lead_sources:[...new Set(r?[r,"property-website"]:["property-website"])],query_params:Object.fromEntries(i.entries())};this.isSubmitting=!0;try{await t().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",a,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}}),await zn({chatId:this.chatId,website:window.location.origin,referrer:document.referrer,buildingSlug:this.buildingSlug,selectedLeadSource:null!=r?r:""}),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e.response.data.detail||"Failed to book tour";alert(t),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>k`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>k`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>k`<action-confirm-button
897
+
898
+ .center-tour-not-avail {
899
+ display: flex;
900
+ justify-content: center;
901
+ align-items: center;
902
+ flex-direction: column;
903
+
904
+ height: 320px;
905
+ box-sizing: border-box;
906
+ text-align: center;
907
+
908
+ width: 100%;
909
+ padding: 24px;
910
+ max-width: 440px;
911
+ margin: auto;
912
+ }
913
+ .center-tour-not-avail > h1 {
914
+ font-size: 18px;
915
+ font-weight: 400;
916
+ text-align: center;
917
+ margin: 0;
918
+ }
919
+ .center-tour-not-avail > p {
920
+ font-size: 14px;
921
+ text-align: left;
922
+ }
923
+ .loading-entire-tour-icon {
924
+ padding: 24px;
925
+ }
926
+ `;class ii{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){var t;fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:ri(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.116"})})}}const ri=()=>{var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}};var oi;!function(e){e.error="error",e.info="info",e.warn="warn"}(oi||(oi={}));const ai=async({logType:e,buildingSlug:n,orgSlug:i,logTitle:r,logData:o})=>{await t().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=n?n:"","org-slug":null!=i?i:"","log-type":null!=e?e:oi.error,"log-title":r.toUpperCase().replace(/\s/g,"_")}})};var si=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 ui=class extends re{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.buildingName="",this.tourType=null,this.shouldShowTourType={[li.Guided]:!0,[li.Self]:!0,[li.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.leadSources=[],this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.brandColor=Fe,this.errorGettingAvailabilities=!1,this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[li.Guided]:!!(null===(t=null===(e=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[li.Self]:!!(null===(i=null===(n=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[li.Virtual]:!!(null===(o=null===(r=await xn(nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})(),t=Object.values(e).every((e=>!1===e));if(t)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void ai({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:null,logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[li.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[li.Guided],[li.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[li.Self],[li.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[li.Virtual]},1===Object.values(this.shouldShowTourType).reduce(((e,t)=>!0===t?e+1:e),0)?this.tourType=Object.keys(this.shouldShowTourType).find((e=>this.shouldShowTourType[e])):"1ac49f90-6150-11ed-b327-1b3f05e7b9db"===this.buildingSlug&&this.shouldShowTourType[li.Self]&&(this.tourType=li.Self),null!==this.tourType?(this.availabilitiesGroupedByDay=await On(di[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await On(di[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Re(e)){if("Backspace"===e.key){if(Re(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Re(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&(null===(n=this.emailInput)||void 0===n?void 0:n.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,n;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const i=new URLSearchParams(window.location.search),r=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,o=[...new Set(r?[r,"property-website"]:["property-website"])];Zn("scheduleTourSubmitted",{email:this.email,phone:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,firstName:this.firstNameInput.value,lastName:this.lastNameInput.value,tourType:ci[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unitNumbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,originatingSource:o.find((e=>"property-website"!==e))||null});const a={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(n=this.phoneNumber.match(/\d/g))||void 0===n?void 0:n.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:ci[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unit_numbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,lead_sources:[...new Set(r?[r,"property-website"]:["property-website"])],query_params:Object.fromEntries(i.entries())};this.isSubmitting=!0;try{await t().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",a,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}}),await zn({chatId:this.chatId,website:window.location.origin,referrer:document.referrer,buildingSlug:this.buildingSlug,selectedLeadSource:null!=r?r:""}),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e.response.data.detail||"Failed to book tour";alert(t),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>k`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>k`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>k`<action-confirm-button
898
927
  id="schedule-bttn"
899
928
  .onClick=${this.submit}
900
929
  .isLoading=${this.isSubmitting}
@@ -904,13 +933,13 @@ otherwise there's some empty space at the bottom of the button, which interferes
904
933
  ?disabled=${!this.formIsValidForSubmission()}
905
934
  ></action-confirm-button>`,nextButtonAction:null,render:()=>k`${this.userInfoAndLayoutMenu()}`}]}tourTypeMenu(){return k`<h2 class="journey-header">Tour Type</h2>
906
935
  <div id="tour-type-menu">
907
- ${this.shouldShowTourType[oi.Self]?k`<tour-type-option
936
+ ${this.shouldShowTourType[li.Self]?k`<tour-type-option
908
937
  heading="Take a tour"
909
938
  subtitle="on your own"
910
939
  .brandColor=${this.brandColor}
911
- @click="${async()=>{this.tourType=oi.Self,this.sgtUrl&&window.open(this.sgtUrl,"_blank"),this.availabilitiesGroupedByDay=await On(ai[oi.Self])}}"
912
- @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=oi.Self)}}"
913
- ?selected="${this.tourType===oi.Self}"
940
+ @click="${async()=>{this.tourType=li.Self,this.sgtUrl&&window.open(this.sgtUrl,"_blank"),this.availabilitiesGroupedByDay=await On(di[li.Self])}}"
941
+ @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=li.Self)}}"
942
+ ?selected="${this.tourType===li.Self}"
914
943
  >
915
944
  <svg
916
945
  slot="icon"
@@ -922,17 +951,17 @@ otherwise there's some empty space at the bottom of the button, which interferes
922
951
  >
923
952
  <path
924
953
  d="M14.8334 19.1903V30.1667H0.666687C0.666248 28.4367 1.06183 26.7297 1.82311 25.1763C2.58439 23.6229 3.69118 22.2644 5.05866 21.2049C6.42614 20.1453 8.01802 19.4129 9.71232 19.0637C11.4066 18.7145 13.1584 18.7578 14.8334 19.1903ZM12 17.4167C7.30377 17.4167 3.50002 13.6129 3.50002 8.91666C3.50002 4.22041 7.30377 0.416656 12 0.416656C16.6963 0.416656 20.5 4.22041 20.5 8.91666C20.5 13.6129 16.6963 17.4167 12 17.4167ZM20.5 23.0833V18.125L27.5834 24.5L20.5 30.875V25.9167H16.25V23.0833H20.5Z"
925
- fill="${this.tourType===oi.Self?"#ffffff":"#202020"}"
954
+ fill="${this.tourType===li.Self?"#ffffff":"#202020"}"
926
955
  />
927
956
  </svg>
928
957
  </tour-type-option>`:""}
929
- ${this.shouldShowTourType[oi.Guided]?k` <tour-type-option
958
+ ${this.shouldShowTourType[li.Guided]?k` <tour-type-option
930
959
  heading="Guided tour"
931
960
  subtitle="with an agent"
932
961
  .brandColor=${this.brandColor}
933
- @click="${async()=>{this.tourType=oi.Guided,this.escortedToursLink&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await On(ai[oi.Guided])}}"
934
- @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=oi.Guided)}}"
935
- ?selected="${this.tourType===oi.Guided}"
962
+ @click="${async()=>{this.tourType=li.Guided,this.escortedToursLink&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await On(di[li.Guided])}}"
963
+ @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=li.Guided)}}"
964
+ ?selected="${this.tourType===li.Guided}"
936
965
  >
937
966
  <svg
938
967
  slot="icon"
@@ -944,17 +973,17 @@ otherwise there's some empty space at the bottom of the button, which interferes
944
973
  >
945
974
  <path
946
975
  d="M0.833252 30.1666C0.833252 27.1608 2.0273 24.2782 4.15271 22.1527C6.27812 20.0273 9.1608 18.8333 12.1666 18.8333C15.1724 18.8333 18.0551 20.0273 20.1805 22.1527C22.3059 24.2782 23.4999 27.1608 23.4999 30.1666H0.833252ZM12.1666 17.4166C7.47034 17.4166 3.66659 13.6129 3.66659 8.91663C3.66659 4.22038 7.47034 0.416626 12.1666 0.416626C16.8628 0.416626 20.6666 4.22038 20.6666 8.91663C20.6666 13.6129 16.8628 17.4166 12.1666 17.4166ZM22.5975 20.58C24.7645 21.137 26.7006 22.3634 28.13 24.0846C29.5595 25.8059 30.4096 27.9342 30.5592 30.1666H26.3333C26.3333 26.4691 24.9166 23.1031 22.5975 20.58ZM19.7316 17.3557C20.9187 16.2939 21.8681 14.9932 22.5175 13.5388C23.167 12.0845 23.5017 10.5094 23.4999 8.91663C23.5029 6.9807 23.0078 5.07657 22.062 3.38738C23.6666 3.70979 25.11 4.5779 26.1469 5.84415C27.1838 7.1104 27.7502 8.69666 27.7499 10.3333C27.7503 11.3426 27.5349 12.3404 27.1182 13.2597C26.7016 14.179 26.0932 14.9986 25.3339 15.6636C24.5746 16.3285 23.6819 16.8236 22.7157 17.1154C21.7495 17.4072 20.7321 17.4892 19.7316 17.3557V17.3557Z"
947
- fill="${this.tourType===oi.Guided?"#ffffff":"#202020"}"
976
+ fill="${this.tourType===li.Guided?"#ffffff":"#202020"}"
948
977
  />
949
978
  </svg>
950
979
  </tour-type-option>`:""}
951
- ${this.shouldShowTourType[oi.Virtual]?k`<tour-type-option
980
+ ${this.shouldShowTourType[li.Virtual]?k`<tour-type-option
952
981
  heading="Virtual tour"
953
982
  subtitle="over video"
954
983
  .brandColor=${this.brandColor}
955
- @click="${async()=>{this.tourType=oi.Virtual,this.virtualToursLink&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await On(ai[oi.Virtual])}}"
956
- @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=oi.Virtual)}}"
957
- ?selected="${this.tourType===oi.Virtual}"
984
+ @click="${async()=>{this.tourType=li.Virtual,this.virtualToursLink&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await On(di[li.Virtual])}}"
985
+ @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=li.Virtual)}}"
986
+ ?selected="${this.tourType===li.Virtual}"
958
987
  >
959
988
  <svg
960
989
  slot="icon"
@@ -966,7 +995,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
966
995
  >
967
996
  <path
968
997
  d="M15.6 19.5V22.1L18.2 23.4V24.7H7.80004L7.79484 23.4052L10.4 22.1V19.5H1.28965C1.11894 19.4989 0.950113 19.4642 0.792841 19.3979C0.635568 19.3315 0.492943 19.2347 0.373141 19.1131C0.253339 18.9915 0.158715 18.8474 0.0946936 18.6892C0.0306718 18.5309 -0.00148955 18.3616 5.29696e-05 18.1909V1.3091C5.29696e-05 0.586299 0.591552 0 1.28965 0H24.7104C25.4228 0 26 0.583699 26 1.3091V18.1909C26 18.9137 25.4085 19.5 24.7104 19.5H15.6ZM2.60005 14.3V16.9H23.4V14.3H2.60005Z"
969
- fill="${this.tourType===oi.Virtual?"#ffffff":"#202020"}"
998
+ fill="${this.tourType===li.Virtual?"#ffffff":"#202020"}"
970
999
  />
971
1000
  </svg>
972
1001
  </tour-type-option>`:""}
@@ -975,7 +1004,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
975
1004
  <div id="datePicker">
976
1005
  <date-picker
977
1006
  .availabilities=${Ln()(this.availabilitiesGroupedByDay,(e=>e.map((e=>new Date(e.offset)))))}
978
- @change=${e=>{this.tourType===oi.Self&&this.sgtUrl?window.open(this.sgtUrl,"_blank"):this.tourType===oi.Guided&&this.escortedToursLink?window.open(this.escortedToursLink,"_blank"):this.tourType===oi.Virtual&&this.virtualToursLink?window.open(this.virtualToursLink,"_blank"):e.target instanceof Wt&&(this.selectedDate=e.target.selectedDate)}}
1007
+ @change=${e=>{this.tourType===li.Self&&this.sgtUrl?window.open(this.sgtUrl,"_blank"):this.tourType===li.Guided&&this.escortedToursLink?window.open(this.escortedToursLink,"_blank"):this.tourType===li.Virtual&&this.virtualToursLink?window.open(this.virtualToursLink,"_blank"):e.target instanceof Wt&&(this.selectedDate=e.target.selectedDate)}}
979
1008
  ></date-picker>
980
1009
  <time-picker
981
1010
  ?selecteddateexists=${!!this.selectedDate}
@@ -1076,7 +1105,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
1076
1105
  <me-select
1077
1106
  id="layoutType"
1078
1107
  placeholder="Select layout"
1079
- .options="${ui(this.layoutOptions).map((e=>{return{label:(t=e,"studio"==t?"Studio":{"1br":"1 bedroom","2br":"2 bedroom","3br":"3 bedroom","4br":"4 bedroom","5br":"5 bedroom","6br":"6 bedroom","7br":"7 bedroom","8br":"8 bedroom","9br":"9 bedroom","10br":"10 bedroom"}[t]),value:e};var t}))}"
1108
+ .options="${pi(this.layoutOptions).map((e=>{return{label:(t=e,"studio"==t?"Studio":{"1br":"1 bedroom","2br":"2 bedroom","3br":"3 bedroom","4br":"4 bedroom","5br":"5 bedroom","6br":"6 bedroom","7br":"7 bedroom","8br":"8 bedroom","9br":"9 bedroom","10br":"10 bedroom"}[t]),value:e};var t}))}"
1080
1109
  defaultOption="Studio"
1081
1110
  @change=${()=>{this.requestUpdate()}}
1082
1111
  >Studio
@@ -1116,7 +1145,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
1116
1145
  <p>Thank you!</p>
1117
1146
  <p>
1118
1147
  Your
1119
- ${{[oi.Guided]:"guided",[oi.Self]:"self-guided",[oi.Virtual]:"virtual"}[this.tourType]}
1148
+ ${{[li.Guided]:"guided",[li.Self]:"self-guided",[li.Virtual]:"virtual"}[this.tourType]}
1120
1149
  tour is scheduled for ${e}.
1121
1150
  </p>
1122
1151
  <p>
@@ -1124,10 +1153,10 @@ otherwise there's some empty space at the bottom of the button, which interferes
1124
1153
  </p>
1125
1154
  <p>You can make changes at any time, just reply to the email.</p>
1126
1155
  </div>
1127
- `}loadingIcon(){return k`<svg
1156
+ `}loadingIcon(e=21){return k`<svg
1128
1157
  id="loadingIcon"
1129
- width="21"
1130
- height="21"
1158
+ width=${e}
1159
+ height=${e}
1131
1160
  viewBox="0 0 21 21"
1132
1161
  fill="none"
1133
1162
  xmlns="http://www.w3.org/2000/svg"
@@ -1136,7 +1165,39 @@ otherwise there's some empty space at the bottom of the button, which interferes
1136
1165
  d="M17.835 13.1045C18.4839 11.5628 18.6332 9.85647 18.2621 8.22548C17.8909 6.5945 17.018 5.12084 15.7659 4.0117C14.5139 2.90256 12.9457 2.21372 11.2818 2.04201C9.618 1.87031 7.94218 2.22438 6.49 3.05445L5.498 1.31745C7.01563 0.450066 8.73419 -0.00418222 10.4822 2.90165e-05C12.2302 0.00424025 13.9466 0.466764 15.46 1.34145C19.95 3.93345 21.67 9.48345 19.577 14.1115L20.919 14.8855L16.754 17.0995L16.589 12.3855L17.835 13.1045ZM3.085 6.89845C2.43614 8.44015 2.28678 10.1464 2.65792 11.7774C3.02905 13.4084 3.90201 14.8821 5.15407 15.9912C6.40613 17.1003 7.97432 17.7892 9.63816 17.9609C11.302 18.1326 12.9778 17.7785 14.43 16.9485L15.422 18.6855C13.9044 19.5528 12.1858 20.0071 10.4378 20.0029C8.68979 19.9987 6.97344 19.5361 5.46 18.6615C0.97 16.0695 -0.75 10.5195 1.343 5.89145L0 5.11845L4.165 2.90445L4.33 7.61845L3.084 6.89945L3.085 6.89845Z"
1137
1166
  fill="#1E1E1E"
1138
1167
  />
1139
- </svg>`}render(){var e,t,n,i;if(Un()){const e=this.mobilePages[this.mobilePageIndex];return k`
1168
+ </svg>`}render(){var e,t,n,i;if(this.waitingForAvailabilities)return k` <div
1169
+ class="${Gn()({"tour-scheduler-full":!this.compactDesign&&!Un(),"tour-scheduler-compact":this.compactDesign&&!Un(),"tour-scheduler-mobile":Un()})}"
1170
+ >
1171
+ <div class="center-tour-not-avail">
1172
+ <h1>Searching for availabilities...</h1>
1173
+ <div class="loading-entire-tour-icon">${this.loadingIcon(48)}</div>
1174
+ </div>
1175
+ </div>`;if(this.errorGettingAvailabilities)return k` <div
1176
+ class="${Gn()({"tour-scheduler-full":!this.compactDesign&&!Un(),"tour-scheduler-compact":this.compactDesign&&!Un(),"tour-scheduler-mobile":Un()})}"
1177
+ >
1178
+ <div id="top-header">
1179
+ <div></div>
1180
+ ${this.closeButton()}
1181
+ </div>
1182
+ <div class="center-tour-not-avail">
1183
+ <h1>Sorry, there are currently no tour availabilities!</h1>
1184
+ <p>
1185
+ We apologize, but there are currently no tours available. This could
1186
+ be due to all slots being filled, off-season periods, or
1187
+ maintenance.
1188
+ </p>
1189
+ <p>
1190
+ We understand that this may be disappointing and we apologize for
1191
+ any inconvenience. We recommend checking back soon as our schedule
1192
+ frequently updates.
1193
+ </p>
1194
+ <p>
1195
+ In the meantime, feel free to explore our website for other
1196
+ information and attractions. Thank you for your understanding and
1197
+ patience!
1198
+ </p>
1199
+ </div>
1200
+ </div>`;if(Un()){const e=this.mobilePages[this.mobilePageIndex];return k`
1140
1201
  <div
1141
1202
  class="${Gn()("tour-scheduler-mobile",{loading:this.waitingForAvailabilities})}"
1142
1203
  >
@@ -1208,7 +1269,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
1208
1269
  </div>
1209
1270
  `}
1210
1271
  </div>
1211
- `}};var oi;ri.styles=[ni,Zt],ii([ue({attribute:!1})],ri.prototype,"layoutOptions",void 0),ii([ue({attribute:!1})],ri.prototype,"unitOptions",void 0),ii([ue({attribute:!1})],ri.prototype,"tourTypeOptions",void 0),ii([ue({attribute:!0})],ri.prototype,"chatId",void 0),ii([ue({type:Number})],ri.prototype,"buildingId",void 0),ii([ue({attribute:!0})],ri.prototype,"buildingSlug",void 0),ii([ue({attribute:!0})],ri.prototype,"sgtUrl",void 0),ii([ue({attribute:!0})],ri.prototype,"escortedToursLink",void 0),ii([ue({attribute:!0})],ri.prototype,"virtualToursLink",void 0),ii([ue({attribute:!0})],ri.prototype,"orgSlug",void 0),ii([ue({attribute:!0})],ri.prototype,"buildingName",void 0),ii([le()],ri.prototype,"tourType",void 0),ii([le()],ri.prototype,"shouldShowTourType",void 0),ii([le()],ri.prototype,"email",void 0),ii([le()],ri.prototype,"phoneNumber",void 0),ii([le()],ri.prototype,"availabilitiesGroupedByDay",void 0),ii([le()],ri.prototype,"waitingForAvailabilities",void 0),ii([le()],ri.prototype,"selectedDate",void 0),ii([le()],ri.prototype,"selectedTime",void 0),ii([le()],ri.prototype,"mobilePageIndex",void 0),ii([le()],ri.prototype,"isSubmitting",void 0),ii([le()],ri.prototype,"tourIsBooked",void 0),ii([ue({attribute:!1})],ri.prototype,"leadSources",void 0),ii([ue({attribute:!0})],ri.prototype,"currentLeadSource",void 0),ii([ue({attribute:!0})],ri.prototype,"featureFlagShowDropdown",void 0),ii([ue({attribute:!0})],ri.prototype,"compactDesign",void 0),ii([ue({attribute:!0})],ri.prototype,"brandColor",void 0),ii([de(".nameContainer#firstName input")],ri.prototype,"firstNameInput",void 0),ii([de(".nameContainer#lastName input")],ri.prototype,"lastNameInput",void 0),ii([de(".inputContainer#email input")],ri.prototype,"emailInput",void 0),ii([de(".inputContainer#phone input")],ri.prototype,"phoneInput",void 0),ii([de("me-select#unitType")],ri.prototype,"unitTypeSelect",void 0),ii([de("me-select#layoutType")],ri.prototype,"layoutTypeSelect",void 0),ii([de("me-select#leadSource")],ri.prototype,"selectedLeadSource",void 0),ri=ii([ae("tour-scheduler")],ri),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(oi||(oi={}));const ai={[oi.Guided]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[oi.Self]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[oi.Virtual]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},si={[oi.Guided]:"escorted-tour",[oi.Self]:"self-guided-tour",[oi.Virtual]:"live-virtual-tour"},ui=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(qn()).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(jn());class li{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){var t;fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:di(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.116"})})}}const di=()=>{var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}};var ci;!function(e){e.error="error",e.info="info",e.warn="warn"}(ci||(ci={}));const pi=async({logType:e,buildingSlug:n,orgSlug:i,logTitle:r,logData:o})=>{await t().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=n?n:"","org-slug":null!=i?i:"","log-type":null!=e?e:ci.error,"log-title":r.toUpperCase().replace(/\s/g,"_")}})};async function hi(e,n){const i="https://app.meetelise.com",r=`${i}/api/pub/v1/organization/${e}/building/${n}`,o=`${i}/eliseCrmApi/pub/building/${n}/units`,a=`${i}/eliseCrmApi/pub/building/${n}/layouts`,[s,u,l]=await Promise.all([t().get(r),t().get(o),t().get(a)]),d=s.data,c=u.data,p=l.data;return d.unitOptionsV2=c,d.layoutOptionsV2=p,d}var fi,mi;async function gi(e){try{const n=await t().get(`https://app.meetelise.com/eliseCrmApi/webchat/config/building/${e}`);if(n.data)return Dn(n.data)}catch(e){return null}return null}async function vi(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function yi(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:Qn(),building_slug:e,referrer:n,campaign_sources:di()})).data}catch(e){return null}}!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(fi||(fi={})),function(e){e.ConceptEmoji="Concept 2 (Blue/White)"}(mi||(mi={}));const bi=u`
1272
+ `}};var li;ui.styles=[ni,Zt],si([ue({attribute:!1})],ui.prototype,"layoutOptions",void 0),si([ue({attribute:!1})],ui.prototype,"unitOptions",void 0),si([ue({attribute:!1})],ui.prototype,"tourTypeOptions",void 0),si([ue({attribute:!0})],ui.prototype,"chatId",void 0),si([ue({type:Number})],ui.prototype,"buildingId",void 0),si([ue({attribute:!0})],ui.prototype,"buildingSlug",void 0),si([ue({attribute:!0})],ui.prototype,"sgtUrl",void 0),si([ue({attribute:!0})],ui.prototype,"escortedToursLink",void 0),si([ue({attribute:!0})],ui.prototype,"virtualToursLink",void 0),si([ue({attribute:!0})],ui.prototype,"orgSlug",void 0),si([ue({attribute:!0})],ui.prototype,"buildingName",void 0),si([le()],ui.prototype,"tourType",void 0),si([le()],ui.prototype,"shouldShowTourType",void 0),si([le()],ui.prototype,"email",void 0),si([le()],ui.prototype,"phoneNumber",void 0),si([le()],ui.prototype,"availabilitiesGroupedByDay",void 0),si([le()],ui.prototype,"waitingForAvailabilities",void 0),si([le()],ui.prototype,"selectedDate",void 0),si([le()],ui.prototype,"selectedTime",void 0),si([le()],ui.prototype,"mobilePageIndex",void 0),si([le()],ui.prototype,"isSubmitting",void 0),si([le()],ui.prototype,"tourIsBooked",void 0),si([ue({attribute:!1})],ui.prototype,"leadSources",void 0),si([ue({attribute:!0})],ui.prototype,"currentLeadSource",void 0),si([ue({attribute:!0})],ui.prototype,"featureFlagShowDropdown",void 0),si([ue({attribute:!0})],ui.prototype,"compactDesign",void 0),si([ue({attribute:!0})],ui.prototype,"brandColor",void 0),si([de(".nameContainer#firstName input")],ui.prototype,"firstNameInput",void 0),si([de(".nameContainer#lastName input")],ui.prototype,"lastNameInput",void 0),si([de(".inputContainer#email input")],ui.prototype,"emailInput",void 0),si([de(".inputContainer#phone input")],ui.prototype,"phoneInput",void 0),si([de("me-select#unitType")],ui.prototype,"unitTypeSelect",void 0),si([de("me-select#layoutType")],ui.prototype,"layoutTypeSelect",void 0),si([de("me-select#leadSource")],ui.prototype,"selectedLeadSource",void 0),si([le()],ui.prototype,"errorGettingAvailabilities",void 0),ui=si([ae("tour-scheduler")],ui),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(li||(li={}));const di={[li.Guided]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[li.Self]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[li.Virtual]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},ci={[li.Guided]:"escorted-tour",[li.Self]:"self-guided-tour",[li.Virtual]:"live-virtual-tour"},pi=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(qn()).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(jn());async function hi(e,n){const i="https://app.meetelise.com",r=`${i}/api/pub/v1/organization/${e}/building/${n}`,o=`${i}/eliseCrmApi/pub/building/${n}/units`,a=`${i}/eliseCrmApi/pub/building/${n}/layouts`,[s,u,l]=await Promise.all([t().get(r),t().get(o),t().get(a)]),d=s.data,c=u.data,p=l.data;return d.unitOptionsV2=c,d.layoutOptionsV2=p,d}var fi,mi;async function gi(e){try{const n=await t().get(`https://app.meetelise.com/eliseCrmApi/webchat/config/building/${e}`);if(n.data)return Dn(n.data)}catch(e){return null}return null}async function vi(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function yi(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:Qn(),building_slug:e,referrer:n,campaign_sources:ri()})).data}catch(e){return null}}!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(fi||(fi={})),function(e){e.ConceptEmoji="Concept 2 (Blue/White)"}(mi||(mi={}));const bi=u`
1212
1273
  * {
1213
1274
  font-family: "Helvetica Neue", Arial;
1214
1275
  font-size: 14px;
@@ -3265,7 +3326,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3265
3326
  cursor: pointer;
3266
3327
  width: fit-content;
3267
3328
  }
3268
- `;var Rr=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 Pr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[]}firstUpdated(){if(!this.message)return;const{hyperlinks:e,markedText:t}=this.mapAndMarkHyperLinks(this.message.message.text),n=/(https?:\/\/[^\s]+)/g,i=[],r=[];this.parsedMessage=k`${t.split("\n").map((t=>k`${t.split(" ").map((t=>{if(e.find((e=>e.id===t))){const n=e.find((e=>e.id===t));if(!n)return;return r.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),k`<a
3329
+ `;var Rr=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 Pr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[]}firstUpdated(){if(!this.message)return;const{hyperlinks:e,markedText:t}=this.mapAndMarkHyperLinks(this.message.message.text),n=/(https?:\/\/[^\s]+)/g,i=[],r=[];this.parsedMessage=k`${t.split("\n").map((t=>{const o=t.split(/\s+/);return k`${o.map((t=>{if(e.find((e=>e.id===t))){const n=e.find((e=>e.id===t));if(!n)return;return r.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),k`<a
3269
3330
  class="redirect-link"
3270
3331
  href="${null==n?void 0:n.link}"
3271
3332
  target="_blank"
@@ -3277,7 +3338,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3277
3338
  target="_blank"
3278
3339
  rel="noopener noreferrer"
3279
3340
  >${t}
3280
- </a>`):k`${t} `}))}<br />`))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[];return t.forEach((t=>{try{const i=t[0].split("|")[0].replace("<",""),r=t[0].split("|")[1].replace(">","");if(i&&r){const o=Sr();n.push({link:i,hyperlink:r,mark:t[0],id:o}),e=e.replace(t[0],o)}}catch(e){}})),{hyperlinks:n,markedText:e}}async getLinkData(e){var n,i,r,o,a,s;try{const u=(await t().get(e)).data,l=(new DOMParser).parseFromString(u,"text/html");return l?{title:null!==(i=null===(n=l.querySelector("title"))||void 0===n?void 0:n.textContent)&&void 0!==i?i:null,description:(null===(r=l.querySelector('meta[name="description"]'))||void 0===r?void 0:r.getAttribute("content"))||null,image:(null===(o=l.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:(null===(a=l.querySelector('link[rel="shortcut icon"]'))||void 0===a?void 0:a.getAttribute("href"))||(null===(s=l.querySelector('link[rel="icon"]'))||void 0===s?void 0:s.getAttribute("href"))||null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return console.error("Error fetching website details:",t),{title:null,description:null,image:null,favicon:null,link:e}}}updated(){this.onMount()}render(){return this.message?k`<div class="message-inner-body">
3341
+ </a>`):k`${t} `}))}<br />`}))}`,this.imagesToDisplay=r,Promise.all(i).then((e=>{this.websitePreviewInfo=e}))}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>/g)),n=[];return t.forEach((t=>{try{const i=t[0].split("|")[0].replace("<",""),r=t[0].split("|")[1].replace(">","");if(i&&r){const o=Sr();n.push({link:i,hyperlink:r,mark:t[0],id:o}),e=e.replace(t[0],o)}}catch(e){}})),{hyperlinks:n,markedText:e}}async getLinkData(e){var n,i,r,o,a,s;try{const u=(await t().get(e)).data,l=(new DOMParser).parseFromString(u,"text/html");return l?{title:null!==(i=null===(n=l.querySelector("title"))||void 0===n?void 0:n.textContent)&&void 0!==i?i:null,description:(null===(r=l.querySelector('meta[name="description"]'))||void 0===r?void 0:r.getAttribute("content"))||null,image:(null===(o=l.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:(null===(a=l.querySelector('link[rel="shortcut icon"]'))||void 0===a?void 0:a.getAttribute("href"))||(null===(s=l.querySelector('link[rel="icon"]'))||void 0===s?void 0:s.getAttribute("href"))||null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return console.error("Error fetching website details:",t),{title:null,description:null,image:null,favicon:null,link:e}}}updated(){this.onMount()}render(){return this.message?k`<div class="message-inner-body">
3281
3342
  <p class="message-text">${this.parsedMessage}</p>
3282
3343
  ${this.websitePreviewInfo.length>0&&this.websitePreviewInfo.some((e=>e.title&&(e.image||e.favicon)))?k`<br />`:""}
3283
3344
  ${this.imagesToDisplay.map((e=>k`<a
@@ -3424,7 +3485,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3424
3485
  </button>
3425
3486
  </div>
3426
3487
  </div>
3427
- `:k``}};Fr.styles=[Er],_r([ue({attribute:!0})],Fr.prototype,"onMount",void 0),_r([ue({attribute:!0})],Fr.prototype,"channel",void 0),_r([ue({attribute:!0})],Fr.prototype,"myPubnub",void 0),_r([ue({attribute:!0})],Fr.prototype,"buildingSlug",void 0),_r([ue({attribute:!0})],Fr.prototype,"building",void 0),_r([ue({attribute:!0})],Fr.prototype,"brandColor",void 0),_r([ue({attribute:!0})],Fr.prototype,"onClickExit",void 0),_r([ue({attribute:!0})],Fr.prototype,"requiresConsent",void 0),_r([de("#message-input",!0)],Fr.prototype,"messageInput",void 0),_r([de("#conversation-body",!0)],Fr.prototype,"messageBody",void 0),_r([le()],Fr.prototype,"messages",void 0),_r([le()],Fr.prototype,"isMobile",void 0),_r([le()],Fr.prototype,"isLoadingMessages",void 0),_r([le()],Fr.prototype,"hasReceivedConsent",void 0),_r([le()],Fr.prototype,"privacyPolicyUrl",void 0),_r([le()],Fr.prototype,"websitePreviewMapping",void 0),Fr=_r([ae("pubnub-chat")],Fr);const Mr={};var Dr=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 Ur=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.isMobile=Un(),this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Vn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ae(),this.firstUpdated=async()=>{await this.setBuildingDerivedInfo(),await this.initializeChatVariables(),this.handleChatInitializeAnalytics()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y;if(!this.buildingSlug||!this.orgSlug)return;const b=await hi(this.orgSlug,this.buildingSlug);if(1!==b.active)return;const[w,S,T,A,x,O,C]=await Promise.all([vi(this.buildingSlug),cr(this.buildingSlug),yi(this.buildingSlug,document.referrer),Kn(this.buildingSlug),Xn(this.buildingSlug),gi(b.id),Yn(this.buildingSlug)]);b.phoneNumber=Ne(b.phoneNumber),this.building=b,this.designConcept=null!==(e=null==w?void 0:w.abTestType)&&void 0!==e?e:"",this.leadSources=S,this.currentLeadSource=T,this.featureFlagShowDropdown=A;const I=await(async e=>{if(Mr[e])return Mr[e];const n=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await t().get(n);return Mr[e]=i.data,i.data})(b.id);this.enabledChatWidgets={call:O&&!O.isGlobalDefault?O.config.shouldShowPhone:null===(r=null===(i=null===(n=this.building)||void 0===n?void 0:n.chatWidgets)||void 0===i?void 0:i.includes("CALL"))||void 0===r||r,chat:O&&!O.isGlobalDefault?O.config.shouldShowChat:null===(s=null===(a=null===(o=this.building)||void 0===o?void 0:o.chatWidgets)||void 0===a?void 0:a.includes("CHAT"))||void 0===s||s,email:O&&!O.isGlobalDefault?O.config.shouldShowEmail:null===(d=null===(l=null===(u=this.building)||void 0===u?void 0:u.chatWidgets)||void 0===l?void 0:l.includes("EMAIL"))||void 0===d||d,text:(O&&!O.isGlobalDefault?O.config.shouldShowText:null===(h=null===(p=null===(c=this.building)||void 0===c?void 0:c.chatWidgets)||void 0===p?void 0:p.includes("SMS"))||void 0===h||h)&&I.length>0,sst:O&&!O.isGlobalDefault?O.config.shouldShowSst:null===(g=null===(m=null===(f=this.building)||void 0===f?void 0:f.chatWidgets)||void 0===m?void 0:m.includes("SST"))||void 0===g||g},O&&O.config&&(this.brandColor=null!==(v=O.config.primaryColor)&&void 0!==v?v:null,this.webchatConfigHasAutoOpenChat=O.config.autoOpenChat,this.requiresConsent=O.config.requiresConsent,this.privacyPolicyUrl=null!==(y=O.config.privacyPolicyUrl)&&void 0!==y?y:this.privacyPolicyUrl,O.config.displayStyle===fi.MINIMIZED&&(this.isMinimized=!0),O.config.displayStyle===fi.PILLS&&(this.designConcept=null),O.config.displayStyle===fi.EMOJI&&(this.designConcept=fi.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);let N=null;var E;x&&(N=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),C&&(null==N?void 0:N.number)&&((e=>{const t=document.querySelectorAll('a[data-selenium-id="click_to_call"]');t&&t.forEach((t=>{"A"===t.tagName&&(t.href=`tel:${Cr(e)}`);const n=t.querySelector(".click-to-call");n&&Or(n)&&(n.textContent=e)}))})(E=N.number),(e=>{const t=document.querySelectorAll(".dvPhone");t&&t.forEach((t=>{var n;"A"===t.tagName&&(t.href=`tel:${Cr(e)}`),Or(t)&&(t.textContent=e);const i=t.nextElementSibling;if("BR"!==(null==i?void 0:i.tagName)||"A"!==(null===(n=null==i?void 0:i.nextElementSibling)||void 0===n?void 0:n.tagName))return;const r=null==i?void 0:i.nextElementSibling;r.href=`sms:${Cr(e)}`,Or(r)&&(r.textContent=`Text: ${e}`)}))})(E),(e=>{const t=document.querySelectorAll(".click_to_call_href");t&&2===t.length&&t.forEach((t=>{"A"===t.tagName&&(t.href=`tel:${Cr(e)}`);const n=t.querySelector(".click_to_call")||t.querySelector(".click_to_call_foot");n&&Or(n)&&(n.textContent=e)}))})(E)),this.phoneNumberForSource=N||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),An(this.building.id)},this.initializeChatVariables=async()=>{var n;this.building&&(this.building.conversationMaintenanceMode?console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear."):(this.myPubnub=new class{constructor(e,t,n){this.apiHost="https://app.meetelise.com",this.building=null,this.ttlHours=24,this.eliseResponseTimeout=null,this.pubnub=null,this.leadUserId="",this.channel="",this.chatListener=null,this.messages=[],this.listenerParams={message:e=>{var t;e.message.messageType!==Tr.noReply&&(this.messages=[...this.messages,{channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken}]);const n="eliseai"!==e.publisher;null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.messages,isLoading:n}),!n&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=n}},this.isLoadingMessages=!1,this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){pi({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:ci.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub&&!await this.initializePubnub())return;await this.withAuthToken((async()=>{var t,n;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout((()=>{console.error("Elise AI did not respond in time..."),pi({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:ci.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}),6e4),await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(t=this.building)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,userId:null===(n=this.building)||void 0===n?void 0:n.userId}}))})),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.clearChatStorageKey=()=>localStorage.removeItem("com.eliseai.webchat.slug="+this.buildingSlug),this.createChatStorageKey=e=>{const t=tn(new Date),n=null!=e?e:`lead_${Sr()}_${this.buildingSlug}`;return localStorage.setItem("com.eliseai.webchat.slug="+this.buildingSlug,JSON.stringify({buildingSlug:this.buildingSlug,leadId:n,timestamp:t})),{leadId:n,timestamp:un(t),buildingSlug:this.buildingSlug}},this.getChatStorageKey=(e=!0)=>{const t=localStorage.getItem("com.eliseai.webchat.slug="+this.buildingSlug);if(t)try{const e=JSON.parse(t),n=e.buildingSlug,i=e.leadId,r=new Date(e.timestamp);if(this.isChatKeyValid({leadId:i,timestamp:r,buildingSlug:n}))return{leadId:i,timestamp:r,buildingSlug:n}}catch(e){console.warn("Error getting chat storage key")}return e?this.createChatStorageKey():{leadId:null,timestamp:null,buildingSlug:null}},this.isChatKeyValid=e=>!(e.buildingSlug!==this.buildingSlug||!e.leadId||!e.timestamp||function(e,t){ke(2,arguments);var n=qe(e),i=qe(t);return n.getTime()<i.getTime()}(xr(e.timestamp,this.ttlHours),Date.now())),this.buildingSlug=e,this.building=t,this.orgSlug=n}addChatListener(e){this.chatListener=e}async initializePubnub(){const e=this.getChatStorageKey();if(!e.leadId)return void pi({logTitle:"PUBNUB_ERROR_FETCHING_STORAGE_KEY",logData:{channel:this.channel,eliseaiLocalStorageValue:e,leadUserId:this.leadUserId},logType:ci.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.leadUserId=e.leadId,this.channel=`webchat_${this.leadUserId}`,e.timestamp&&function(e,t){ke(2,arguments);var n=qe(e),i=qe(t);return n.getTime()>i.getTime()}(e.timestamp,xr(new Date,this.ttlHours))&&this.createChatStorageKey(this.leadUserId);const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(fr())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token}),this.withAuthToken((()=>new Promise((()=>this.handleChatListeners())))),await this.withAuthToken((()=>this.getChannelHistory())),this.pubnub):void 0}async fetchToken(e,n){try{return(await t().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${n}`)).data}catch(e){pi({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:ci.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await t().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){pi({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:ci.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(t){try{await t()}catch(n){if(n instanceof e.AxiosError&&n&&n.response&&403===n.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const e=await this.fetchToken(this.leadUserId,this.channel);if(!e)return;this.pubnub.setAuthKey(e.auth.result.token),await t()}catch(e){pi({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:ci.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(){var e;try{const t=await new Promise(((e,t)=>{this.pubnub&&this.channel&&this.pubnub.fetchMessages({channels:[this.channel],count:100},((n,i)=>{n.error?(pi({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{channel:this.channel,status:n,response:i},logType:ci.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),t(n)):e(i)}))}));if(this.channel&&0!==Object.keys(t.channels).length){const n=t.channels[this.channel],i=[];n.forEach((e=>{e.uuid&&i.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})})),this.messages=i.filter((e=>e.message.messageType!==Tr.noReply)),null===(e=this.chatListener)||void 0===e||e.call(this,{messages:this.messages,isLoading:!1})}}catch(e){pi({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:ci.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}(this.buildingSlug,this.building,this.orgSlug),this.myPubnub.isChatKeyValid(this.myPubnub.getChatStorageKey(!1))&&await this.myPubnub.initializePubnub(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(null!==(n=this.building.autoOpenChatWidget)&&void 0!==n?n:this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1))},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!an(un(t)));return!!e&&!!n&&!Un()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",tn(function(e,t){ke(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0})},this.renderChatAdditionalActions=(e,t)=>k` <div
3488
+ `:k``}};Fr.styles=[Er],_r([ue({attribute:!0})],Fr.prototype,"onMount",void 0),_r([ue({attribute:!0})],Fr.prototype,"channel",void 0),_r([ue({attribute:!0})],Fr.prototype,"myPubnub",void 0),_r([ue({attribute:!0})],Fr.prototype,"buildingSlug",void 0),_r([ue({attribute:!0})],Fr.prototype,"building",void 0),_r([ue({attribute:!0})],Fr.prototype,"brandColor",void 0),_r([ue({attribute:!0})],Fr.prototype,"onClickExit",void 0),_r([ue({attribute:!0})],Fr.prototype,"requiresConsent",void 0),_r([de("#message-input",!0)],Fr.prototype,"messageInput",void 0),_r([de("#conversation-body",!0)],Fr.prototype,"messageBody",void 0),_r([le()],Fr.prototype,"messages",void 0),_r([le()],Fr.prototype,"isMobile",void 0),_r([le()],Fr.prototype,"isLoadingMessages",void 0),_r([le()],Fr.prototype,"hasReceivedConsent",void 0),_r([le()],Fr.prototype,"privacyPolicyUrl",void 0),_r([le()],Fr.prototype,"websitePreviewMapping",void 0),Fr=_r([ae("pubnub-chat")],Fr);const Mr={};var Dr=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 Ur=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.isMobile=Un(),this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Vn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ae(),this.firstUpdated=async()=>{await this.setBuildingDerivedInfo(),await this.initializeChatVariables(),this.handleChatInitializeAnalytics()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y;if(!this.buildingSlug||!this.orgSlug)return;const b=await hi(this.orgSlug,this.buildingSlug);if(1!==b.active)return;const[w,S,T,A,x,O,C]=await Promise.all([vi(this.buildingSlug),cr(this.buildingSlug),yi(this.buildingSlug,document.referrer),Kn(this.buildingSlug),Xn(this.buildingSlug),gi(b.id),Yn(this.buildingSlug)]);b.phoneNumber=Ne(b.phoneNumber),this.building=b,this.designConcept=null!==(e=null==w?void 0:w.abTestType)&&void 0!==e?e:"",this.leadSources=S,this.currentLeadSource=T,this.featureFlagShowDropdown=A;const I=await(async e=>{if(Mr[e])return Mr[e];try{const n=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await t().get(n);return Mr[e]=i.data,i.data}catch(t){return ai({logTitle:"ERROR_LOADING_PHONE_NUMBERS",logData:{error:t,buildingId:e},logType:oi.error}),[]}})(b.id);this.enabledChatWidgets={call:O&&!O.isGlobalDefault?O.config.shouldShowPhone:null===(r=null===(i=null===(n=this.building)||void 0===n?void 0:n.chatWidgets)||void 0===i?void 0:i.includes("CALL"))||void 0===r||r,chat:O&&!O.isGlobalDefault?O.config.shouldShowChat:null===(s=null===(a=null===(o=this.building)||void 0===o?void 0:o.chatWidgets)||void 0===a?void 0:a.includes("CHAT"))||void 0===s||s,email:O&&!O.isGlobalDefault?O.config.shouldShowEmail:null===(d=null===(l=null===(u=this.building)||void 0===u?void 0:u.chatWidgets)||void 0===l?void 0:l.includes("EMAIL"))||void 0===d||d,text:(O&&!O.isGlobalDefault?O.config.shouldShowText:null===(h=null===(p=null===(c=this.building)||void 0===c?void 0:c.chatWidgets)||void 0===p?void 0:p.includes("SMS"))||void 0===h||h)&&I.length>0,sst:O&&!O.isGlobalDefault?O.config.shouldShowSst:null===(g=null===(m=null===(f=this.building)||void 0===f?void 0:f.chatWidgets)||void 0===m?void 0:m.includes("SST"))||void 0===g||g},O&&O.config&&(this.brandColor=null!==(v=O.config.primaryColor)&&void 0!==v?v:null,this.webchatConfigHasAutoOpenChat=O.config.autoOpenChat,this.requiresConsent=O.config.requiresConsent,this.privacyPolicyUrl=null!==(y=O.config.privacyPolicyUrl)&&void 0!==y?y:this.privacyPolicyUrl,O.config.displayStyle===fi.MINIMIZED&&(this.isMinimized=!0),O.config.displayStyle===fi.PILLS&&(this.designConcept=null),O.config.displayStyle===fi.EMOJI&&(this.designConcept=fi.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);let N=null;var E;x&&(N=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),C&&(null==N?void 0:N.number)&&((e=>{const t=document.querySelectorAll('a[data-selenium-id="click_to_call"]');t&&t.forEach((t=>{"A"===t.tagName&&(t.href=`tel:${Cr(e)}`);const n=t.querySelector(".click-to-call");n&&Or(n)&&(n.textContent=e)}))})(E=N.number),(e=>{const t=document.querySelectorAll(".dvPhone");t&&t.forEach((t=>{var n;"A"===t.tagName&&(t.href=`tel:${Cr(e)}`),Or(t)&&(t.textContent=e);const i=t.nextElementSibling;if("BR"!==(null==i?void 0:i.tagName)||"A"!==(null===(n=null==i?void 0:i.nextElementSibling)||void 0===n?void 0:n.tagName))return;const r=null==i?void 0:i.nextElementSibling;r.href=`sms:${Cr(e)}`,Or(r)&&(r.textContent=`Text: ${e}`)}))})(E),(e=>{const t=document.querySelectorAll(".click_to_call_href");t&&2===t.length&&t.forEach((t=>{"A"===t.tagName&&(t.href=`tel:${Cr(e)}`);const n=t.querySelector(".click_to_call")||t.querySelector(".click_to_call_foot");n&&Or(n)&&(n.textContent=e)}))})(E)),this.phoneNumberForSource=N||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),An(this.building.id)},this.initializeChatVariables=async()=>{var n;this.building&&(this.building.conversationMaintenanceMode?console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear."):(this.myPubnub=new class{constructor(e,t,n){this.apiHost="https://app.meetelise.com",this.building=null,this.ttlHours=24,this.eliseResponseTimeout=null,this.pubnub=null,this.leadUserId="",this.channel="",this.chatListener=null,this.messages=[],this.listenerParams={message:e=>{var t;e.message.messageType!==Tr.noReply&&(this.messages=[...this.messages,{channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken}]);const n="eliseai"!==e.publisher;null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.messages,isLoading:n}),!n&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=n}},this.isLoadingMessages=!1,this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){ai({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub&&!await this.initializePubnub())return;await this.withAuthToken((async()=>{var t,n;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout((()=>{console.error("Elise AI did not respond in time..."),ai({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}),6e4),await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(t=this.building)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,userId:null===(n=this.building)||void 0===n?void 0:n.userId}}))})),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.clearChatStorageKey=()=>localStorage.removeItem("com.eliseai.webchat.slug="+this.buildingSlug),this.createChatStorageKey=e=>{const t=tn(new Date),n=null!=e?e:`lead_${Sr()}_${this.buildingSlug}`;return localStorage.setItem("com.eliseai.webchat.slug="+this.buildingSlug,JSON.stringify({buildingSlug:this.buildingSlug,leadId:n,timestamp:t})),{leadId:n,timestamp:un(t),buildingSlug:this.buildingSlug}},this.getChatStorageKey=(e=!0)=>{const t=localStorage.getItem("com.eliseai.webchat.slug="+this.buildingSlug);if(t)try{const e=JSON.parse(t),n=e.buildingSlug,i=e.leadId,r=new Date(e.timestamp);if(this.isChatKeyValid({leadId:i,timestamp:r,buildingSlug:n}))return{leadId:i,timestamp:r,buildingSlug:n}}catch(e){console.warn("Error getting chat storage key")}return e?this.createChatStorageKey():{leadId:null,timestamp:null,buildingSlug:null}},this.isChatKeyValid=e=>!(e.buildingSlug!==this.buildingSlug||!e.leadId||!e.timestamp||function(e,t){ke(2,arguments);var n=qe(e),i=qe(t);return n.getTime()<i.getTime()}(xr(e.timestamp,this.ttlHours),Date.now())),this.buildingSlug=e,this.building=t,this.orgSlug=n}addChatListener(e){this.chatListener=e}async initializePubnub(){const e=this.getChatStorageKey();if(!e.leadId)return void ai({logTitle:"PUBNUB_ERROR_FETCHING_STORAGE_KEY",logData:{channel:this.channel,eliseaiLocalStorageValue:e,leadUserId:this.leadUserId},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.leadUserId=e.leadId,this.channel=`webchat_${this.leadUserId}`,e.timestamp&&function(e,t){ke(2,arguments);var n=qe(e),i=qe(t);return n.getTime()>i.getTime()}(e.timestamp,xr(new Date,this.ttlHours))&&this.createChatStorageKey(this.leadUserId);const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(fr())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token}),this.withAuthToken((()=>new Promise((()=>this.handleChatListeners())))),await this.withAuthToken((()=>this.getChannelHistory())),this.pubnub):void 0}async fetchToken(e,n){try{return(await t().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${n}`)).data}catch(e){ai({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await t().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){ai({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(t){try{await t()}catch(n){if(n instanceof e.AxiosError&&n&&n.response&&403===n.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const e=await this.fetchToken(this.leadUserId,this.channel);if(!e)return;this.pubnub.setAuthKey(e.auth.result.token),await t()}catch(e){ai({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(){var e;try{const t=await new Promise(((e,t)=>{this.pubnub&&this.channel&&this.pubnub.fetchMessages({channels:[this.channel],count:100},((n,i)=>{n.error?(ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{channel:this.channel,status:n,response:i},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),t(n)):e(i)}))}));if(this.channel&&0!==Object.keys(t.channels).length){const n=t.channels[this.channel],i=[];n.forEach((e=>{e.uuid&&i.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})})),this.messages=i.filter((e=>e.message.messageType!==Tr.noReply)),null===(e=this.chatListener)||void 0===e||e.call(this,{messages:this.messages,isLoading:!1})}}catch(e){ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}(this.buildingSlug,this.building,this.orgSlug),this.myPubnub.isChatKeyValid(this.myPubnub.getChatStorageKey(!1))&&await this.myPubnub.initializePubnub(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(null!==(n=this.building.autoOpenChatWidget)&&void 0!==n?n:this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1))},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!an(un(t)));return!!e&&!!n&&!Un()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",tn(function(e,t){ke(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0})},this.renderChatAdditionalActions=(e,t)=>k` <div
3428
3489
  id=${e}
3429
3490
  class=${fe({showTab:t,hideTab:!t})}
3430
3491
  >
@@ -3446,7 +3507,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
3446
3507
  .brandColor=${this.brandColor}
3447
3508
  .onClick=${()=>{this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1}}
3448
3509
  ></minimize-expand-button>
3449
- </div>`}async handleChatInitializeAnalytics(){var e,t;this.analytics=new li(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",this.currentLeadSource),this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),null===(t=this.myPubnub)||void 0===t||t.clearChatStorageKey(),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions)}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w,S,T,A,x,O,C,I;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Xi);const N=this.hideLauncher&&!this.isLoading&&!this.isMobile;return k`
3510
+ </div>`}async handleChatInitializeAnalytics(){var e,t;this.analytics=new ii(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",this.currentLeadSource),this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),null===(t=this.myPubnub)||void 0===t||t.clearChatStorageKey(),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions)}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w,S,T,A,x,O,C,I;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Xi);const N=this.hideLauncher&&!this.isLoading&&!this.isMobile;return k`
3450
3511
  <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=1">
3451
3512
  <div id="aria-describe-info" style="display: none;">
3452
3513
  EliseAI widget that allows you to chat with a virtual assistant, book
@@ -36,6 +36,7 @@ import { pushGtmEvent } from "../../gtm";
36
36
  import disclaimer from "../../disclaimers";
37
37
  import { tourSchedulerStyles } from "./tourSchedulerStyles";
38
38
  import { defaultBrandColor } from "../../themes";
39
+ import { LogType, sendLoggingEvent } from "../../analytics";
39
40
 
40
41
  const getHumanReadableLayout = (layout: string) => {
41
42
  if (layout == "studio") return "Studio";
@@ -140,9 +141,28 @@ export class TourScheduler extends LitElement {
140
141
  @query("me-select#leadSource")
141
142
  selectedLeadSource!: MESelect;
142
143
 
144
+ @state()
145
+ errorGettingAvailabilities = false;
146
+
143
147
  firstUpdated = async (): Promise<void> => {
144
148
  const availabilitiesExistForTourType =
145
149
  await getExistenceOfAvailabilitiesByTourType();
150
+
151
+ const allValuesAreFalse = Object.values(
152
+ availabilitiesExistForTourType
153
+ ).every((v) => v === false);
154
+ if (allValuesAreFalse) {
155
+ this.errorGettingAvailabilities = true;
156
+ this.waitingForAvailabilities = false;
157
+ sendLoggingEvent({
158
+ logTitle: "ERROR_LOADING_AVAILABILITIES",
159
+ logData: null,
160
+ logType: LogType.warn,
161
+ buildingSlug: this.buildingSlug,
162
+ orgSlug: this.orgSlug,
163
+ });
164
+ return;
165
+ }
146
166
  this.shouldShowTourType = {
147
167
  [TourType.Guided]:
148
168
  this.tourTypeOptions.map((o) => o.value).includes("WITH_AGENT") &&
@@ -947,11 +967,11 @@ export class TourScheduler extends LitElement {
947
967
  `;
948
968
  }
949
969
 
950
- loadingIcon(): TemplateResult {
970
+ loadingIcon(size = 21): TemplateResult {
951
971
  return html`<svg
952
972
  id="loadingIcon"
953
- width="21"
954
- height="21"
973
+ width=${size}
974
+ height=${size}
955
975
  viewBox="0 0 21 21"
956
976
  fill="none"
957
977
  xmlns="http://www.w3.org/2000/svg"
@@ -964,6 +984,52 @@ export class TourScheduler extends LitElement {
964
984
  }
965
985
 
966
986
  render(): TemplateResult {
987
+ if (this.waitingForAvailabilities) {
988
+ return html` <div
989
+ class="${classnames({
990
+ "tour-scheduler-full": !this.compactDesign && !isMobile(),
991
+ "tour-scheduler-compact": this.compactDesign && !isMobile(),
992
+ "tour-scheduler-mobile": isMobile(),
993
+ })}"
994
+ >
995
+ <div class="center-tour-not-avail">
996
+ <h1>Searching for availabilities...</h1>
997
+ <div class="loading-entire-tour-icon">${this.loadingIcon(48)}</div>
998
+ </div>
999
+ </div>`;
1000
+ }
1001
+ if (this.errorGettingAvailabilities) {
1002
+ return html` <div
1003
+ class="${classnames({
1004
+ "tour-scheduler-full": !this.compactDesign && !isMobile(),
1005
+ "tour-scheduler-compact": this.compactDesign && !isMobile(),
1006
+ "tour-scheduler-mobile": isMobile(),
1007
+ })}"
1008
+ >
1009
+ <div id="top-header">
1010
+ <div></div>
1011
+ ${this.closeButton()}
1012
+ </div>
1013
+ <div class="center-tour-not-avail">
1014
+ <h1>Sorry, there are currently no tour availabilities!</h1>
1015
+ <p>
1016
+ We apologize, but there are currently no tours available. This could
1017
+ be due to all slots being filled, off-season periods, or
1018
+ maintenance.
1019
+ </p>
1020
+ <p>
1021
+ We understand that this may be disappointing and we apologize for
1022
+ any inconvenience. We recommend checking back soon as our schedule
1023
+ frequently updates.
1024
+ </p>
1025
+ <p>
1026
+ In the meantime, feel free to explore our website for other
1027
+ information and attractions. Thank you for your understanding and
1028
+ patience!
1029
+ </p>
1030
+ </div>
1031
+ </div>`;
1032
+ }
967
1033
  if (!isMobile()) {
968
1034
  return html`
969
1035
  <div
@@ -398,4 +398,33 @@ otherwise there's some empty space at the bottom of the button, which interferes
398
398
  .nameInput {
399
399
  width: 100%;
400
400
  }
401
+
402
+ .center-tour-not-avail {
403
+ display: flex;
404
+ justify-content: center;
405
+ align-items: center;
406
+ flex-direction: column;
407
+
408
+ height: 320px;
409
+ box-sizing: border-box;
410
+ text-align: center;
411
+
412
+ width: 100%;
413
+ padding: 24px;
414
+ max-width: 440px;
415
+ margin: auto;
416
+ }
417
+ .center-tour-not-avail > h1 {
418
+ font-size: 18px;
419
+ font-weight: 400;
420
+ text-align: center;
421
+ margin: 0;
422
+ }
423
+ .center-tour-not-avail > p {
424
+ font-size: 14px;
425
+ text-align: left;
426
+ }
427
+ .loading-entire-tour-icon {
428
+ padding: 24px;
429
+ }
401
430
  `;
@@ -54,7 +54,8 @@ export class PubnubMessage extends LitElement {
54
54
  const loadingWebsitePreviews: Promise<WebsitePreview>[] = [];
55
55
  const imagesToDisplay: ImageToDisplay[] = [];
56
56
  this.parsedMessage = html`${markedText.split("\n").map((line) => {
57
- return html`${line.split(" ").map((word) => {
57
+ const allWords = line.split(/\s+/);
58
+ return html`${allWords.map((word) => {
58
59
  if (hyperlinks.find((obj) => obj.id === word)) {
59
60
  // EliseAI made hyperlink
60
61
  const link = hyperlinks.find((obj) => obj.id === word);
package/src/analytics.ts CHANGED
@@ -107,7 +107,7 @@ export const sendLoggingEvent = async ({
107
107
  buildingSlug?: string;
108
108
  orgSlug?: string;
109
109
  logTitle: string;
110
- logData: Record<string, unknown>;
110
+ logData: Record<string, unknown> | null;
111
111
  }): Promise<void> => {
112
112
  const host = "https://app.meetelise.com";
113
113
  await axios.post(
@@ -1,4 +1,5 @@
1
1
  import axios from "axios";
2
+ import { LogType, sendLoggingEvent } from "./analytics";
2
3
 
3
4
  export interface ManagementSmsNumber {
4
5
  id: number;
@@ -49,8 +50,17 @@ export const getRegisteredPhoneNumbers = async (
49
50
  if (registeredPhoneNumbersCache[buildingId]) {
50
51
  return registeredPhoneNumbersCache[buildingId];
51
52
  }
52
- const url = `https://app.meetelise.com/sms_management_numbers/webchat/building/${buildingId}/numbers`;
53
- const result = await axios.get<ManagementSmsNumber[]>(url);
54
- registeredPhoneNumbersCache[buildingId] = result.data;
55
- return result.data;
53
+ try {
54
+ const url = `https://app.meetelise.com/sms_management_numbers/webchat/building/${buildingId}/numbers`;
55
+ const result = await axios.get<ManagementSmsNumber[]>(url);
56
+ registeredPhoneNumbersCache[buildingId] = result.data;
57
+ return result.data;
58
+ } catch (error) {
59
+ sendLoggingEvent({
60
+ logTitle: "ERROR_LOADING_PHONE_NUMBERS",
61
+ logData: { error, buildingId },
62
+ logType: LogType.error,
63
+ });
64
+ return [];
65
+ }
56
66
  };