@meetelise/chat 1.20.1 → 1.20.2
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 +1 -1
- package/public/dist/index.js +15 -7
- package/src/WebComponent/Launcher.ts +10 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +9 -2
- package/src/WebComponent/actions/email-us-window.ts +17 -3
- package/src/WebComponent/actions/text-us-window.ts +23 -3
- package/src/WebComponent/me-chat.ts +2 -0
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -430,7 +430,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
430
430
|
.option.active {
|
|
431
431
|
background-color: var(--active-option-color);
|
|
432
432
|
}
|
|
433
|
-
`,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ie("me-select")],$t);var Vt=n(9669),Xt=n.n(Vt),Qt=n(9991),Zt=n(7739),Kt=n.n(Zt);Math.pow(10,8);var Yt=36e5;function en(e,t){_e(1,arguments);var n=t||{},i=null==n.additionalDigits?2:Ve(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=an(e);if(o.date){var a=sn(o.date,i);r=un(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=dn(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=pn(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var tn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},nn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,on=/^([+-])(\d{2})(?::?(\d{2}))?$/;function an(e){var t,n={},i=e.split(tn.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],tn.timeZoneDelimiter.test(n.date)&&(n.date=e.split(tn.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=tn.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function sn(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}function un(e,t){if(null===t)return new Date(NaN);var n=e.match(nn);if(!n)return new Date(NaN);var i=!!n[4],r=ln(n[1]),o=ln(n[2])-1,a=ln(n[3]),s=ln(n[4]),u=ln(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*(t-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(fn[t]||(hn(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(hn(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function ln(e){return e?parseInt(e):1}function dn(e){var t=e.match(rn);if(!t)return NaN;var n=cn(t[1]),i=cn(t[2]),r=cn(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r)?n*Yt+6e4*i+1e3*r:NaN}function cn(e){return e&&parseFloat(e.replace(",","."))||0}function pn(e){if("Z"===e)return 0;var t=e.match(on);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(i*Yt+6e4*r):NaN}var fn=[31,null,31,30,31,30,31,31,30,31,30,31];function hn(e){return e%400==0||e%4==0&&e%100!=0}const mn={buildingId:null,availabilities:{}},vn=async e=>{e&&(mn.buildingId=e);const t=mn.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=mn.availabilities;if(n[t])return n[t];const i=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),r=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var n=Fe(e),i=Ve(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}(i,30))),o=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?startTime=${zt(i)}&endTime=${r}`,a=await Xt().get(o);return mn.availabilities[t]=a.data,a.data},gn=async(e,t)=>{var n,i;const r=await vn(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},yn=async(e,t)=>{var n,i;const r=await gn(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter((e=>De(en(e))&&!function(e){return _e(1,arguments),Fe(e).getTime()<Date.now()}(en(e)))):[])||void 0===n?void 0:n.map((e=>wn(e)))};return Kt()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(new Date(e.datetime),"yyyy-MM-dd")))},wn=e=>({datetime:e.slice(0,19),offset:e.slice(19)});n(7294);const bn=()=>window.matchMedia("(max-width: 767px)").matches;var Sn=n(6486),Tn=n(4184),xn=n.n(Tn),On=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 In=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.tourType=Rn.Guided,this.shouldShowTourType={[Rn.Guided]:!0,[Rn.Self]:!0,[Rn.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await yn(Nn[this.tourType]),this.waitingForAvailabilities=!1;const e=await(async()=>{var e,t,n,i,r,o;return{[Rn.Guided]:!!(null===(t=null===(e=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Rn.Self]:!!(null===(i=null===(n=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Rn.Virtual]:!!(null===(o=null===(r=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[Rn.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[Rn.Guided],[Rn.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[Rn.Self],[Rn.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[Rn.Virtual]}},this.willUpdate=async e=>{e.has("tourType")&&(this.availabilitiesGroupedByDay=await yn(Nn[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||Ne(e)){if("Backspace"===e.key){if(Ne(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)||Ne(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:()=>!isNaN(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;if(!this.selectedDate||!this.selectedTime)return;const t={email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:An[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`};this.isSubmitting=!0;const n=await Xt().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",t,{headers:{"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}});if(200===n.status)this.isSubmitting=!1,this.tourIsBooked=!0;else{const e=n.data.detail||"Failed to book tour";alert(e),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>D`<action-confirm-button
|
|
433
|
+
`,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ie("me-select")],$t);var Vt=n(9669),Xt=n.n(Vt),Qt=n(9991),Zt=n(7739),Kt=n.n(Zt);Math.pow(10,8);var Yt=36e5;function en(e,t){_e(1,arguments);var n=t||{},i=null==n.additionalDigits?2:Ve(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=an(e);if(o.date){var a=sn(o.date,i);r=un(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=dn(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=pn(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var tn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},nn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,on=/^([+-])(\d{2})(?::?(\d{2}))?$/;function an(e){var t,n={},i=e.split(tn.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],tn.timeZoneDelimiter.test(n.date)&&(n.date=e.split(tn.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=tn.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function sn(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}function un(e,t){if(null===t)return new Date(NaN);var n=e.match(nn);if(!n)return new Date(NaN);var i=!!n[4],r=ln(n[1]),o=ln(n[2])-1,a=ln(n[3]),s=ln(n[4]),u=ln(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*(t-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(fn[t]||(hn(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(hn(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function ln(e){return e?parseInt(e):1}function dn(e){var t=e.match(rn);if(!t)return NaN;var n=cn(t[1]),i=cn(t[2]),r=cn(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r)?n*Yt+6e4*i+1e3*r:NaN}function cn(e){return e&&parseFloat(e.replace(",","."))||0}function pn(e){if("Z"===e)return 0;var t=e.match(on);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(i*Yt+6e4*r):NaN}var fn=[31,null,31,30,31,30,31,31,30,31,30,31];function hn(e){return e%400==0||e%4==0&&e%100!=0}const mn={buildingId:null,availabilities:{}},vn=async e=>{e&&(mn.buildingId=e);const t=mn.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=mn.availabilities;if(n[t])return n[t];const i=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),r=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var n=Fe(e),i=Ve(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}(i,30))),o=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?startTime=${zt(i)}&endTime=${r}`,a=await Xt().get(o);return mn.availabilities[t]=a.data,a.data},gn=async(e,t)=>{var n,i;const r=await vn(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},yn=async(e,t)=>{var n,i;const r=await gn(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter((e=>De(en(e))&&!function(e){return _e(1,arguments),Fe(e).getTime()<Date.now()}(en(e)))):[])||void 0===n?void 0:n.map((e=>wn(e)))};return Kt()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(new Date(e.datetime),"yyyy-MM-dd")))},wn=e=>({datetime:e.slice(0,19),offset:e.slice(19)});n(7294);const bn=()=>window.matchMedia("(max-width: 767px)").matches;var Sn=n(6486),Tn=n(4184),xn=n.n(Tn),On=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 In=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.tourType=Rn.Guided,this.shouldShowTourType={[Rn.Guided]:!0,[Rn.Self]:!0,[Rn.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await yn(Nn[this.tourType]),this.waitingForAvailabilities=!1;const e=await(async()=>{var e,t,n,i,r,o;return{[Rn.Guided]:!!(null===(t=null===(e=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Rn.Self]:!!(null===(i=null===(n=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Rn.Virtual]:!!(null===(o=null===(r=await gn(Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[Rn.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[Rn.Guided],[Rn.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[Rn.Self],[Rn.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[Rn.Virtual]}},this.willUpdate=async e=>{e.has("tourType")&&(this.availabilitiesGroupedByDay=await yn(Nn[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||Ne(e)){if("Backspace"===e.key){if(Ne(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)||Ne(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:()=>!isNaN(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;if(!this.selectedDate||!this.selectedTime)return;const t={email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:An[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`};this.isSubmitting=!0;const n=await Xt().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",t,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}});if(200===n.status)this.isSubmitting=!1,this.tourIsBooked=!0;else{const e=n.data.detail||"Failed to book tour";alert(e),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>D`<action-confirm-button
|
|
434
434
|
id="schedule"
|
|
435
435
|
.onClick=${this.submit}
|
|
436
436
|
.isLoading=${this.isSubmitting}
|
|
@@ -1047,7 +1047,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1047
1047
|
margin-top: 37px;
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
|
-
`,On([oe({attribute:!1})],In.prototype,"layoutOptions",void 0),On([oe({attribute:!1})],In.prototype,"tourTypeOptions",void 0),On([oe({type:Number})],In.prototype,"buildingId",void 0),On([oe({attribute:!
|
|
1050
|
+
`,On([oe({attribute:!1})],In.prototype,"layoutOptions",void 0),On([oe({attribute:!1})],In.prototype,"tourTypeOptions",void 0),On([oe({type:Number})],In.prototype,"buildingId",void 0),On([oe({attribute:!0})],In.prototype,"buildingSlug",void 0),On([oe({attribute:!0})],In.prototype,"orgSlug",void 0),On([ae()],In.prototype,"tourType",void 0),On([ae()],In.prototype,"shouldShowTourType",void 0),On([ae()],In.prototype,"email",void 0),On([ae()],In.prototype,"phoneNumber",void 0),On([ae()],In.prototype,"availabilitiesGroupedByDay",void 0),On([ae()],In.prototype,"waitingForAvailabilities",void 0),On([ae()],In.prototype,"selectedDate",void 0),On([ae()],In.prototype,"selectedTime",void 0),On([ae()],In.prototype,"mobilePageIndex",void 0),On([ae()],In.prototype,"isSubmitting",void 0),On([ae()],In.prototype,"tourIsBooked",void 0),On([se(".inputContainer#firstName input")],In.prototype,"firstNameInput",void 0),On([se(".inputContainer#lastName input")],In.prototype,"lastNameInput",void 0),On([se(".inputContainer#email input")],In.prototype,"emailInput",void 0),On([se(".inputContainer#phone input")],In.prototype,"phoneInput",void 0),On([se("me-select#unitType")],In.prototype,"unitTypeSelect",void 0),In=On([ie("tour-scheduler")],In),function(e){e[e.Guided=0]="Guided",e[e.Self=1]="Self",e[e.Virtual=2]="Virtual"}(Rn||(Rn={}));const Nn={[Rn.Guided]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Rn.Self]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Rn.Virtual]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},An={[Rn.Guided]:"escorted-tour",[Rn.Self]:"self-guided-tour",[Rn.Virtual]:"live-virtual-tour"};class Cn{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}campaignSources(){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}}ping(e){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:this.campaignSources()})})}}var En,_n=new Uint8Array(16);function Fn(){if(!En&&!(En="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return En(_n)}const Mn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Pn=function(e){return"string"==typeof e&&Mn.test(e)};for(var Dn=[],qn=0;qn<256;++qn)Dn.push((qn+256).toString(16).substr(1));const Un=function(e,t,n){var i=(e=e||{}).random||(e.rng||Fn)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Dn[e[t+0]]+Dn[e[t+1]]+Dn[e[t+2]]+Dn[e[t+3]]+"-"+Dn[e[t+4]]+Dn[e[t+5]]+"-"+Dn[e[t+6]]+Dn[e[t+7]]+"-"+Dn[e[t+8]]+Dn[e[t+9]]+"-"+Dn[e[t+10]]+Dn[e[t+11]]+Dn[e[t+12]]+Dn[e[t+13]]+Dn[e[t+14]]+Dn[e[t+15]]).toLowerCase();if(!Pn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function Jn(e,t){const n=Ln(e,t),i=Un();return localStorage.setItem(n,i),kn(e,t),i}function kn(e,t){const n=Bn(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function Ln(e,t){return`com.meetelise.chatID-${e}-${t}`}function Bn(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const jn="#FFFFFF",Hn="#202020",Wn={user:{textColor:jn,backgroundColor:"#1990FF"},agent:{textColor:jn,backgroundColor:"#1E1E1E"}},Gn={user:{textColor:jn,backgroundColor:"#83818E"},agent:{textColor:jn,backgroundColor:Hn}},$n={Light:{chatHeader:{backgroundColor:jn,textColor:Hn},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:Wn},Dark:{chatHeader:{backgroundColor:Hn,textColor:jn},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:Wn},Purple:{chatHeader:{backgroundColor:"#550098",textColor:jn},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:Wn},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:jn},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:Wn},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:Hn},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:Gn},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:jn},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:Wn},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:Hn},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:Gn},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:jn},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:Wn},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:jn},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:Wn}},zn=e=>$n[e&&Object.keys($n).includes(e)?e:"Light"];function Vn(e,t,n,i,r,o){var a;const s=new Oe.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage,availabilityText:t.systemWelcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===Gn).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}const Xn=a`
|
|
1051
1051
|
:host {
|
|
1052
1052
|
--glowBarHeight: 11.2px;
|
|
1053
1053
|
--enterAnimationDuration: 0.5s;
|
|
@@ -1520,7 +1520,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1520
1520
|
font-family: "Poppins";
|
|
1521
1521
|
font-size: 16px;
|
|
1522
1522
|
}
|
|
1523
|
-
`;var ri=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 oi=class extends te{constructor(){super(...arguments),this.buildingId=0,this.phoneNumberInputRef=be(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Ae(e))return;const t=e.target;this.phoneNumber=Ie(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{Re(e)||Ae(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&this.email.includes("@")||(this.hasEmailError=!0),this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0),this.message||(this.hasMessageError=!0),this.windowHeight=525+30*this.getNumErrors()},this.onClick=async()=>{if(!(this.isSubmitting||(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError)))try{this.isSubmitting=!0,this.windowHeight=585,await ai(this.firstName,this.lastName,this.email,this.phoneNumber,this.message,this.buildingId),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=525}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=525}},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError].filter((e=>e)).length,this.render=()=>(ni(),Kn(),this.hasSubmittedForm?D`
|
|
1523
|
+
`;var ri=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 oi=class extends te{constructor(){super(...arguments),this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.phoneNumberInputRef=be(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Ae(e))return;const t=e.target;this.phoneNumber=Ie(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{Re(e)||Ae(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&this.email.includes("@")||(this.hasEmailError=!0),this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0),this.message||(this.hasMessageError=!0),this.windowHeight=525+30*this.getNumErrors()},this.onClick=async()=>{if(!(this.isSubmitting||(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError)))try{this.isSubmitting=!0,this.windowHeight=585,await ai(this.firstName,this.lastName,this.email,this.phoneNumber,this.message,this.buildingId,this.orgSlug,this.buildingSlug),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=525}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=525}},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError].filter((e=>e)).length,this.render=()=>(ni(),Kn(),this.hasSubmittedForm?D`
|
|
1524
1524
|
<details-window
|
|
1525
1525
|
headerText="Email us"
|
|
1526
1526
|
.onCloseClick=${this.onCloseClicked}
|
|
@@ -1694,7 +1694,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1694
1694
|
width: -webkit-fill-available;
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
|
-
`,ii],ri([oe({attribute:!1})],oi.prototype,"onCloseClicked",void 0),ri([oe({attribute:!1})],oi.prototype,"buildingId",void 0),ri([oe()],oi.prototype,"privatePolicyUrl",void 0),ri([oe()],oi.prototype,"termsOfServiceUrl",void 0),ri([ae()],oi.prototype,"firstName",void 0),ri([ae()],oi.prototype,"lastName",void 0),ri([ae()],oi.prototype,"email",void 0),ri([ae()],oi.prototype,"phoneNumber",void 0),ri([ae()],oi.prototype,"message",void 0),ri([ae()],oi.prototype,"hasNameError",void 0),ri([ae()],oi.prototype,"hasEmailError",void 0),ri([ae()],oi.prototype,"hasPhoneNumberError",void 0),ri([ae()],oi.prototype,"hasMessageError",void 0),ri([ae()],oi.prototype,"hasSubmittedForm",void 0),ri([ae()],oi.prototype,"windowHeight",void 0),ri([ae()],oi.prototype,"hasSubmissionError",void 0),ri([ae()],oi.prototype,"isSubmitting",void 0),oi=ri([ie("email-us-window")],oi);const ai=async(e,t,n,i,r,o)=>{const
|
|
1697
|
+
`,ii],ri([oe({attribute:!1})],oi.prototype,"onCloseClicked",void 0),ri([oe({attribute:!1})],oi.prototype,"buildingId",void 0),ri([oe({attribute:!0})],oi.prototype,"buildingSlug",void 0),ri([oe({attribute:!0})],oi.prototype,"orgSlug",void 0),ri([oe()],oi.prototype,"privatePolicyUrl",void 0),ri([oe()],oi.prototype,"termsOfServiceUrl",void 0),ri([ae()],oi.prototype,"firstName",void 0),ri([ae()],oi.prototype,"lastName",void 0),ri([ae()],oi.prototype,"email",void 0),ri([ae()],oi.prototype,"phoneNumber",void 0),ri([ae()],oi.prototype,"message",void 0),ri([ae()],oi.prototype,"hasNameError",void 0),ri([ae()],oi.prototype,"hasEmailError",void 0),ri([ae()],oi.prototype,"hasPhoneNumberError",void 0),ri([ae()],oi.prototype,"hasMessageError",void 0),ri([ae()],oi.prototype,"hasSubmittedForm",void 0),ri([ae()],oi.prototype,"windowHeight",void 0),ri([ae()],oi.prototype,"hasSubmissionError",void 0),ri([ae()],oi.prototype,"isSubmitting",void 0),oi=ri([ie("email-us-window")],oi);const ai=async(e,t,n,i,r,o,a,s)=>{const u={email_address:n,building_id:o,lead_source:"property-website",first_message:r,first_name:e,last_name:t,phone_number:"+1"+i.replace("(","").replace(")","").replace(" ","").replace("-","")};await Xt().post("https://app.meetelise.com/platformApi/state/create/emailMe",u,{headers:{"building-slug":s,"org-slug":a,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})};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 te{constructor(){super(...arguments),this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.phoneNumberInputRef=be(),this.phoneNumber="",this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Ae(e))return;const t=e.target;this.phoneNumber=Ie(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.enforceFormat=e=>{Re(e)||Ae(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0)},this.onClick=async()=>{if(this.validateFormFields(),!this.hasPhoneNumberError)try{this.isSubmitting=!0,await li(this.phoneNumber,this.buildingId,this.orgSlug,this.buildingSlug),this.hasSubmittedForm=!0,this.isSubmitting=!1}catch(e){this.isSubmitting=!1,this.hasSubmissionError=!0}},this.render=()=>(ni(),Kn(),this.hasSubmittedForm?D`
|
|
1698
1698
|
<details-window
|
|
1699
1699
|
headerText="Text us"
|
|
1700
1700
|
.onCloseClick=${this.onCloseClicked}
|
|
@@ -1793,7 +1793,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1793
1793
|
line-height: 22px;
|
|
1794
1794
|
margin-top: 8px;
|
|
1795
1795
|
}
|
|
1796
|
-
`,ii],si([oe({attribute:!1})],ui.prototype,"onCloseClicked",void 0),si([oe({attribute:!1})],ui.prototype,"buildingId",void 0),si([ae()],ui.prototype,"phoneNumber",void 0),si([ae()],ui.prototype,"hasSubmittedForm",void 0),si([ae()],ui.prototype,"hasPhoneNumberError",void 0),si([ae()],ui.prototype,"hasSubmissionError",void 0),si([ae()],ui.prototype,"isSubmitting",void 0),ui=si([ie("text-us-window")],ui);const li=async(e,t)=>{const
|
|
1796
|
+
`,ii],si([oe({attribute:!1})],ui.prototype,"onCloseClicked",void 0),si([oe({attribute:!1})],ui.prototype,"buildingId",void 0),si([oe({attribute:!0})],ui.prototype,"buildingSlug",void 0),si([oe({attribute:!0})],ui.prototype,"orgSlug",void 0),si([ae()],ui.prototype,"phoneNumber",void 0),si([ae()],ui.prototype,"hasSubmittedForm",void 0),si([ae()],ui.prototype,"hasPhoneNumberError",void 0),si([ae()],ui.prototype,"hasSubmissionError",void 0),si([ae()],ui.prototype,"isSubmitting",void 0),ui=si([ie("text-us-window")],ui);const li=async(e,t,n,i)=>{const r={building_id:t,lead_source:"property-website",phone_number:"+1"+e.replace("(","").replace(")","").replace(" ","").replace("-","")};await Xt().post("https://app.meetelise.com/platformApi/state/create/textMe",r,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})},di={},ci=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];var pi=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 fi=class extends te{constructor(){super(...arguments),this.phoneNumber="1-855-531-5131",this.buildingId=0,this.chatCallUsHeader="Call Us",this.firstUpdated=async()=>{this.buildingId&&(this.officeHoursTextInfo=await(async e=>{const t=await(async e=>{if(di[e])return di[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await Xt().get(t);return di[e]=n.data,n.data})(e);return ci.map((e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e}))})(this.buildingId))},this.officeHoursTextInfo=[],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 D`<a href="tel:${i}"
|
|
1797
1797
|
>${e}</a
|
|
1798
1798
|
>`},this.render=()=>D`
|
|
1799
1799
|
<details-window
|
|
@@ -1863,7 +1863,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1863
1863
|
.call-us-window__open-times {
|
|
1864
1864
|
text-transform: lowercase;
|
|
1865
1865
|
}
|
|
1866
|
-
`],pi([oe({attribute:!1})],fi.prototype,"onCloseClicked",void 0),pi([oe()],fi.prototype,"phoneNumber",void 0),pi([oe({attribute:!1})],fi.prototype,"buildingId",void 0),pi([oe({attribute:!0})],fi.prototype,"chatCallUsHeader",void 0),pi([oe({attribute:!1})],fi.prototype,"officeHoursTextInfo",void 0),fi=pi([ie("call-us-window")],fi);const hi={};var mi=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 vi=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.chatCallUsHeader="Call us",this.buildingId=0,this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(hi[e])return hi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return hi[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return D`
|
|
1866
|
+
`],pi([oe({attribute:!1})],fi.prototype,"onCloseClicked",void 0),pi([oe()],fi.prototype,"phoneNumber",void 0),pi([oe({attribute:!1})],fi.prototype,"buildingId",void 0),pi([oe({attribute:!0})],fi.prototype,"chatCallUsHeader",void 0),pi([oe({attribute:!1})],fi.prototype,"officeHoursTextInfo",void 0),fi=pi([ie("call-us-window")],fi);const hi={};var mi=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 vi=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.chatCallUsHeader="Call us",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(hi[e])return hi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return hi[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return D`
|
|
1867
1867
|
<div
|
|
1868
1868
|
@click=${this.onClickEmailOption}
|
|
1869
1869
|
class="launcher__call-to-action-option"
|
|
@@ -1907,6 +1907,8 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1907
1907
|
>
|
|
1908
1908
|
${this.isEmailWindowOpen?D`<div class="launcher__window-wrapper">
|
|
1909
1909
|
<email-us-window
|
|
1910
|
+
orgSlug="${this.orgSlug}"
|
|
1911
|
+
buildingSlug="${this.buildingSlug}"
|
|
1910
1912
|
${xe(this.emailUsWindowRef)}
|
|
1911
1913
|
.buildingId=${this.buildingId}
|
|
1912
1914
|
>
|
|
@@ -1914,12 +1916,16 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1914
1916
|
</div>`:""}
|
|
1915
1917
|
${this.isTextUsWindowOpen?D`<div class="launcher__window-wrapper">
|
|
1916
1918
|
<text-us-window
|
|
1919
|
+
orgSlug="${this.orgSlug}"
|
|
1920
|
+
buildingSlug="${this.buildingSlug}"
|
|
1917
1921
|
${xe(this.textUsWindowRef)}
|
|
1918
1922
|
.buildingId=${this.buildingId}
|
|
1919
1923
|
></text-us-window>
|
|
1920
1924
|
</div>`:""}
|
|
1921
1925
|
${this.isSSTWindowOpen?D`<div class="launcher__window-wrapper">
|
|
1922
1926
|
<tour-scheduler
|
|
1927
|
+
orgSlug="${this.orgSlug}"
|
|
1928
|
+
buildingSlug="${this.buildingSlug}"
|
|
1923
1929
|
.layoutOptions=${this.layoutOptions}
|
|
1924
1930
|
.tourTypeOptions=${this.tourTypeOptions}
|
|
1925
1931
|
buildingId=${this.buildingId}
|
|
@@ -2080,7 +2086,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2080
2086
|
</div>
|
|
2081
2087
|
`}
|
|
2082
2088
|
</div>
|
|
2083
|
-
`}};vi.styles=Xn,mi([oe({type:Boolean})],vi.prototype,"isMobile",void 0),mi([oe({type:Boolean})],vi.prototype,"isFirstMount",void 0),mi([oe()],vi.prototype,"backgroundColor",void 0),mi([oe()],vi.prototype,"textColor",void 0),mi([oe({type:Boolean})],vi.prototype,"isMini",void 0),mi([oe()],vi.prototype,"phoneNumber",void 0),mi([oe({attribute:!0})],vi.prototype,"chatCallUsHeader",void 0),mi([oe({attribute:!1})],vi.prototype,"buildingId",void 0),mi([oe({type:Boolean})],vi.prototype,"hasCallUsEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasChatEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasEmailEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasSSTEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasTextUsEnabled",void 0),mi([oe({attribute:!1})],vi.prototype,"layoutOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"tourTypeOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"onChatTapped",void 0),mi([oe({attribute:!1})],vi.prototype,"launcherStyles",void 0),mi([ae()],vi.prototype,"isEmailWindowOpen",void 0),mi([ae()],vi.prototype,"isCallUsWindowOpen",void 0),mi([ae()],vi.prototype,"isSSTWindowOpen",void 0),mi([ae()],vi.prototype,"isTextUsWindowOpen",void 0),vi=mi([ie("meetelise-launcher")],vi);var gi=n(3379),yi=n.n(gi),wi=n(7795),bi=n.n(wi),Si=n(569),Ti=n.n(Si),xi=n(3565),Oi=n.n(xi),Ii=n(9216),Ri=n.n(Ii),Ni=n(4589),Ai=n.n(Ni),Ci=n(3631),Ei={};Ei.styleTagTransform=Ai(),Ei.setAttributes=Oi(),Ei.insert=Ti().bind(null,"head"),Ei.domAPI=bi(),Ei.insertStyleElement=Ri(),yi()(Ci.Z,Ei),Ci.Z&&Ci.Z.locals&&Ci.Z.locals;var _i,Fi=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 Mi=_i=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=zn(),this.chatId="",this.analytics=null,this.isMobile=bn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),vn(this.building.id),this.chatId=function(e,t){const n=Ln(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Bn(e,t),i=localStorage.getItem(n)||kn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,_i.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{const r=n.createPopup(Vn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&_i.session))return;this.chatId=Jn(this.orgSlug,this.buildingSlug);const e=await _i.session;this.analytics.chatId=this.chatId,this.popup.select(Vn(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",vi),D`
|
|
2089
|
+
`}};vi.styles=Xn,mi([oe({type:Boolean})],vi.prototype,"isMobile",void 0),mi([oe({type:Boolean})],vi.prototype,"isFirstMount",void 0),mi([oe()],vi.prototype,"backgroundColor",void 0),mi([oe()],vi.prototype,"textColor",void 0),mi([oe({type:Boolean})],vi.prototype,"isMini",void 0),mi([oe()],vi.prototype,"phoneNumber",void 0),mi([oe({attribute:!0})],vi.prototype,"chatCallUsHeader",void 0),mi([oe({attribute:!1})],vi.prototype,"buildingId",void 0),mi([oe({attribute:!0})],vi.prototype,"buildingSlug",void 0),mi([oe({attribute:!0})],vi.prototype,"orgSlug",void 0),mi([oe({type:Boolean})],vi.prototype,"hasCallUsEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasChatEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasEmailEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasSSTEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasTextUsEnabled",void 0),mi([oe({attribute:!1})],vi.prototype,"layoutOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"tourTypeOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"onChatTapped",void 0),mi([oe({attribute:!1})],vi.prototype,"launcherStyles",void 0),mi([ae()],vi.prototype,"isEmailWindowOpen",void 0),mi([ae()],vi.prototype,"isCallUsWindowOpen",void 0),mi([ae()],vi.prototype,"isSSTWindowOpen",void 0),mi([ae()],vi.prototype,"isTextUsWindowOpen",void 0),vi=mi([ie("meetelise-launcher")],vi);var gi=n(3379),yi=n.n(gi),wi=n(7795),bi=n.n(wi),Si=n(569),Ti=n.n(Si),xi=n(3565),Oi=n.n(xi),Ii=n(9216),Ri=n.n(Ii),Ni=n(4589),Ai=n.n(Ni),Ci=n(3631),Ei={};Ei.styleTagTransform=Ai(),Ei.setAttributes=Oi(),Ei.insert=Ti().bind(null,"head"),Ei.domAPI=bi(),Ei.insertStyleElement=Ri(),yi()(Ci.Z,Ei),Ci.Z&&Ci.Z.locals&&Ci.Z.locals;var _i,Fi=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 Mi=_i=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=zn(),this.chatId="",this.analytics=null,this.isMobile=bn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),vn(this.building.id),this.chatId=function(e,t){const n=Ln(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Bn(e,t),i=localStorage.getItem(n)||kn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,_i.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{const r=n.createPopup(Vn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&_i.session))return;this.chatId=Jn(this.orgSlug,this.buildingSlug);const e=await _i.session;this.analytics.chatId=this.chatId,this.popup.select(Vn(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",vi),D`
|
|
2084
2090
|
<div
|
|
2085
2091
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
2086
2092
|
>
|
|
@@ -2097,6 +2103,8 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2097
2103
|
phoneNumber="${null!==(l=null===(u=this.building)||void 0===u?void 0:u.phoneNumber)&&void 0!==l?l:""}"
|
|
2098
2104
|
textColor="${this.theme.chatHeader.textColor}"
|
|
2099
2105
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
2106
|
+
orgSlug="${this.orgSlug}"
|
|
2107
|
+
buildingSlug="${this.buildingSlug}"
|
|
2100
2108
|
?hidden=${this.hideLauncher}
|
|
2101
2109
|
?hasCallUsEnabled=${!(null===(d=this.building)||void 0===d?void 0:d.chatWidgets)||(null===(c=this.building)||void 0===c?void 0:c.chatWidgets.includes("CALL"))}
|
|
2102
2110
|
?hasChatEnabled=${!(null===(p=this.building)||void 0===p?void 0:p.chatWidgets)||(null===(f=this.building)||void 0===f?void 0:f.chatWidgets.includes("CHAT"))}
|
|
@@ -38,6 +38,10 @@ export class Launcher extends LitElement {
|
|
|
38
38
|
chatCallUsHeader = "Call us";
|
|
39
39
|
@property({ attribute: false })
|
|
40
40
|
buildingId = 0;
|
|
41
|
+
@property({ attribute: true })
|
|
42
|
+
buildingSlug = "";
|
|
43
|
+
@property({ attribute: true })
|
|
44
|
+
orgSlug = "";
|
|
41
45
|
@property({ type: Boolean })
|
|
42
46
|
hasCallUsEnabled = false;
|
|
43
47
|
@property({ type: Boolean })
|
|
@@ -266,6 +270,8 @@ export class Launcher extends LitElement {
|
|
|
266
270
|
${this.isEmailWindowOpen
|
|
267
271
|
? html`<div class="launcher__window-wrapper">
|
|
268
272
|
<email-us-window
|
|
273
|
+
orgSlug="${this.orgSlug}"
|
|
274
|
+
buildingSlug="${this.buildingSlug}"
|
|
269
275
|
${ref(this.emailUsWindowRef)}
|
|
270
276
|
.buildingId=${this.buildingId}
|
|
271
277
|
>
|
|
@@ -275,6 +281,8 @@ export class Launcher extends LitElement {
|
|
|
275
281
|
${this.isTextUsWindowOpen
|
|
276
282
|
? html`<div class="launcher__window-wrapper">
|
|
277
283
|
<text-us-window
|
|
284
|
+
orgSlug="${this.orgSlug}"
|
|
285
|
+
buildingSlug="${this.buildingSlug}"
|
|
278
286
|
${ref(this.textUsWindowRef)}
|
|
279
287
|
.buildingId=${this.buildingId}
|
|
280
288
|
></text-us-window>
|
|
@@ -283,6 +291,8 @@ export class Launcher extends LitElement {
|
|
|
283
291
|
${this.isSSTWindowOpen
|
|
284
292
|
? html`<div class="launcher__window-wrapper">
|
|
285
293
|
<tour-scheduler
|
|
294
|
+
orgSlug="${this.orgSlug}"
|
|
295
|
+
buildingSlug="${this.buildingSlug}"
|
|
286
296
|
.layoutOptions=${this.layoutOptions}
|
|
287
297
|
.tourTypeOptions=${this.tourTypeOptions}
|
|
288
298
|
buildingId=${this.buildingId}
|
|
@@ -34,7 +34,10 @@ export class TourScheduler extends LitElement {
|
|
|
34
34
|
tourTypeOptions: LabeledOption[] = [];
|
|
35
35
|
@property({ type: Number })
|
|
36
36
|
buildingId = 0;
|
|
37
|
-
@property({ attribute:
|
|
37
|
+
@property({ attribute: true })
|
|
38
|
+
buildingSlug = "";
|
|
39
|
+
@property({ attribute: true })
|
|
40
|
+
orgSlug = "";
|
|
38
41
|
onCloseClicked?: (e: MouseEvent) => void;
|
|
39
42
|
|
|
40
43
|
@state()
|
|
@@ -313,7 +316,11 @@ export class TourScheduler extends LitElement {
|
|
|
313
316
|
const url = `https://app.meetelise.com/platformApi/state/create/scheduleMe`;
|
|
314
317
|
this.isSubmitting = true;
|
|
315
318
|
const response = await axios.post(url, data, {
|
|
316
|
-
headers: {
|
|
319
|
+
headers: {
|
|
320
|
+
["building-slug"]: this.buildingSlug,
|
|
321
|
+
["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
|
|
322
|
+
["org-slug"]: this.orgSlug,
|
|
323
|
+
},
|
|
317
324
|
});
|
|
318
325
|
if (response.status === 200) {
|
|
319
326
|
this.isSubmitting = false;
|
|
@@ -88,6 +88,10 @@ export class EmailUsWindow extends LitElement {
|
|
|
88
88
|
|
|
89
89
|
@property({ attribute: false })
|
|
90
90
|
buildingId = 0;
|
|
91
|
+
@property({ attribute: true })
|
|
92
|
+
buildingSlug = "";
|
|
93
|
+
@property({ attribute: true })
|
|
94
|
+
orgSlug = "";
|
|
91
95
|
|
|
92
96
|
phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
|
|
93
97
|
|
|
@@ -220,7 +224,9 @@ export class EmailUsWindow extends LitElement {
|
|
|
220
224
|
this.email,
|
|
221
225
|
this.phoneNumber,
|
|
222
226
|
this.message,
|
|
223
|
-
this.buildingId
|
|
227
|
+
this.buildingId,
|
|
228
|
+
this.orgSlug,
|
|
229
|
+
this.buildingSlug
|
|
224
230
|
);
|
|
225
231
|
this.hasSubmittedForm = true;
|
|
226
232
|
this.isSubmitting = false;
|
|
@@ -403,7 +409,9 @@ const createEmail = async (
|
|
|
403
409
|
email: string,
|
|
404
410
|
rawPhoneNumber: string,
|
|
405
411
|
message: string,
|
|
406
|
-
buildingId: number
|
|
412
|
+
buildingId: number,
|
|
413
|
+
orgSlug: string,
|
|
414
|
+
buildingSlug: string
|
|
407
415
|
) => {
|
|
408
416
|
const formattedPhoneNumber =
|
|
409
417
|
"+1" +
|
|
@@ -425,6 +433,12 @@ const createEmail = async (
|
|
|
425
433
|
await axios.post(
|
|
426
434
|
"https://app.meetelise.com/platformApi/state/create/emailMe",
|
|
427
435
|
requestBody,
|
|
428
|
-
{
|
|
436
|
+
{
|
|
437
|
+
headers: {
|
|
438
|
+
["building-slug"]: buildingSlug,
|
|
439
|
+
["org-slug"]: orgSlug,
|
|
440
|
+
["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
|
|
441
|
+
},
|
|
442
|
+
}
|
|
429
443
|
);
|
|
430
444
|
};
|
|
@@ -55,6 +55,10 @@ export class TextUsWindow extends LitElement {
|
|
|
55
55
|
|
|
56
56
|
@property({ attribute: false })
|
|
57
57
|
buildingId = 0;
|
|
58
|
+
@property({ attribute: true })
|
|
59
|
+
buildingSlug = "";
|
|
60
|
+
@property({ attribute: true })
|
|
61
|
+
orgSlug = "";
|
|
58
62
|
|
|
59
63
|
phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
|
|
60
64
|
|
|
@@ -104,7 +108,12 @@ export class TextUsWindow extends LitElement {
|
|
|
104
108
|
}
|
|
105
109
|
try {
|
|
106
110
|
this.isSubmitting = true;
|
|
107
|
-
await createTextWithUs(
|
|
111
|
+
await createTextWithUs(
|
|
112
|
+
this.phoneNumber,
|
|
113
|
+
this.buildingId,
|
|
114
|
+
this.orgSlug,
|
|
115
|
+
this.buildingSlug
|
|
116
|
+
);
|
|
108
117
|
this.hasSubmittedForm = true;
|
|
109
118
|
this.isSubmitting = false;
|
|
110
119
|
} catch (e) {
|
|
@@ -203,7 +212,12 @@ export const installTextUsWindow = (): void => {
|
|
|
203
212
|
}
|
|
204
213
|
};
|
|
205
214
|
|
|
206
|
-
const createTextWithUs = async (
|
|
215
|
+
const createTextWithUs = async (
|
|
216
|
+
rawPhoneNumber: string,
|
|
217
|
+
buildingId: number,
|
|
218
|
+
orgSlug: string,
|
|
219
|
+
buildingSlug: string
|
|
220
|
+
) => {
|
|
207
221
|
const formattedPhoneNumber =
|
|
208
222
|
"+1" +
|
|
209
223
|
rawPhoneNumber
|
|
@@ -220,6 +234,12 @@ const createTextWithUs = async (rawPhoneNumber: string, buildingId: number) => {
|
|
|
220
234
|
await axios.post(
|
|
221
235
|
"https://app.meetelise.com/platformApi/state/create/textMe",
|
|
222
236
|
requestBody,
|
|
223
|
-
{
|
|
237
|
+
{
|
|
238
|
+
headers: {
|
|
239
|
+
["building-slug"]: buildingSlug,
|
|
240
|
+
["org-slug"]: orgSlug,
|
|
241
|
+
["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
|
|
242
|
+
},
|
|
243
|
+
}
|
|
224
244
|
);
|
|
225
245
|
};
|
|
@@ -292,6 +292,8 @@ export class MEChat extends LitElement {
|
|
|
292
292
|
phoneNumber="${this.building?.phoneNumber ?? ""}"
|
|
293
293
|
textColor="${this.theme.chatHeader.textColor}"
|
|
294
294
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
295
|
+
orgSlug="${this.orgSlug}"
|
|
296
|
+
buildingSlug="${this.buildingSlug}"
|
|
295
297
|
?hidden=${this.hideLauncher}
|
|
296
298
|
?hasCallUsEnabled=${!this.building?.chatWidgets
|
|
297
299
|
? true
|