@meetelise/chat 1.51.2 → 1.51.4
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/dist/src/analytics.d.ts +2 -1
- package/package.json +1 -1
- package/public/dist/index.js +46 -20
- package/src/MyPubnub.ts +6 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +1 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +8 -0
- package/src/WebComponent/actions/call-us-window.ts +2 -0
- package/src/WebComponent/actions/details-window.ts +2 -0
- package/src/WebComponent/actions/email-us-window.ts +2 -0
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +2 -0
- package/src/WebComponent/icons/ChatOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/ChevronLeftIcon.ts +1 -1
- package/src/WebComponent/icons/ChevronRightIcon.ts +1 -1
- package/src/WebComponent/icons/ContactResidentIcon.ts +1 -1
- package/src/WebComponent/icons/DollarOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/EmailOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +1 -1
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +1 -1
- package/src/WebComponent/icons/SendMessageIcon.ts +2 -2
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +2 -0
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +2 -0
- package/src/WebComponent/icons/TourWithAgentIcon.ts +2 -0
- package/src/WebComponent/icons/XOutlineIcon.ts +1 -1
- package/src/WebComponent/me-select.ts +2 -0
- package/src/WebComponent/simple-launcher/simple-launcher.ts +4 -0
- package/src/analytics.ts +4 -1
- package/src/fetchBuildingUnitsSummary.ts +1 -0
- package/src/getBuildingPhoneNumber.ts +1 -0
- package/src/insertDNIIntoWebsite.ts +1 -0
- package/src/services/fees/calculateQuote.ts +1 -0
- package/src/services/fees/downloadQuotePdf.ts +1 -0
- package/src/services/fees/fetchBuildingFees.ts +1 -0
- package/src/services/fees/fetchBuildingFeesV2.ts +1 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +1 -0
- package/src/services/fees/fetchBuildingUnits.ts +1 -0
- package/src/svgIcons.ts +2 -2
package/public/dist/index.js
CHANGED
|
@@ -633,6 +633,8 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
|
|
|
633
633
|
/>
|
|
634
634
|
|
|
635
635
|
<svg
|
|
636
|
+
aria-hidden="true"
|
|
637
|
+
focusable="false"
|
|
636
638
|
width="10"
|
|
637
639
|
height="6"
|
|
638
640
|
viewBox="0 0 10 6"
|
|
@@ -755,13 +757,13 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
|
|
|
755
757
|
.option.active {
|
|
756
758
|
background-color: var(--active-option-color);
|
|
757
759
|
}
|
|
758
|
-
`,Oe],Lr([ue({attribute:!1})],Ur.prototype,"options",void 0),Lr([ue({type:String})],Ur.prototype,"placeholder",void 0),Lr([ue({type:String})],Ur.prototype,"value",void 0),Lr([de()],Ur.prototype,"activeOption",void 0),Lr([de()],Ur.prototype,"isOpen",void 0),Lr([de()],Ur.prototype,"activeOptionIndex",void 0),Lr([de()],Ur.prototype,"searchTerm",void 0),Lr([ce("#select",!0)],Ur.prototype,"meSelect",void 0),Lr([ce("#selectText",!0)],Ur.prototype,"selectInput",void 0),Ur=Lr([se("me-select")],Ur),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(jr||(jr={}));var Fr=n(2013),Hr=n.n(Fr);function Gr(e){return ni(1,arguments),ii(e).getTime()<Date.now()}Math.pow(10,8);var zr=6e4,Qr=36e5;function Wr(e,t){ni(1,arguments);var n=t||{},i=null==n.additionalDigits?2:bi(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=function(e){var t,n={},i=e.split(Vr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Vr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Vr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Vr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(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)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(qr);if(!n)return new Date(NaN);var i=!!n[4],r=Xr(n[1]),o=Xr(n[2])-1,a=Xr(n[3]),s=Xr(n[4]),l=Xr(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Jr[t]||(eo(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(eo(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Yr);if(!t)return NaN;var n=Zr(t[1]),i=Zr(t[2]),r=Zr(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*Qr+i*zr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),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=function(e){if("Z"===e)return 0;var t=e.match(Kr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*Qr+r*zr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Vr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},qr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Kr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Xr(e){return e?parseInt(e):1}function Zr(e){return e&&parseFloat(e.replace(",","."))||0}var Jr=[31,null,31,30,31,30,31,31,30,31,30,31];function eo(e){return e%400==0||e%4==0&&e%100!=0}const to={buildingId:null,availabilities:{}},no=()=>{to.buildingId=null,to.availabilities={}},io=async e=>{e&&(to.buildingId=e);const t=to.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=to.availabilities;if(n[t])return n[t];const i=ir(Date.now()),o=Rr(function(e){ni(1,arguments);var t=ii(e);return t.setHours(23,59,59,999),t}(Br(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Rr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return to.availabilities[t]=s.data,s.data},ro=async(e,t)=>{var n,i;const r=await io(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},oo=async()=>{var e,t,n,i,r,o;return{[Ua.Guided]:!!(null===(t=null===(e=await ro(jr.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Ua.Self]:!!(null===(i=null===(n=await ro(jr.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Ua.Virtual]:!!(null===(o=null===(r=await ro(jr.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}},ao=async(e,t)=>{var n,i;const r=await ro(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter(e=>oi(Wr(e))&&!Gr(Wr(e))):[])||void 0===n?void 0:n.map(e=>so(e))};return Hr()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],e=>Zi(new Date(e.datetime),"yyyy-MM-dd"))},so=e=>({datetime:e.slice(0,19),offset:e.slice(19)});var lo=n(3916),uo=n.n(lo),co=n(2485),ho=n.n(co);const po=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var fo;async function go(e){if(!e)return!1;try{return(await r().get(po(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-applications-link-replacement",default_str:null,default_bool:!1}})).data}catch(e){return!1}}function mo(){return yo()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(fo||(fo={}));const yo=()=>(window.location.search.match(/\?/g)||[]).length>1,bo=[57,2575,2332],vo=["email","phone","firstName","lastName","message","tourDetails"];let wo=!1;const Co=(e,t={})=>{window.dataLayer=window.dataLayer||[];let n=t;if(wo){n={...t};for(const e of vo)delete n[e]}window.dataLayer.push({event:e,...n})};class xo extends me{constructor(e){if(super(e),this.it=F,e.type!==fe)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===F||null==e)return this.ft=void 0,this.it=e;if(e===j)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}xo.directiveName="unsafeHTML",xo.resultType=1;const $o=ge(xo),So=B`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
760
|
+
`,Oe],Lr([ue({attribute:!1})],Ur.prototype,"options",void 0),Lr([ue({type:String})],Ur.prototype,"placeholder",void 0),Lr([ue({type:String})],Ur.prototype,"value",void 0),Lr([de()],Ur.prototype,"activeOption",void 0),Lr([de()],Ur.prototype,"isOpen",void 0),Lr([de()],Ur.prototype,"activeOptionIndex",void 0),Lr([de()],Ur.prototype,"searchTerm",void 0),Lr([ce("#select",!0)],Ur.prototype,"meSelect",void 0),Lr([ce("#selectText",!0)],Ur.prototype,"selectInput",void 0),Ur=Lr([se("me-select")],Ur),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(jr||(jr={}));var Fr=n(2013),Hr=n.n(Fr);function Gr(e){return ni(1,arguments),ii(e).getTime()<Date.now()}Math.pow(10,8);var zr=6e4,Qr=36e5;function Wr(e,t){ni(1,arguments);var n=t||{},i=null==n.additionalDigits?2:bi(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=function(e){var t,n={},i=e.split(Vr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Vr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Vr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Vr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(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)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(qr);if(!n)return new Date(NaN);var i=!!n[4],r=Xr(n[1]),o=Xr(n[2])-1,a=Xr(n[3]),s=Xr(n[4]),l=Xr(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Jr[t]||(eo(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(eo(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Yr);if(!t)return NaN;var n=Zr(t[1]),i=Zr(t[2]),r=Zr(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*Qr+i*zr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),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=function(e){if("Z"===e)return 0;var t=e.match(Kr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*Qr+r*zr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Vr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},qr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Kr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Xr(e){return e?parseInt(e):1}function Zr(e){return e&&parseFloat(e.replace(",","."))||0}var Jr=[31,null,31,30,31,30,31,31,30,31,30,31];function eo(e){return e%400==0||e%4==0&&e%100!=0}const to={buildingId:null,availabilities:{}},no=()=>{to.buildingId=null,to.availabilities={}},io=async e=>{e&&(to.buildingId=e);const t=to.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=to.availabilities;if(n[t])return n[t];const i=ir(Date.now()),o=Rr(function(e){ni(1,arguments);var t=ii(e);return t.setHours(23,59,59,999),t}(Br(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Rr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return to.availabilities[t]=s.data,s.data},ro=async(e,t)=>{var n,i;const r=await io(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},oo=async()=>{var e,t,n,i,r,o;return{[Ua.Guided]:!!(null===(t=null===(e=await ro(jr.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Ua.Self]:!!(null===(i=null===(n=await ro(jr.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Ua.Virtual]:!!(null===(o=null===(r=await ro(jr.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}},ao=async(e,t)=>{var n,i;const r=await ro(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter(e=>oi(Wr(e))&&!Gr(Wr(e))):[])||void 0===n?void 0:n.map(e=>so(e))};return Hr()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],e=>Zi(new Date(e.datetime),"yyyy-MM-dd"))},so=e=>({datetime:e.slice(0,19),offset:e.slice(19)});var lo=n(3916),uo=n.n(lo),co=n(2485),ho=n.n(co);const po=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var fo;async function go(e){if(!e)return!1;try{return(await r().get(po(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-applications-link-replacement",default_str:null,default_bool:!1}})).data}catch(e){return!1}}function mo(){return yo()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(fo||(fo={}));const yo=()=>(window.location.search.match(/\?/g)||[]).length>1,bo=[57,2575,2332],vo=["email","phone","firstName","lastName","message","tourDetails"];let wo=!1;const Co=(e,t={})=>{window.dataLayer=window.dataLayer||[];let n=t;if(wo){n={...t};for(const e of vo)delete n[e]}window.dataLayer.push({event:e,...n})};class xo extends me{constructor(e){if(super(e),this.it=F,e.type!==fe)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===F||null==e)return this.ft=void 0,this.it=e;if(e===j)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}xo.directiveName="unsafeHTML",xo.resultType=1;const $o=ge(xo),So=B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
759
761
|
<rect x="1" y="1" width="22" height="22" stroke="black" stroke-width="2" rx="2"/>
|
|
760
762
|
</svg>
|
|
761
|
-
`,Ao=(B`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
|
|
763
|
+
`,Ao=(B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
|
|
762
764
|
<rect y="0.09375" width="16" height="16" rx="2" fill="#4719CD"/>
|
|
763
765
|
<path d="M12 5.09375L6.5 10.5938L4 8.09375" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
764
|
-
</svg>`,()=>B`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="25" viewBox="0 0 25 25" fill="none">
|
|
766
|
+
</svg>`,()=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="25" viewBox="0 0 25 25" fill="none">
|
|
765
767
|
<rect x="0.5" y="0.5" width="24" height="24" fill="url(#pattern0)"/>
|
|
766
768
|
<defs>
|
|
767
769
|
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
|
@@ -1478,7 +1480,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1478
1480
|
gap: 12px;
|
|
1479
1481
|
align-items: center;
|
|
1480
1482
|
}
|
|
1481
|
-
`;class Uo{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:Ro(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const Ro=()=>{var e,t,n,i,r,o;try{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,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Ir("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Ir("bozzuto_ad_source")}}};var Bo;!function(e){e.error="error",e.info="info",e.warn="warn"}(Bo||(Bo={}));const jo=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:i,logData:o})=>{await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:Bo.error,"log-title":i.toUpperCase().replace(/\s/g,"_")}})},Fo=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};var Ho=n(2193),Go=n.n(Ho);function zo(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const Qo=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.leadSourceParams=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=mo();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(Ro()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!Pr(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Wr(t.timestamp)}}}const a={leadSource:t,leadSourceParams:this.leadSourceParams,leadId:n,buildingSlug:e,timestamp:Rr(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Wr(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!Pr(Wr(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){const o={query_params:t,building_slug:e,referrer:n,campaign_sources:i};try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,o)).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let d=null,c=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(d=e),c=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:Go()(d)?null:d,extras:null!=c?c:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){var i,r,o;try{const a={queryParams:mo(),buildingSlug:n,referrer:document.referrer,campaignSources:Ro()};let s=!1;const l=n?this.getLeadSourceBodyIfValid(n):null;if(l){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=l.leadSource,this.leadSourceParams=null!==(r=l.leadSourceParams)&&void 0!==r?r:null,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(a);if(!e)return this.leadSource=l.leadSource,this.leadSourceParams=null!==(i=l.leadSourceParams)&&void 0!==i?i:null,this.leadSource;this.leadSource=e,s=!0}}const u=await this.fetchCurrentParsedLeadSource(a);if(this.leadSource=u,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!u){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSourceParams=null!==(o=e.leadSourceParams)&&void 0!==o?o:null,this.leadSource}if(n){const t=!!u&&u.length>0;this.updateLeadSourceLocalStorage(n,u,e,!t&&!s,s)}return u}catch(e){}return null}},Wo=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}};var Vo,qo,Yo;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Vo||(Vo={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(qo||(qo={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(Yo||(Yo={}));const Ko=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function Xo(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return Zo(i.data)}const Zo=e=>{var t;try{e.welcomeMessage=Jo(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},Jo=(e,t)=>e.replace(/elise/gi,t);var ea=n(7035),ta=n(6353);function na(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function ia(e,t){var n=function(e){if(!oa[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;oa[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return oa[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=ra[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var ra={year:0,month:1,day:2,hour:3,minute:4,second:5};var oa={};function aa(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var sa=36e5,la={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ua(e,t,n){var i,r,o;if(!e)return 0;if(i=la.timezoneZ.exec(e))return 0;if(i=la.timezoneHH.exec(e))return ca(o=parseInt(i[1],10))?-o*sa:NaN;if(i=la.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return ca(o,a)?(r=Math.abs(o)*sa+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(ha[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),ha[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return aa(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=da(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=da(new Date(r),n);if(t===o)return t;r-=o-t;var a=da(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function da(e,t){var n=ia(e,t),i=aa(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function ca(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var ha={};var pa={X:function(e,t,n,i){var r=fa(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return ya(r);case"XXXX":case"XX":return ma(r);default:return ma(r,":")}},x:function(e,t,n,i){var r=fa(i.timeZone,e);switch(t){case"x":return ya(r);case"xxxx":case"xx":return ma(r);default:return ma(r,":")}},O:function(e,t,n,i){var r=fa(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+ga(o,2)}(r,":");default:return"GMT"+ma(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return na("short",e,i);default:return na("long",e,i)}}};function fa(e,t){var n=e?ua(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ga(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function ma(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+ga(Math.floor(r/60),2)+n+ga(Math.floor(r%60),2)}function ya(e,t){return e%60==0?(e>0?"-":"+")+ga(Math.abs(e)/60,2):ma(e,t)}const ba=pa;var va=n(9784),wa=n(9720);var Ca=36e5,xa=6e4,$a={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Sa(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:va(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=$a.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=$a.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=$a.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=$a.YYY[t],r=$a.YYYYY[t];if(n=$a.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=$a.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=$a.MM.exec(e))return i=new Date(0),_a(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=$a.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=ka(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=$a.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return _a(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=$a.Www.exec(e))return Oa(t,o=parseInt(n[1],10)-1)?Aa(t,o):new Date(NaN);if(n=$a.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Oa(t,o,l)?Aa(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=$a.HH.exec(e))return Pa(n=parseFloat(t[1].replace(",",".")))?n%24*Ca:NaN;if(t=$a.HHMM.exec(e))return Pa(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*Ca+i*xa:NaN;if(t=$a.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Pa(n,i,r)?n%24*Ca+i*xa+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=ua(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=wa(new Date(u+d)),l=wa(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function Aa(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Ea=[31,28,31,30,31,30,31,31,30,31,30,31],Ta=[31,29,31,30,31,30,31,31,30,31,30,31];function ka(e){return e%400==0||e%4==0&&e%100!=0}function _a(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=ka(e);if(i&&n>Ta[t])return!1;if(!i&&n>Ea[t])return!1}return!0}function Oa(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function Pa(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var Ia=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Na(e,t,n,i){var r=ea(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(Ia);if(o){var a=Sa(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+ba[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return ta(e,i,r)}(function(e,t,n){var i=Sa(e,n),r=ua(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const Ma=async({buildingSlug:e})=>{try{const t=await r().get(`${$r}/platformApi/webchat/${e}/units/summary`);if(t.data)return Ar(t.data)}catch(t){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t}})}return[]};var Da=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 La=class extends oe{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.tourType=null,this.shouldShowTourType={[Ua.Guided]:!0,[Ua.Self]:!0,[Ua.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=qn,this.backgroundColor=Yn,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([Wo(this.buildingId,this.hasDynamicSchedulingEnabled),oo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await io(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),jo({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:Bo.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void jo({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[Ua.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[Ua.Guided]||!!this.escortedToursLink),[Ua.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[Ua.Self]||!!this.sgtUrl),[Ua.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[Ua.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await ao(Ra[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,jo({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await io(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return rr("string"==typeof e?Wr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==jr.Unknown&&a!==jr.MediaTour&&(this.selectedDate=ir("string"==typeof l?Wr(l):l),this.tourType=Ba[a],this.selectedTime="string"==typeof l?so(l):(e=>({datetime:Zi(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:Zi(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===jr.Unknown||e.tourType===jr.MediaTour)return!1;const t=Ba[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!Ko(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===Ua.Guided?this.escortedToursTypeOffered:e===Ua.Self?this.selfGuidedToursTypeOffered:e===Ua.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>Fa(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await Ma({buildingSlug:this.buildingSlug})}catch(e){this.units=[],jo({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{try{await io(this.buildingId)}catch(e){}await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await io(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Co("tourBuildingSelected",{buildingId:n.building_id});try{const e=await Xo(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await ao(Ra[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},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,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Nr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164}},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,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const S=this.phoneNumberE164;if(!S)return void(this.phoneNumberIsValid=!1);const A=new URLSearchParams(window.location.search);let E=null;E=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const T=[...new Set(E?[E,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=E;const k=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,_=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Co("scheduleTourSubmitted",{email:this.email,phone:S,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:ja[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:T.find(e=>"property-website"!==e)||null,layout:k,unit:_,conversationTrackingId:null!==(l=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==l?l:null});const O={referrer:document.referrer,email_address:this.email,phone_number:S,building_id:this.buildingId,first_name:null!==(d=null===(u=this.firstNameInput)||void 0===u?void 0:u.value)&&void 0!==d?d:this.firstNameInputValue,last_name:null!==(h=null===(c=this.lastNameInput)||void 0===c?void 0:c.value)&&void 0!==h?h:this.lastNameInputValue,tour_type:ja[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(E?[E,zo(this.orgSlug)]:[zo(this.orgSlug)])],query_params:Object.fromEntries(A.entries()),conversation_tracking_id:null===(p=this.leadSourceClient)||void 0===p?void 0:p.chatId,layouts:k?[k]:void 0,unit_numbers:_?[_]:void 0,lead_sources_with_timestamps:(null!==(m=null===(f=this.leadSourceMultitouchClient)||void 0===f?void 0:f.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(g=this.selectedLeadSource)||void 0===g?void 0:g.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==m?m:[]).map(e=>Er({...e}))};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",O,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(b=this.leadSourceClient)||void 0===b||b.resetLeadSource(),null===(v=this.leadSourceMultitouchClient)||void 0===v||v.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(C=null===(w=t.response)||void 0===w?void 0:w.data)||void 0===C?void 0:C.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[Zi(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[Zi(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===(x=t.response)||void 0===x?void 0:x.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,no(),this.availabilitiesGroupedByDay=await ao(Ra[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>R`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>R`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>R` <action-confirm-button
|
|
1483
|
+
`;class Uo{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:Ro(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const Ro=()=>{var e,t,n,i,r,o;try{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,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Ir("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Ir("bozzuto_ad_source")}}};var Bo;!function(e){e.error="error",e.info="info",e.warn="warn"}(Bo||(Bo={}));const jo=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:o,logData:a,error:s})=>{var l;if(s instanceof i.AxiosError&&403===(null===(l=s.response)||void 0===l?void 0:l.status))return;await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...a},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:Bo.error,"log-title":o.toUpperCase().replace(/\s/g,"_")}})},Fo=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};var Ho=n(2193),Go=n.n(Ho);function zo(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const Qo=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.leadSourceParams=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=mo();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(Ro()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!Pr(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Wr(t.timestamp)}}}const a={leadSource:t,leadSourceParams:this.leadSourceParams,leadId:n,buildingSlug:e,timestamp:Rr(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Wr(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!Pr(Wr(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){const o={query_params:t,building_slug:e,referrer:n,campaign_sources:i};try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,o)).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let d=null,c=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(d=e),c=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:Go()(d)?null:d,extras:null!=c?c:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){var i,r,o;try{const a={queryParams:mo(),buildingSlug:n,referrer:document.referrer,campaignSources:Ro()};let s=!1;const l=n?this.getLeadSourceBodyIfValid(n):null;if(l){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=l.leadSource,this.leadSourceParams=null!==(r=l.leadSourceParams)&&void 0!==r?r:null,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(a);if(!e)return this.leadSource=l.leadSource,this.leadSourceParams=null!==(i=l.leadSourceParams)&&void 0!==i?i:null,this.leadSource;this.leadSource=e,s=!0}}const u=await this.fetchCurrentParsedLeadSource(a);if(this.leadSource=u,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!u){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSourceParams=null!==(o=e.leadSourceParams)&&void 0!==o?o:null,this.leadSource}if(n){const t=!!u&&u.length>0;this.updateLeadSourceLocalStorage(n,u,e,!t&&!s,s)}return u}catch(e){}return null}},Wo=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}};var Vo,qo,Yo;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Vo||(Vo={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(qo||(qo={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(Yo||(Yo={}));const Ko=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function Xo(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return Zo(i.data)}const Zo=e=>{var t;try{e.welcomeMessage=Jo(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},Jo=(e,t)=>e.replace(/elise/gi,t);var ea=n(7035),ta=n(6353);function na(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function ia(e,t){var n=function(e){if(!oa[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;oa[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return oa[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=ra[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var ra={year:0,month:1,day:2,hour:3,minute:4,second:5};var oa={};function aa(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var sa=36e5,la={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ua(e,t,n){var i,r,o;if(!e)return 0;if(i=la.timezoneZ.exec(e))return 0;if(i=la.timezoneHH.exec(e))return ca(o=parseInt(i[1],10))?-o*sa:NaN;if(i=la.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return ca(o,a)?(r=Math.abs(o)*sa+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(ha[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),ha[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return aa(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=da(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=da(new Date(r),n);if(t===o)return t;r-=o-t;var a=da(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function da(e,t){var n=ia(e,t),i=aa(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function ca(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var ha={};var pa={X:function(e,t,n,i){var r=fa(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return ya(r);case"XXXX":case"XX":return ma(r);default:return ma(r,":")}},x:function(e,t,n,i){var r=fa(i.timeZone,e);switch(t){case"x":return ya(r);case"xxxx":case"xx":return ma(r);default:return ma(r,":")}},O:function(e,t,n,i){var r=fa(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+ga(o,2)}(r,":");default:return"GMT"+ma(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return na("short",e,i);default:return na("long",e,i)}}};function fa(e,t){var n=e?ua(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ga(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function ma(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+ga(Math.floor(r/60),2)+n+ga(Math.floor(r%60),2)}function ya(e,t){return e%60==0?(e>0?"-":"+")+ga(Math.abs(e)/60,2):ma(e,t)}const ba=pa;var va=n(9784),wa=n(9720);var Ca=36e5,xa=6e4,$a={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Sa(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:va(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=$a.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=$a.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=$a.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=$a.YYY[t],r=$a.YYYYY[t];if(n=$a.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=$a.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=$a.MM.exec(e))return i=new Date(0),_a(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=$a.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=ka(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=$a.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return _a(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=$a.Www.exec(e))return Oa(t,o=parseInt(n[1],10)-1)?Aa(t,o):new Date(NaN);if(n=$a.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Oa(t,o,l)?Aa(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=$a.HH.exec(e))return Pa(n=parseFloat(t[1].replace(",",".")))?n%24*Ca:NaN;if(t=$a.HHMM.exec(e))return Pa(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*Ca+i*xa:NaN;if(t=$a.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Pa(n,i,r)?n%24*Ca+i*xa+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=ua(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=wa(new Date(u+d)),l=wa(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function Aa(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Ea=[31,28,31,30,31,30,31,31,30,31,30,31],Ta=[31,29,31,30,31,30,31,31,30,31,30,31];function ka(e){return e%400==0||e%4==0&&e%100!=0}function _a(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=ka(e);if(i&&n>Ta[t])return!1;if(!i&&n>Ea[t])return!1}return!0}function Oa(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function Pa(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var Ia=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Na(e,t,n,i){var r=ea(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(Ia);if(o){var a=Sa(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+ba[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return ta(e,i,r)}(function(e,t,n){var i=Sa(e,n),r=ua(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const Ma=async({buildingSlug:e})=>{try{const t=await r().get(`${$r}/platformApi/webchat/${e}/units/summary`);if(t.data)return Ar(t.data)}catch(t){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var Da=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 La=class extends oe{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.tourType=null,this.shouldShowTourType={[Ua.Guided]:!0,[Ua.Self]:!0,[Ua.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=qn,this.backgroundColor=Yn,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([Wo(this.buildingId,this.hasDynamicSchedulingEnabled),oo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await io(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),jo({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:Bo.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void jo({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[Ua.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[Ua.Guided]||!!this.escortedToursLink),[Ua.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[Ua.Self]||!!this.sgtUrl),[Ua.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[Ua.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await ao(Ra[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,jo({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await io(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return rr("string"==typeof e?Wr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==jr.Unknown&&a!==jr.MediaTour&&(this.selectedDate=ir("string"==typeof l?Wr(l):l),this.tourType=Ba[a],this.selectedTime="string"==typeof l?so(l):(e=>({datetime:Zi(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:Zi(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===jr.Unknown||e.tourType===jr.MediaTour)return!1;const t=Ba[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!Ko(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===Ua.Guided?this.escortedToursTypeOffered:e===Ua.Self?this.selfGuidedToursTypeOffered:e===Ua.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>Fa(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await Ma({buildingSlug:this.buildingSlug})}catch(e){this.units=[],jo({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{try{await io(this.buildingId)}catch(e){}await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await io(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Co("tourBuildingSelected",{buildingId:n.building_id});try{const e=await Xo(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await ao(Ra[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},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,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Nr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164}},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,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const S=this.phoneNumberE164;if(!S)return void(this.phoneNumberIsValid=!1);const A=new URLSearchParams(window.location.search);let E=null;E=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const T=[...new Set(E?[E,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=E;const k=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,_=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Co("scheduleTourSubmitted",{email:this.email,phone:S,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:ja[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:T.find(e=>"property-website"!==e)||null,layout:k,unit:_,conversationTrackingId:null!==(l=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==l?l:null});const O={referrer:document.referrer,email_address:this.email,phone_number:S,building_id:this.buildingId,first_name:null!==(d=null===(u=this.firstNameInput)||void 0===u?void 0:u.value)&&void 0!==d?d:this.firstNameInputValue,last_name:null!==(h=null===(c=this.lastNameInput)||void 0===c?void 0:c.value)&&void 0!==h?h:this.lastNameInputValue,tour_type:ja[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(E?[E,zo(this.orgSlug)]:[zo(this.orgSlug)])],query_params:Object.fromEntries(A.entries()),conversation_tracking_id:null===(p=this.leadSourceClient)||void 0===p?void 0:p.chatId,layouts:k?[k]:void 0,unit_numbers:_?[_]:void 0,lead_sources_with_timestamps:(null!==(m=null===(f=this.leadSourceMultitouchClient)||void 0===f?void 0:f.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(g=this.selectedLeadSource)||void 0===g?void 0:g.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==m?m:[]).map(e=>Er({...e}))};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",O,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(b=this.leadSourceClient)||void 0===b||b.resetLeadSource(),null===(v=this.leadSourceMultitouchClient)||void 0===v||v.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(C=null===(w=t.response)||void 0===w?void 0:w.data)||void 0===C?void 0:C.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[Zi(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[Zi(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===(x=t.response)||void 0===x?void 0:x.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,no(),this.availabilitiesGroupedByDay=await ao(Ra[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>R`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>R`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>R` <action-confirm-button
|
|
1482
1484
|
id="schedule-bttn"
|
|
1483
1485
|
.onClick=${this.submit}
|
|
1484
1486
|
.isLoading=${this.isSubmitting}
|
|
@@ -1511,6 +1513,8 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1511
1513
|
?selected="${this.tourType===Ua.Self}"
|
|
1512
1514
|
>
|
|
1513
1515
|
${((e="black")=>B`<svg
|
|
1516
|
+
aria-hidden="true"
|
|
1517
|
+
focusable="false"
|
|
1514
1518
|
slot="icon"
|
|
1515
1519
|
width="28"
|
|
1516
1520
|
height="31"
|
|
@@ -1536,6 +1540,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1536
1540
|
?selected="${this.tourType===Ua.Guided}"
|
|
1537
1541
|
>
|
|
1538
1542
|
${((e="black")=>B`<svg
|
|
1543
|
+
aria-hidden="true"
|
|
1544
|
+
focusable="false"
|
|
1539
1545
|
slot="icon"
|
|
1540
1546
|
width="31"
|
|
1541
1547
|
height="31"
|
|
@@ -1559,6 +1565,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1559
1565
|
?selected="${this.tourType===Ua.Virtual}"
|
|
1560
1566
|
>
|
|
1561
1567
|
${((e="black")=>B`<svg
|
|
1568
|
+
aria-hidden="true"
|
|
1569
|
+
focusable="false"
|
|
1562
1570
|
slot="icon"
|
|
1563
1571
|
width="26"
|
|
1564
1572
|
height="25"
|
|
@@ -1604,6 +1612,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1604
1612
|
aria-label="Close scheduler"
|
|
1605
1613
|
>
|
|
1606
1614
|
<svg
|
|
1615
|
+
aria-hidden="true"
|
|
1616
|
+
focusable="false"
|
|
1607
1617
|
width="19"
|
|
1608
1618
|
height="19"
|
|
1609
1619
|
viewBox="0 0 19 19"
|
|
@@ -1698,6 +1708,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1698
1708
|
</div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return R``;const e=Na(Wr(`${this.selectedTime.datetime}${this.selectedTime.offset}`),this.calendarTimeZone,"MMM d 'at' h:mmaaa");return this.canceledReschedule?R`
|
|
1699
1709
|
<div id="confirmationMessage">
|
|
1700
1710
|
<svg
|
|
1711
|
+
aria-hidden="true"
|
|
1712
|
+
focusable="false"
|
|
1701
1713
|
width="20"
|
|
1702
1714
|
height="20"
|
|
1703
1715
|
viewBox="0 0 20 20"
|
|
@@ -1741,6 +1753,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1741
1753
|
<p>You can make changes at any time, just reply to the email.</p>
|
|
1742
1754
|
</div>
|
|
1743
1755
|
`}loadingIcon(e=21){return R` <svg
|
|
1756
|
+
aria-hidden="true"
|
|
1757
|
+
focusable="false"
|
|
1744
1758
|
id="loadingIcon"
|
|
1745
1759
|
width=${e}
|
|
1746
1760
|
height=${e}
|
|
@@ -2819,6 +2833,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2819
2833
|
aria-label="Close"
|
|
2820
2834
|
>
|
|
2821
2835
|
<svg
|
|
2836
|
+
aria-hidden="true"
|
|
2837
|
+
focusable="false"
|
|
2822
2838
|
width="19"
|
|
2823
2839
|
height="19"
|
|
2824
2840
|
viewBox="0 0 19 19"
|
|
@@ -2922,6 +2938,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2922
2938
|
<div class="email-us__vertical-spacer"></div>
|
|
2923
2939
|
<div class="email-us__center_icon">
|
|
2924
2940
|
<svg
|
|
2941
|
+
aria-hidden="true"
|
|
2942
|
+
focusable="false"
|
|
2925
2943
|
width="22"
|
|
2926
2944
|
height="18"
|
|
2927
2945
|
viewBox="0 0 22 18"
|
|
@@ -3102,7 +3120,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3102
3120
|
width: 50%;
|
|
3103
3121
|
}
|
|
3104
3122
|
}
|
|
3105
|
-
`,Oe],Xa([ue({attribute:!1})],Za.prototype,"leadSources",void 0),Xa([ue({attribute:!1})],Za.prototype,"onCloseClicked",void 0),Xa([ue({attribute:!0})],Za.prototype,"chatId",void 0),Xa([ue({attribute:!1})],Za.prototype,"buildingId",void 0),Xa([ue({attribute:!0})],Za.prototype,"buildingSlug",void 0),Xa([ue({attribute:!0})],Za.prototype,"orgSlug",void 0),Xa([ue({attribute:!0})],Za.prototype,"buildingName",void 0),Xa([ue({attribute:!0})],Za.prototype,"orgLegalName",void 0),Xa([ue({attribute:!1})],Za.prototype,"country",void 0),Xa([ue({attribute:!0})],Za.prototype,"leadSourceClient",void 0),Xa([ue({attribute:!0})],Za.prototype,"leadSourceMultitouchClient",void 0),Xa([ue({attribute:!0})],Za.prototype,"featureFlagShowDropdown",void 0),Xa([ue()],Za.prototype,"privatePolicyUrl",void 0),Xa([ue()],Za.prototype,"termsOfServiceUrl",void 0),Xa([de()],Za.prototype,"firstName",void 0),Xa([de()],Za.prototype,"lastName",void 0),Xa([de()],Za.prototype,"email",void 0),Xa([de()],Za.prototype,"phoneNumber",void 0),Xa([de()],Za.prototype,"phoneNumberE164",void 0),Xa([de()],Za.prototype,"phoneCountry",void 0),Xa([de()],Za.prototype,"message",void 0),Xa([ce("me-select#leadSource")],Za.prototype,"selectedLeadSource",void 0),Xa([ue({attribute:!0})],Za.prototype,"currentLeadSource",void 0),Xa([de()],Za.prototype,"hasNameError",void 0),Xa([de()],Za.prototype,"hasEmailError",void 0),Xa([de()],Za.prototype,"hasPhoneNumberError",void 0),Xa([de()],Za.prototype,"hasMessageError",void 0),Xa([de()],Za.prototype,"hasSubmittedForm",void 0),Xa([de()],Za.prototype,"windowHeight",void 0),Xa([de()],Za.prototype,"hasSubmissionError",void 0),Xa([de()],Za.prototype,"isSubmitting",void 0),Za=Xa([se("email-us-window")],Za);const Ja=async(e,t,n,i,o,a,s,l,u,d,c)=>{const h=new URLSearchParams(window.location.search),p={email_address:n,building_id:a,lead_sources:u,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(h.entries()),conversation_tracking_id:d,lead_sources_with_timestamps:(null!=c?c:[]).map(e=>Er({...e}))};Co("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:u.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=d?d:null}),await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",p,{headers:{"building-slug":l,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},es=(e="white")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
3123
|
+
`,Oe],Xa([ue({attribute:!1})],Za.prototype,"leadSources",void 0),Xa([ue({attribute:!1})],Za.prototype,"onCloseClicked",void 0),Xa([ue({attribute:!0})],Za.prototype,"chatId",void 0),Xa([ue({attribute:!1})],Za.prototype,"buildingId",void 0),Xa([ue({attribute:!0})],Za.prototype,"buildingSlug",void 0),Xa([ue({attribute:!0})],Za.prototype,"orgSlug",void 0),Xa([ue({attribute:!0})],Za.prototype,"buildingName",void 0),Xa([ue({attribute:!0})],Za.prototype,"orgLegalName",void 0),Xa([ue({attribute:!1})],Za.prototype,"country",void 0),Xa([ue({attribute:!0})],Za.prototype,"leadSourceClient",void 0),Xa([ue({attribute:!0})],Za.prototype,"leadSourceMultitouchClient",void 0),Xa([ue({attribute:!0})],Za.prototype,"featureFlagShowDropdown",void 0),Xa([ue()],Za.prototype,"privatePolicyUrl",void 0),Xa([ue()],Za.prototype,"termsOfServiceUrl",void 0),Xa([de()],Za.prototype,"firstName",void 0),Xa([de()],Za.prototype,"lastName",void 0),Xa([de()],Za.prototype,"email",void 0),Xa([de()],Za.prototype,"phoneNumber",void 0),Xa([de()],Za.prototype,"phoneNumberE164",void 0),Xa([de()],Za.prototype,"phoneCountry",void 0),Xa([de()],Za.prototype,"message",void 0),Xa([ce("me-select#leadSource")],Za.prototype,"selectedLeadSource",void 0),Xa([ue({attribute:!0})],Za.prototype,"currentLeadSource",void 0),Xa([de()],Za.prototype,"hasNameError",void 0),Xa([de()],Za.prototype,"hasEmailError",void 0),Xa([de()],Za.prototype,"hasPhoneNumberError",void 0),Xa([de()],Za.prototype,"hasMessageError",void 0),Xa([de()],Za.prototype,"hasSubmittedForm",void 0),Xa([de()],Za.prototype,"windowHeight",void 0),Xa([de()],Za.prototype,"hasSubmissionError",void 0),Xa([de()],Za.prototype,"isSubmitting",void 0),Za=Xa([se("email-us-window")],Za);const Ja=async(e,t,n,i,o,a,s,l,u,d,c)=>{const h=new URLSearchParams(window.location.search),p={email_address:n,building_id:a,lead_sources:u,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(h.entries()),conversation_tracking_id:d,lead_sources_with_timestamps:(null!=c?c:[]).map(e=>Er({...e}))};Co("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:u.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=d?d:null}),await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",p,{headers:{"building-slug":l,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},es=(e="white")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
3106
3124
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.95487 2.54301e-07H7.04513C8.51534 -1.22821e-05 9.67985 -2.22686e-05 10.5912 0.121084C11.5292 0.24572 12.2883 0.508324 12.887 1.10005C13.4857 1.69178 13.7514 2.44211 13.8775 3.36914C14 4.26992 14 5.42089 14 6.874V10.126C14 11.5791 14 12.7301 13.8775 13.6309C13.7514 14.5579 13.4857 15.3082 12.887 15.8999C12.2883 16.4917 11.5292 16.7543 10.5912 16.8789C9.67985 17 8.51534 17 7.04513 17H6.95487C5.48466 17 4.32015 17 3.40878 16.8789C2.47084 16.7543 1.71169 16.4917 1.11299 15.8999C0.514304 15.3082 0.248611 14.5579 0.122508 13.6309C-2.25306e-05 12.7301 -1.24266e-05 11.5791 2.57292e-07 10.126V6.87399C-1.24266e-05 5.42088 -2.25306e-05 4.26992 0.122508 3.36914C0.248611 2.44211 0.514304 1.69178 1.11299 1.10005C1.71169 0.508324 2.47084 0.24572 3.40878 0.121084C4.32015 -2.22686e-05 5.48466 -1.22821e-05 6.95487 2.54301e-07ZM2.85118 1.44157C2.45996 1.55714 2.18378 1.71904 1.96152 1.93871C1.62295 2.27335 1.42002 2.73167 1.31181 3.52718C1.20127 4.33975 1.2 5.41089 1.2 6.9186V10.0814C1.2 11.5891 1.20127 12.6602 1.31181 13.4728C1.42002 14.2683 1.62295 14.7267 1.96152 15.0613C2.30009 15.3959 2.76381 15.5965 3.56868 15.7034C4.39081 15.8127 5.47454 15.814 7 15.814C8.52546 15.814 9.60919 15.8127 10.4313 15.7034C11.2362 15.5965 11.6999 15.3959 12.0385 15.0613C12.377 14.7267 12.58 14.2683 12.6882 13.4728C12.7987 12.6602 12.8 11.5891 12.8 10.0814V6.9186C12.8 5.41089 12.7987 4.33975 12.6882 3.52718C12.58 2.73167 12.377 2.27335 12.0385 1.93871C11.8162 1.71905 11.54 1.55714 11.1488 1.44157C10.6194 2.22728 10.2493 2.77349 9.69896 3.1115C9.58916 3.17894 9.47507 3.23928 9.3574 3.29217C8.76366 3.55903 8.09363 3.55868 7.12834 3.55818C7.08613 3.55816 7.04336 3.55814 7 3.55814C6.95664 3.55814 6.91387 3.55816 6.87166 3.55818C5.90637 3.55868 5.23634 3.55903 4.6426 3.29217C4.52493 3.23928 4.41084 3.17894 4.30104 3.1115C3.75069 2.77349 3.38057 2.22729 2.85118 1.44157ZM4.16103 1.2383C4.51629 1.74715 4.70232 1.96157 4.9344 2.10411C5.00028 2.14457 5.06873 2.18078 5.13933 2.21251C5.46646 2.35954 5.85406 2.37209 7 2.37209C8.14594 2.37209 8.53354 2.35954 8.86066 2.21251C8.93127 2.18078 8.99972 2.14457 9.0656 2.10411C9.29768 1.96157 9.48371 1.74715 9.83897 1.2383C9.10278 1.18681 8.18457 1.18605 7 1.18605C5.81543 1.18605 4.89722 1.18681 4.16103 1.2383ZM4 14.0349C4 13.7074 4.26863 13.4419 4.6 13.4419H9.4C9.73137 13.4419 10 13.7074 10 14.0349C10 14.3624 9.73137 14.6279 9.4 14.6279H4.6C4.26863 14.6279 4 14.3624 4 14.0349Z" fill="${e}"/>
|
|
3107
3125
|
</svg>`,ts={},ns=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],is=async e=>{const t=await(async e=>{if(ts[e])return ts[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return ts[e]=n.data,n.data})(e);return ns.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var rs=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 os=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.country=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Ee(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await is(this.buildingId))},this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return R`<a href="tel:${i}"
|
|
3108
3126
|
>${e}</a
|
|
@@ -3196,6 +3214,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3196
3214
|
<div id="text-us-container-focus" class="text-us-wrapper">
|
|
3197
3215
|
<div class="text-us-window__vertical-spacer"></div>
|
|
3198
3216
|
<svg
|
|
3217
|
+
aria-hidden="true"
|
|
3218
|
+
focusable="false"
|
|
3199
3219
|
width="20"
|
|
3200
3220
|
height="20"
|
|
3201
3221
|
viewBox="0 0 20 20"
|
|
@@ -3669,11 +3689,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3669
3689
|
margin: 2px 0;
|
|
3670
3690
|
}
|
|
3671
3691
|
}
|
|
3672
|
-
`;class ls{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class us{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new ls(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new ls(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new ls(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var ds,cs;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(ds||(ds={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(cs||(cs={}));class hs{constructor(e={}){var t,n,i,r,o,a,s,l,u;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(r=e.frequency)&&void 0!==r?r:ds.ONE_TIME,this.category=null!==(o=e.category)&&void 0!==o?o:cs.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(a=e.refundable)&&void 0!==a&&a,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(s=e.public_facing)||void 0===s||s,this.per_applicant=null!==(l=e.per_applicant)&&void 0!==l&&l,this.required_for_quotes=null!==(u=e.required_for_quotes)&&void 0!==u&&u,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const ps=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},fs=$r,gs=e=>new hs(e),ms=e=>new us(e),ys=async(e,t)=>{try{const n=(new ps).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${fs}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Ar(i.data);return{fees:e.fees.map(gs),rentableItems:e.rentableItems.map(ms),buildingIncentives:e.buildingIncentives}}}catch(t){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t}})}return{fees:[],rentableItems:[],buildingIncentives:[]}},bs=-1,vs=$r,ws=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${vs}/platformApi/webchat/${e}/quote/calculate`,Er({unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a}),{signal:s});if(l.data){return Ar(l.data)}}catch(t){"ERR_CANCELED"!==t.code&&jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t}})}return{quote:{}}},Cs=(e="black")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
|
|
3692
|
+
`;class ls{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class us{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new ls(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new ls(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new ls(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var ds,cs;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(ds||(ds={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(cs||(cs={}));class hs{constructor(e={}){var t,n,i,r,o,a,s,l,u;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(r=e.frequency)&&void 0!==r?r:ds.ONE_TIME,this.category=null!==(o=e.category)&&void 0!==o?o:cs.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(a=e.refundable)&&void 0!==a&&a,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(s=e.public_facing)||void 0===s||s,this.per_applicant=null!==(l=e.per_applicant)&&void 0!==l&&l,this.required_for_quotes=null!==(u=e.required_for_quotes)&&void 0!==u&&u,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const ps=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},fs=$r,gs=e=>new hs(e),ms=e=>new us(e),ys=async(e,t)=>{try{const n=(new ps).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${fs}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Ar(i.data);return{fees:e.fees.map(gs),rentableItems:e.rentableItems.map(ms),buildingIncentives:e.buildingIncentives}}}catch(t){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},bs=-1,vs=$r,ws=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${vs}/platformApi/webchat/${e}/quote/calculate`,Er({unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a}),{signal:s});if(l.data){return Ar(l.data)}}catch(t){"ERR_CANCELED"!==t.code&&jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t},error:t})}return{quote:{}}},Cs=(e="black")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
|
|
3673
3693
|
<line x1="1.70782" y1="13.2254" x2="13.2376" y2="1.69554" stroke="${e}" stroke-width="2.13401"/>
|
|
3674
3694
|
<path d="M2.00929 1.99996L13.3328 13.3421" stroke="${e}" stroke-width="2.13401"/>
|
|
3675
|
-
</svg>`,xs=$r,$s=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new ps;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",null==n?void 0:n.toString()),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${xs}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Ar(s.data);return o=e.map(e=>({...e,id:parseInt(e.id.toString().substring(1))})),[...o].sort((e,t)=>e.startingPrice-t.startingPrice||e.id-t.id)}}catch(r){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}}})}var o;return[]},Ss=({color:e="#347FF7",size:t=24}={})=>B`
|
|
3676
|
-
<svg width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3695
|
+
</svg>`,xs=$r,$s=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new ps;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",null==n?void 0:n.toString()),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${xs}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Ar(s.data);return o=e.map(e=>({...e,id:parseInt(e.id.toString().substring(1))})),[...o].sort((e,t)=>e.startingPrice-t.startingPrice||e.id-t.id)}}catch(r){jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}},error:r})}var o;return[]},Ss=({color:e="#347FF7",size:t=24}={})=>B`
|
|
3696
|
+
<svg aria-hidden="true" focusable="false" width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3677
3697
|
<g id="Frame" clip-path="url(#clip0_18718_332018)">
|
|
3678
3698
|
<path id="Vector" d="M3 12.5C3 13.6819 3.23279 14.8522 3.68508 15.9442C4.13738 17.0361 4.80031 18.0282 5.63604 18.864C6.47177 19.6997 7.46392 20.3626 8.55585 20.8149C9.64778 21.2672 10.8181 21.5 12 21.5C13.1819 21.5 14.3522 21.2672 15.4442 20.8149C16.5361 20.3626 17.5282 19.6997 18.364 18.864C19.1997 18.0282 19.8626 17.0361 20.3149 15.9442C20.7672 14.8522 21 13.6819 21 12.5C21 11.3181 20.7672 10.1478 20.3149 9.05585C19.8626 7.96392 19.1997 6.97177 18.364 6.13604C17.5282 5.30031 16.5361 4.63738 15.4442 4.18508C14.3522 3.73279 13.1819 3.5 12 3.5C10.8181 3.5 9.64778 3.73279 8.55585 4.18508C7.46392 4.63738 6.47177 5.30031 5.63604 6.13604C4.80031 6.97177 4.13738 7.96392 3.68508 9.05585C3.23279 10.1478 3 11.3181 3 12.5Z" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3679
3699
|
<path id="Vector_2" d="M14.8 9.50016C14.6188 9.18592 14.3557 8.92686 14.0386 8.75071C13.7215 8.57456 13.3625 8.48795 13 8.50016H11C10.4696 8.50016 9.96086 8.71087 9.58579 9.08594C9.21071 9.46102 9 9.96972 9 10.5002C9 11.0306 9.21071 11.5393 9.58579 11.9144C9.96086 12.2894 10.4696 12.5002 11 12.5002H13C13.5304 12.5002 14.0391 12.7109 14.4142 13.0859C14.7893 13.461 15 13.9697 15 14.5002C15 15.0306 14.7893 15.5393 14.4142 15.9144C14.0391 16.2894 13.5304 16.5002 13 16.5002H11C10.6375 16.5124 10.2785 16.4258 9.96142 16.2496C9.64435 16.0735 9.38115 15.8144 9.2 15.5002" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -5184,7 +5204,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5184
5204
|
</p>
|
|
5185
5205
|
</div>
|
|
5186
5206
|
</div>
|
|
5187
|
-
`:R``}};wl.styles=bl,vl([ue({type:Object})],wl.prototype,"incentive",void 0),wl=vl([se("incentive-banner")],wl);var Cl=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 xl=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=qn,this.backgroundColor=Yn,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[bs],this.selectedUnit=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.desiredRentableItems=[],this.moveInDateString=Sr.toISOString().split("T")[0],this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.groupedFees={[ds.ONE_TIME]:[],[ds.MONTHLY]:[],[ds.WEEKLY]:[],[ds.BI_WEEKLY]:[],[ds.ANNUALLY]:[],[ds.DAILY]:[],[ds.AS_NEEDED]:[],[ds.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!0,this.quoteAbortController=null,this.quoteDebounceTimer=null,this.startQuoteApiCall=async()=>{var e;null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=new AbortController,this.isCalculatingQuote=!0,await this.performQuoteCalculation(this.quoteAbortController.signal)},this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await Promise.allSettled([this.setupCalculator(),this.fetchUnits()])},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return void(this.isLoadingLayouts=!1);const e=Xo(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=ys(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||ds.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{var e,t;this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&(Co("feeCalculatorPdfDownloaded",{buildingSlug:this.buildingSlug,quoteId:null!==(t=null===(e=this.quote)||void 0===e?void 0:e.id)&&void 0!==t?t:null}),window.open(this.pdfUrl,"_blank"))},this.fetchUnits=async()=>{let e;this.isLoadingUnits=!0,this.selectedLayoutIds.includes(bs)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await $s({buildingSlug:this.buildingSlug,moveInDateString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTerm:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.quote=null,this.pdfUrl=null)}}finally{this.isLoadingUnits=!1}}}async performQuoteCalculation(e){if(!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);const t=this.moveInDateString,n=this.selectedUnit.id,i=this.leaseTerm;try{const r=await ws({buildingSlug:this.buildingSlug,unitId:n,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:i,moveInDate:t},e);this.quote=r.quote,this.pdfUrl=r.pdfUrl||null,this.quote&&Co("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:n,leaseTerm:i})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.isCalculatingQuote=!1,jo({logType:Bo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e}}))}finally{e.aborted||(this.isCalculatingQuote=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return R`
|
|
5207
|
+
`:R``}};wl.styles=bl,vl([ue({type:Object})],wl.prototype,"incentive",void 0),wl=vl([se("incentive-banner")],wl);var Cl=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 xl=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=qn,this.backgroundColor=Yn,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[bs],this.selectedUnit=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.desiredRentableItems=[],this.moveInDateString=Sr.toISOString().split("T")[0],this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.groupedFees={[ds.ONE_TIME]:[],[ds.MONTHLY]:[],[ds.WEEKLY]:[],[ds.BI_WEEKLY]:[],[ds.ANNUALLY]:[],[ds.DAILY]:[],[ds.AS_NEEDED]:[],[ds.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!0,this.quoteAbortController=null,this.quoteDebounceTimer=null,this.startQuoteApiCall=async()=>{var e;null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=new AbortController,this.isCalculatingQuote=!0,await this.performQuoteCalculation(this.quoteAbortController.signal)},this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await Promise.allSettled([this.setupCalculator(),this.fetchUnits()])},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return void(this.isLoadingLayouts=!1);const e=Xo(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=ys(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||ds.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{var e,t;this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&(Co("feeCalculatorPdfDownloaded",{buildingSlug:this.buildingSlug,quoteId:null!==(t=null===(e=this.quote)||void 0===e?void 0:e.id)&&void 0!==t?t:null}),window.open(this.pdfUrl,"_blank"))},this.fetchUnits=async()=>{let e;this.isLoadingUnits=!0,this.selectedLayoutIds.includes(bs)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await $s({buildingSlug:this.buildingSlug,moveInDateString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTerm:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.quote=null,this.pdfUrl=null)}}finally{this.isLoadingUnits=!1}}}async performQuoteCalculation(e){if(!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);const t=this.moveInDateString,n=this.selectedUnit.id,i=this.leaseTerm;try{const r=await ws({buildingSlug:this.buildingSlug,unitId:n,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:i,moveInDate:t},e);this.quote=r.quote,this.pdfUrl=r.pdfUrl||null,this.quote&&Co("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:n,leaseTerm:i})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.isCalculatingQuote=!1,jo({logType:Bo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e},error:e}))}finally{e.aborted||(this.isCalculatingQuote=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return R`
|
|
5188
5208
|
<div
|
|
5189
5209
|
class="fee-calculator-container"
|
|
5190
5210
|
@keydown=${e=>e.stopPropagation()}
|
|
@@ -5313,9 +5333,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5313
5333
|
justify-content: center;
|
|
5314
5334
|
align-items: center;
|
|
5315
5335
|
}
|
|
5316
|
-
`,Sl=(e="white")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
|
|
5336
|
+
`,Sl=(e="white")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
|
|
5317
5337
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.46964 0.488343H9.53036C10.898 0.488331 11.9813 0.488321 12.829 0.602304C13.7015 0.719609 14.4077 0.966767 14.9647 1.52369C15.5216 2.08061 15.7687 2.78681 15.886 3.65932C16 4.50711 16 5.59038 16 6.95802V7.04198C16 8.40962 16 9.49289 15.886 10.3407C15.7687 11.2132 15.5216 11.9194 14.9647 12.4763C14.4077 13.0332 13.7015 13.2804 12.829 13.3977C11.9813 13.5117 10.898 13.5117 9.53035 13.5117H6.46965C5.10201 13.5117 4.01875 13.5117 3.17096 13.3977C2.29846 13.2804 1.59227 13.0332 1.03534 12.4763C0.478423 11.9194 0.231266 11.2132 0.113961 10.3407C-2.09587e-05 9.49289 -1.15596e-05 8.40962 2.39342e-07 7.04198V6.95801C-1.15596e-05 5.59037 -2.09587e-05 4.50711 0.113961 3.65932C0.231266 2.78681 0.478423 2.08061 1.03534 1.52369C1.59227 0.966767 2.29846 0.719609 3.17096 0.602304C4.01875 0.488321 5.10201 0.488331 6.46964 0.488343ZM3.3197 1.70863C2.57098 1.8093 2.13962 1.99807 1.82467 2.31302C1.50973 2.62797 1.32095 3.05934 1.22029 3.80806C1.11746 4.57283 1.11628 5.58096 1.11628 7C1.11628 8.41903 1.11746 9.42716 1.22029 10.1919C1.32095 10.9407 1.50973 11.372 1.82467 11.687C2.13962 12.0019 2.57098 12.1907 3.3197 12.2914C4.08447 12.3942 5.0926 12.3954 6.51163 12.3954H9.48837C10.9074 12.3954 11.9155 12.3942 12.6803 12.2914C13.429 12.1907 13.8604 12.0019 14.1753 11.687C14.4903 11.372 14.6791 10.9407 14.7797 10.1919C14.8825 9.42716 14.8837 8.41903 14.8837 7C14.8837 5.58096 14.8825 4.57283 14.7797 3.80806C14.6791 3.05934 14.4903 2.62797 14.1753 2.31302C13.8604 1.99807 13.429 1.8093 12.6803 1.70863C11.9155 1.60581 10.9074 1.60463 9.48837 1.60463H6.51163C5.0926 1.60463 4.08448 1.60581 3.3197 1.70863ZM3.10611 3.66593C3.30345 3.42912 3.65539 3.39713 3.8922 3.59446L5.49882 4.93332C6.19311 5.5119 6.67515 5.9123 7.08211 6.17404C7.47605 6.42741 7.7432 6.51246 8 6.51246C8.2568 6.51246 8.52395 6.42741 8.91789 6.17404C9.32485 5.9123 9.80689 5.5119 10.5012 4.93332L12.1078 3.59446C12.3446 3.39713 12.6966 3.42912 12.8939 3.66593C13.0912 3.90273 13.0592 4.25468 12.8224 4.45202L11.1878 5.81419C10.5282 6.36389 9.99359 6.80943 9.52173 7.11291C9.0302 7.42904 8.5515 7.62875 8 7.62875C7.4485 7.62875 6.9698 7.42904 6.47827 7.11291C6.00641 6.80943 5.47179 6.36389 4.81218 5.81419L3.17757 4.45202C2.94077 4.25468 2.90877 3.90273 3.10611 3.66593Z" fill="${e}"/>
|
|
5318
|
-
</svg>`,Al=(e="black")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
|
|
5338
|
+
</svg>`,Al=(e="black")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
|
|
5319
5339
|
<path d="M15.6825 6.11855H0.00653076C0.0588276 4.00052 1.79117 2.30087 3.92226 2.30087H4.41255V3.6083C4.41255 3.88285 4.63481 4.09858 4.90283 4.09858C5.17085 4.09858 5.39311 3.88285 5.39311 3.6083V2.30087H10.2959V3.6083C10.2959 3.88285 10.5182 4.09858 10.7862 4.09858C11.0542 4.09858 11.2765 3.88285 11.2765 3.6083V2.30087H11.7668C13.8979 2.30087 15.6302 4.00052 15.6825 6.11855Z" fill="${e}"/>
|
|
5320
5340
|
<path d="M15.0641 7.39731V14.0677C15.0641 15.8922 13.5861 17.365 11.7668 17.365H3.92227C2.10298 17.365 0.625 15.8922 0.625 14.0677V7.39731H15.0641Z" fill="transparent" stroke="${e}" stroke-width="1.25"/>
|
|
5321
5341
|
<path d="M4.90283 1V2.30742" stroke="${e}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -5324,13 +5344,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5324
5344
|
<path d="M15.689 6.11862V6.22322C15.689 6.19053 15.689 6.15131 15.6825 6.11862H15.689Z" fill="white"/>
|
|
5325
5345
|
<path d="M4.74594 11.9562L6.56326 13.7735C6.8182 14.0285 7.23004 14.0285 7.48499 13.7735L10.9366 10.3219" stroke="${e}" stroke-miterlimit="10" stroke-linecap="round"/>
|
|
5326
5346
|
</svg>`,El=(e="white")=>B`
|
|
5327
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
5347
|
+
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
5328
5348
|
<path
|
|
5329
5349
|
fill-rule="evenodd"
|
|
5330
5350
|
clip-rule="evenodd"
|
|
5331
5351
|
d="M6.64026 0.25H8.8598C10.0157 0.249995 10.9219 0.249992 11.6459 0.318826C12.3838 0.388987 12.988 0.534458 13.5206 0.860861C14.0784 1.20267 14.5474 1.67164 14.8892 2.22942C15.2156 2.76206 15.3611 3.36627 15.4312 4.10419C15.5001 4.82813 15.5001 5.73432 15.5001 6.89025V7.65964C15.5001 8.48243 15.5001 9.12755 15.4645 9.64868C15.4283 10.1789 15.3535 10.6202 15.1845 11.0283C14.7638 12.044 13.9568 12.851 12.9411 13.2717C12.3607 13.5121 11.6997 13.5654 10.7947 13.581C10.4782 13.5865 10.2777 13.5905 10.1248 13.6074C9.98202 13.6232 9.92665 13.6464 9.89426 13.6652C9.86008 13.6851 9.81351 13.7213 9.73267 13.8323C9.64518 13.9523 9.54632 14.1182 9.38955 14.3831L8.99874 15.0433C8.44104 15.9856 7.05899 15.9856 6.5013 15.0433L6.11048 14.3831C5.95371 14.1182 5.85485 13.9523 5.76736 13.8323C5.68652 13.7213 5.63995 13.6851 5.60577 13.6652C5.57338 13.6464 5.51801 13.6232 5.37519 13.6074C5.22235 13.5905 5.02184 13.5865 4.70528 13.581C3.80031 13.5654 3.13933 13.5121 2.559 13.2717C1.54327 12.851 0.736277 12.044 0.315547 11.0283C0.146515 10.6202 0.0717299 10.1789 0.0355529 9.64868C-4.05001e-06 9.12754 -2.20251e-06 8.48243 1.60891e-07 7.65963L7.4949e-08 6.89026C-4.52294e-06 5.73432 -8.08928e-06 4.82814 0.0688256 4.10419C0.138987 3.36627 0.284458 2.76206 0.610861 2.22942C0.95267 1.67164 1.42164 1.20267 1.97942 0.860861C2.51206 0.534458 3.11627 0.388987 3.85419 0.318826C4.57814 0.249992 5.48432 0.249995 6.64026 0.25ZM3.95654 1.39537C3.29779 1.458 2.87862 1.57812 2.54445 1.78291C2.13217 2.03555 1.78555 2.38217 1.53291 2.79445C1.32812 3.12862 1.208 3.54779 1.14537 4.20654C1.08197 4.87334 1.0814 5.7282 1.0814 6.91863V7.63956C1.0814 8.48674 1.08169 9.09505 1.11444 9.57507C1.14686 10.0502 1.20927 10.3601 1.31463 10.6144C1.6256 11.3652 2.22208 11.9617 2.97284 12.2726C3.34458 12.4266 3.81883 12.4842 4.72391 12.4998L4.74685 12.5002C5.03378 12.5051 5.28522 12.5094 5.49421 12.5326C5.71878 12.5574 5.9384 12.6077 6.14946 12.7304C6.35874 12.8522 6.50969 13.0148 6.64128 13.1953C6.76287 13.3622 6.88783 13.5733 7.02936 13.8124L7.4319 14.4925C7.57086 14.7273 7.92917 14.7273 8.06813 14.4925L8.47067 13.8124C8.6122 13.5733 8.73716 13.3622 8.85875 13.1953C8.99034 13.0148 9.14129 12.8522 9.35057 12.7304C9.56163 12.6077 9.78126 12.5574 10.0058 12.5326C10.2148 12.5094 10.4662 12.5051 10.7532 12.5002L10.7761 12.4998C11.6812 12.4842 12.1555 12.4266 12.5272 12.2726C13.278 11.9617 13.8745 11.3652 14.1854 10.6144C14.2908 10.3601 14.3532 10.0502 14.3856 9.57507C14.4184 9.09505 14.4187 8.48674 14.4187 7.63956V6.91863C14.4187 5.7282 14.4181 4.87334 14.3547 4.20654C14.2921 3.54779 14.1719 3.12862 13.9672 2.79445C13.7145 2.38217 13.3679 2.03555 12.9556 1.78291C12.6214 1.57812 12.2023 1.458 11.5435 1.39537C10.8767 1.33197 10.0219 1.3314 8.83143 1.3314H6.66863C5.4782 1.3314 4.62334 1.33197 3.95654 1.39537ZM7.75003 3.85467C8.04865 3.85467 8.29073 4.09674 8.29073 4.39536V10.1628C8.29073 10.4614 8.04865 10.7035 7.75003 10.7035C7.45141 10.7035 7.20933 10.4614 7.20933 10.1628V4.39536C7.20933 4.09674 7.45141 3.85467 7.75003 3.85467ZM4.8663 5.29653C5.16492 5.29653 5.407 5.53861 5.407 5.83723V8.72096C5.407 9.01958 5.16492 9.26166 4.8663 9.26166C4.56768 9.26166 4.3256 9.01958 4.3256 8.72096V5.83723C4.3256 5.53861 4.56768 5.29653 4.8663 5.29653ZM10.6338 5.29653C10.9324 5.29653 11.1745 5.53861 11.1745 5.83723V8.72096C11.1745 9.01958 10.9324 9.26166 10.6338 9.26166C10.3351 9.26166 10.0931 9.01958 10.0931 8.72096V5.83723C10.0931 5.53861 10.3351 5.29653 10.6338 5.29653Z"
|
|
5332
5352
|
fill="${e}"/>
|
|
5333
|
-
</svg>`,Tl=(e="white")=>B`<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5353
|
+
</svg>`,Tl=(e="white")=>B`<svg aria-hidden="true" focusable="false" width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5334
5354
|
<g clip-path="url(#clip0_18382_27345)">
|
|
5335
5355
|
<g clip-path="url(#clip1_18382_27345)">
|
|
5336
5356
|
<path d="M9.91666 0.625V3.45833C9.91666 3.6462 9.99128 3.82636 10.1241 3.9592C10.257 4.09204 10.4371 4.16667 10.625 4.16667H13.4583" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -5349,6 +5369,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5349
5369
|
</svg>
|
|
5350
5370
|
`,kl=(e="white",t=20,n=-2)=>B`
|
|
5351
5371
|
<svg
|
|
5372
|
+
aria-hidden="true"
|
|
5373
|
+
focusable="false"
|
|
5352
5374
|
width="${t}"
|
|
5353
5375
|
height="${t}"
|
|
5354
5376
|
viewBox="0 0 20 20"
|
|
@@ -5452,7 +5474,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5452
5474
|
</li>
|
|
5453
5475
|
`}
|
|
5454
5476
|
</ul>
|
|
5455
|
-
</div>`}};Ol.styles=[$l],_l([ue({attribute:!0})],Ol.prototype,"onClickMinimize",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickEmailOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickPhoneOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickSSTOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickApplyNowOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickPriceCalculatorOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onChatTapped",void 0),_l([ue({attribute:!0})],Ol.prototype,"hideChat",void 0),_l([ue({attribute:!0})],Ol.prototype,"isMobileDesign",void 0),_l([ue({attribute:!0})],Ol.prototype,"primaryColor",void 0),_l([ue({attribute:!0})],Ol.prototype,"backgroundColor",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasChatEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasEmailEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasCallUsEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasTextUsEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasSSTEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasApplyNowEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasPricingCalculatorEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"applicationLink",void 0),_l([ue({attribute:!0})],Ol.prototype,"overrideRentgrata",void 0),_l([ue({attribute:!0})],Ol.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Ol=_l([se("mobile-launcher")],Ol);const Pl=(e="white")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
5477
|
+
</div>`}};Ol.styles=[$l],_l([ue({attribute:!0})],Ol.prototype,"onClickMinimize",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickEmailOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickPhoneOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickSSTOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickApplyNowOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onClickPriceCalculatorOption",void 0),_l([ue({attribute:!0})],Ol.prototype,"onChatTapped",void 0),_l([ue({attribute:!0})],Ol.prototype,"hideChat",void 0),_l([ue({attribute:!0})],Ol.prototype,"isMobileDesign",void 0),_l([ue({attribute:!0})],Ol.prototype,"primaryColor",void 0),_l([ue({attribute:!0})],Ol.prototype,"backgroundColor",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasChatEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasEmailEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasCallUsEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasTextUsEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasSSTEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasApplyNowEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"hasPricingCalculatorEnabled",void 0),_l([ue({attribute:!0})],Ol.prototype,"applicationLink",void 0),_l([ue({attribute:!0})],Ol.prototype,"overrideRentgrata",void 0),_l([ue({attribute:!0})],Ol.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Ol=_l([se("mobile-launcher")],Ol);const Pl=(e="white")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
5456
5478
|
<path d="M1.31812 7L4.31812 4L1.31811 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5457
5479
|
</svg>`;var Il=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 Nl=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=qn,this.toExpand=!1}render(){return R`
|
|
5458
5480
|
<div class=${"button-container"} @click=${this.onClick}>
|
|
@@ -5460,7 +5482,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5460
5482
|
class="inner-container"
|
|
5461
5483
|
style=${Vn({background:this.primaryColor})}
|
|
5462
5484
|
>
|
|
5463
|
-
${this.toExpand?Pl("black"):((e="white")=>B`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
5485
|
+
${this.toExpand?Pl("black"):((e="white")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
5464
5486
|
<path d="M3.68188 7L0.681885 4L3.68188 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5465
5487
|
</svg>`)("black")}
|
|
5466
5488
|
</div>
|
|
@@ -5489,7 +5511,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5489
5511
|
.button-container:hover {
|
|
5490
5512
|
filter: brightness(90%);
|
|
5491
5513
|
}
|
|
5492
|
-
`],Il([ue({attribute:!0})],Nl.prototype,"onClick",void 0),Il([ue({attribute:!0})],Nl.prototype,"primaryColor",void 0),Il([ue({attribute:!0})],Nl.prototype,"toExpand",void 0),Nl=Il([se("collapse-expand-button")],Nl);const Ml=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},Dl=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},Ll=()=>!!window.rentgrata;var Ul=n(3950),Rl=n.n(Ul);const Bl=(e="black")=>B`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5514
|
+
`],Il([ue({attribute:!0})],Nl.prototype,"onClick",void 0),Il([ue({attribute:!0})],Nl.prototype,"primaryColor",void 0),Il([ue({attribute:!0})],Nl.prototype,"toExpand",void 0),Nl=Il([se("collapse-expand-button")],Nl);const Ml=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},Dl=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},Ll=()=>!!window.rentgrata;var Ul=n(3950),Rl=n.n(Ul);const Bl=(e="black")=>B`<svg aria-hidden="true" focusable="false" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5493
5515
|
<path d="M6 6C7.65685 6 9 4.65685 9 3C9 1.34315 7.65685 0 6 0C4.34315 0 3 1.34315 3 3C3 4.65685 4.34315 6 6 6ZM8 3C8 4.10457 7.10457 5 6 5C4.89543 5 4 4.10457 4 3C4 1.89543 4.89543 1 6 1C7.10457 1 8 1.89543 8 3Z" fill="${e}"/>
|
|
5494
5516
|
<path d="M12 11C12 12 11 12 11 12H1C1 12 0 12 0 11C0 10 1 7 6 7C11 7 12 10 12 11ZM11 10.9965C10.9986 10.7497 10.8462 10.0104 10.1679 9.33211C9.51563 8.67985 8.2891 8 5.99999 8C3.71088 8 2.48435 8.67985 1.8321 9.33211C1.15375 10.0104 1.00142 10.7497 1 10.9965H11Z" fill="${e}"/>
|
|
5495
5517
|
</svg>
|
|
@@ -6009,7 +6031,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6009
6031
|
${za}
|
|
6010
6032
|
${Qa}
|
|
6011
6033
|
${Wa}
|
|
6012
|
-
`,jl([ue({attribute:!0})],Fl.prototype,"isMinimized",void 0),jl([ue()],Fl.prototype,"mobileStyles",void 0),jl([ue({type:Boolean})],Fl.prototype,"isFirstMount",void 0),jl([ue({attribute:!1})],Fl.prototype,"autoOpenChatWidget",void 0),jl([ue()],Fl.prototype,"phoneNumber",void 0),jl([ue({attribute:!0})],Fl.prototype,"buildingName",void 0),jl([ue({attribute:!0})],Fl.prototype,"chatId",void 0),jl([ue({attribute:!0})],Fl.prototype,"orgLegalName",void 0),jl([ue({attribute:!1})],Fl.prototype,"country",void 0),jl([ue({attribute:!0})],Fl.prototype,"chatCallUsHeader",void 0),jl([ue({attribute:!1})],Fl.prototype,"buildingId",void 0),jl([ue({type:Number})],Fl.prototype,"orgId",void 0),jl([ue({attribute:!1})],Fl.prototype,"leadSourceParams",void 0),jl([ue({attribute:!0})],Fl.prototype,"buildingSlug",void 0),jl([ue({attribute:!0})],Fl.prototype,"orgSlug",void 0),jl([ue({attribute:!0})],Fl.prototype,"sgtUrl",void 0),jl([ue({attribute:!0})],Fl.prototype,"selfGuidedTourEnabled",void 0),jl([ue({attribute:!0})],Fl.prototype,"selfGuidedToursTypeOffered",void 0),jl([ue({attribute:!0})],Fl.prototype,"designConcept",void 0),jl([ue({attribute:!0})],Fl.prototype,"featureFlagShowDropdown",void 0),jl([ue({attribute:!1})],Fl.prototype,"leadSources",void 0),jl([ue({attribute:!0})],Fl.prototype,"currentLeadSource",void 0),jl([ue({attribute:!0})],Fl.prototype,"escortedToursLink",void 0),jl([ue({attribute:!0})],Fl.prototype,"escortedToursTypeOffered",void 0),jl([ue({attribute:!0})],Fl.prototype,"virtualToursLink",void 0),jl([ue({attribute:!0})],Fl.prototype,"virtualToursTypeOffered",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasChatEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasChatEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasEmailEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasEmailEnabledMobile",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasApplyNowEnabledDesktop",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasApplyNowEnabledMobile",void 0),jl([ue({attribute:!0})],Fl.prototype,"applicationLink",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasCallUsEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasCallUsEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasTextUsEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasTextUsEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasSSTEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasSSTEnabledMobile",void 0),jl([ue({attribute:!1})],Fl.prototype,"tourTypeOptions",void 0),jl([ue({attribute:!1})],Fl.prototype,"layoutOptions",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasDynamicSchedulingEnabled",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasPricingCalculatorEnabledDesktop",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasPricingCalculatorEnabledMobile",void 0),jl([ue({attribute:!1})],Fl.prototype,"hasHideMobileFeatures",void 0),jl([ue({type:Number})],Fl.prototype,"right",void 0),jl([ue({type:Number})],Fl.prototype,"bottom",void 0),jl([ue({type:Number})],Fl.prototype,"top",void 0),jl([ue({type:Number})],Fl.prototype,"left",void 0),jl([ue({attribute:!0})],Fl.prototype,"showTourNextToChat",void 0),jl([ue({attribute:!1})],Fl.prototype,"onChatTapped",void 0),jl([ue({attribute:!0})],Fl.prototype,"onClickMinimize",void 0),jl([ue({attribute:!0})],Fl.prototype,"onSstClose",void 0),jl([ue({attribute:!0})],Fl.prototype,"overrideRentgrata",void 0),jl([ue({attribute:!1})],Fl.prototype,"launcherStyles",void 0),jl([ue({attribute:!0})],Fl.prototype,"primaryColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"backgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"leadSourceClient",void 0),jl([de()],Fl.prototype,"leadSourceMultitouchClient",void 0),jl([de()],Fl.prototype,"_isMobile",void 0),jl([de()],Fl.prototype,"isEmailWindowOpen",void 0),jl([de()],Fl.prototype,"isCallUsWindowOpen",void 0),jl([de()],Fl.prototype,"isSSTWindowOpen",void 0),jl([de()],Fl.prototype,"isTextUsWindowOpen",void 0),jl([de()],Fl.prototype,"isCalculatorWindowOpen",void 0),jl([de()],Fl.prototype,"isMobileFeaturesExpanded",void 0),Fl=jl([se("meetelise-launcher")],Fl);const Hl=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Fl)},Gl=["app.meetelise.com","staging.eliseai.com","localhost"],zl={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},Ql=e=>{const t=window.location.hostname;if(!Gl.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in zl&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=zl[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Wl=n(5072),Vl=n.n(Wl),ql=n(7825),Yl=n.n(ql),Kl=n(7659),Xl=n.n(Kl),Zl=n(5056),Jl=n.n(Zl),eu=n(540),tu=n.n(eu),nu=n(1113),iu=n.n(nu),ru=n(5541),ou={};ou.styleTagTransform=iu(),ou.setAttributes=Jl(),ou.insert=Xl().bind(null,"head"),ou.domAPI=Yl(),ou.insertStyleElement=tu();Vl()(ru.A,ou);ru.A&&ru.A.locals&&ru.A.locals;async function au(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return su(n.data,t)}return[]}catch(e){return[]}}const su=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function lu(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}var uu,du=n(8805),cu=n.n(du),hu=new Uint8Array(16);function pu(){if(!uu&&!(uu="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 uu(hu)}const fu=/^(?:[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;const gu=function(e){return"string"==typeof e&&fu.test(e)};for(var mu=[],yu=0;yu<256;++yu)mu.push((yu+256).toString(16).substr(1));const bu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(mu[e[t+0]]+mu[e[t+1]]+mu[e[t+2]]+mu[e[t+3]]+"-"+mu[e[t+4]]+mu[e[t+5]]+"-"+mu[e[t+6]]+mu[e[t+7]]+"-"+mu[e[t+8]]+mu[e[t+9]]+"-"+mu[e[t+10]]+mu[e[t+11]]+mu[e[t+12]]+mu[e[t+13]]+mu[e[t+14]]+mu[e[t+15]]).toLowerCase();if(!gu(n))throw TypeError("Stringified UUID is invalid");return n};const vu=function(e,t,n){var i=(e=e||{}).random||(e.rng||pu)();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 bu(i)},wu=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Cu=(e,t,n)=>{const i=Rr(new Date),r=n||`lead_${vu()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Wr(i),buildingSlug:e,initiatedChat:t}},xu=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if($u(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},$u=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(xr(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Pr(t.timestamp,24)};var Su;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(Su||(Su={}));const Au=e=>e.type===Tu.text,Eu=e=>e.type===Tu.media;var Tu;!function(e){e.text="text",e.media="media"}(Tu||(Tu={}));const ku=class{constructor(e,t,n,i=null,r,o,a=null,s=_c.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.widgetType=_c.Default,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==Su.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){this.simpleChatMessages.some(e=>e.type===Tu.text&&e.message.includes("confirmed for your"))&&Co("scheduledTourEvent",{tourDetails:e.message,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=this.simpleChatMessages.some(e=>{if(!Au(e))return!1;const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order});t&&(this.streamingMessageTimeout=setTimeout(()=>{jo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory()},e))},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Co("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===Su.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=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){const e=Cu(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===_c.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>Er({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(Co("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),Co("chatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(jo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Tu.media}):!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:Tu.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:Tu.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&jo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),null}}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(cu())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==Su.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}shouldCreateAsDevState(){return location.href.startsWith("https://app.meetelise.com/settings/widgets")||location.href.includes("demo/utilities")}},_u=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),Ou=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return _u.has(t)},Pu=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\(\d{3}\)[\s.-]?|\d{3}[\s.-])\d{3}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},y=document.body.getElementsByTagName("*");let b=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Ou(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Ou(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t}),C&&jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t}),b||jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:Bo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:Bo.error,buildingSlug:n,orgSlug:t}),0}};var Iu=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 Nu=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=qn,this.toExpand=!1}render(){return R`
|
|
6034
|
+
`,jl([ue({attribute:!0})],Fl.prototype,"isMinimized",void 0),jl([ue()],Fl.prototype,"mobileStyles",void 0),jl([ue({type:Boolean})],Fl.prototype,"isFirstMount",void 0),jl([ue({attribute:!1})],Fl.prototype,"autoOpenChatWidget",void 0),jl([ue()],Fl.prototype,"phoneNumber",void 0),jl([ue({attribute:!0})],Fl.prototype,"buildingName",void 0),jl([ue({attribute:!0})],Fl.prototype,"chatId",void 0),jl([ue({attribute:!0})],Fl.prototype,"orgLegalName",void 0),jl([ue({attribute:!1})],Fl.prototype,"country",void 0),jl([ue({attribute:!0})],Fl.prototype,"chatCallUsHeader",void 0),jl([ue({attribute:!1})],Fl.prototype,"buildingId",void 0),jl([ue({type:Number})],Fl.prototype,"orgId",void 0),jl([ue({attribute:!1})],Fl.prototype,"leadSourceParams",void 0),jl([ue({attribute:!0})],Fl.prototype,"buildingSlug",void 0),jl([ue({attribute:!0})],Fl.prototype,"orgSlug",void 0),jl([ue({attribute:!0})],Fl.prototype,"sgtUrl",void 0),jl([ue({attribute:!0})],Fl.prototype,"selfGuidedTourEnabled",void 0),jl([ue({attribute:!0})],Fl.prototype,"selfGuidedToursTypeOffered",void 0),jl([ue({attribute:!0})],Fl.prototype,"designConcept",void 0),jl([ue({attribute:!0})],Fl.prototype,"featureFlagShowDropdown",void 0),jl([ue({attribute:!1})],Fl.prototype,"leadSources",void 0),jl([ue({attribute:!0})],Fl.prototype,"currentLeadSource",void 0),jl([ue({attribute:!0})],Fl.prototype,"escortedToursLink",void 0),jl([ue({attribute:!0})],Fl.prototype,"escortedToursTypeOffered",void 0),jl([ue({attribute:!0})],Fl.prototype,"virtualToursLink",void 0),jl([ue({attribute:!0})],Fl.prototype,"virtualToursTypeOffered",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasChatEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasChatEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasEmailEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasEmailEnabledMobile",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasApplyNowEnabledDesktop",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasApplyNowEnabledMobile",void 0),jl([ue({attribute:!0})],Fl.prototype,"applicationLink",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasCallUsEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasCallUsEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasTextUsEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasTextUsEnabledMobile",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasSSTEnabledDesktop",void 0),jl([ue({type:Boolean})],Fl.prototype,"hasSSTEnabledMobile",void 0),jl([ue({attribute:!1})],Fl.prototype,"tourTypeOptions",void 0),jl([ue({attribute:!1})],Fl.prototype,"layoutOptions",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasDynamicSchedulingEnabled",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasPricingCalculatorEnabledDesktop",void 0),jl([ue({attribute:!0})],Fl.prototype,"hasPricingCalculatorEnabledMobile",void 0),jl([ue({attribute:!1})],Fl.prototype,"hasHideMobileFeatures",void 0),jl([ue({type:Number})],Fl.prototype,"right",void 0),jl([ue({type:Number})],Fl.prototype,"bottom",void 0),jl([ue({type:Number})],Fl.prototype,"top",void 0),jl([ue({type:Number})],Fl.prototype,"left",void 0),jl([ue({attribute:!0})],Fl.prototype,"showTourNextToChat",void 0),jl([ue({attribute:!1})],Fl.prototype,"onChatTapped",void 0),jl([ue({attribute:!0})],Fl.prototype,"onClickMinimize",void 0),jl([ue({attribute:!0})],Fl.prototype,"onSstClose",void 0),jl([ue({attribute:!0})],Fl.prototype,"overrideRentgrata",void 0),jl([ue({attribute:!1})],Fl.prototype,"launcherStyles",void 0),jl([ue({attribute:!0})],Fl.prototype,"primaryColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"backgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),jl([ue({attribute:!0})],Fl.prototype,"leadSourceClient",void 0),jl([de()],Fl.prototype,"leadSourceMultitouchClient",void 0),jl([de()],Fl.prototype,"_isMobile",void 0),jl([de()],Fl.prototype,"isEmailWindowOpen",void 0),jl([de()],Fl.prototype,"isCallUsWindowOpen",void 0),jl([de()],Fl.prototype,"isSSTWindowOpen",void 0),jl([de()],Fl.prototype,"isTextUsWindowOpen",void 0),jl([de()],Fl.prototype,"isCalculatorWindowOpen",void 0),jl([de()],Fl.prototype,"isMobileFeaturesExpanded",void 0),Fl=jl([se("meetelise-launcher")],Fl);const Hl=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Fl)},Gl=["app.meetelise.com","staging.eliseai.com","localhost"],zl={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},Ql=e=>{const t=window.location.hostname;if(!Gl.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in zl&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=zl[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Wl=n(5072),Vl=n.n(Wl),ql=n(7825),Yl=n.n(ql),Kl=n(7659),Xl=n.n(Kl),Zl=n(5056),Jl=n.n(Zl),eu=n(540),tu=n.n(eu),nu=n(1113),iu=n.n(nu),ru=n(5541),ou={};ou.styleTagTransform=iu(),ou.setAttributes=Jl(),ou.insert=Xl().bind(null,"head"),ou.domAPI=Yl(),ou.insertStyleElement=tu();Vl()(ru.A,ou);ru.A&&ru.A.locals&&ru.A.locals;async function au(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return su(n.data,t)}return[]}catch(e){return[]}}const su=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function lu(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}var uu,du=n(8805),cu=n.n(du),hu=new Uint8Array(16);function pu(){if(!uu&&!(uu="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 uu(hu)}const fu=/^(?:[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;const gu=function(e){return"string"==typeof e&&fu.test(e)};for(var mu=[],yu=0;yu<256;++yu)mu.push((yu+256).toString(16).substr(1));const bu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(mu[e[t+0]]+mu[e[t+1]]+mu[e[t+2]]+mu[e[t+3]]+"-"+mu[e[t+4]]+mu[e[t+5]]+"-"+mu[e[t+6]]+mu[e[t+7]]+"-"+mu[e[t+8]]+mu[e[t+9]]+"-"+mu[e[t+10]]+mu[e[t+11]]+mu[e[t+12]]+mu[e[t+13]]+mu[e[t+14]]+mu[e[t+15]]).toLowerCase();if(!gu(n))throw TypeError("Stringified UUID is invalid");return n};const vu=function(e,t,n){var i=(e=e||{}).random||(e.rng||pu)();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 bu(i)},wu=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Cu=(e,t,n)=>{const i=Rr(new Date),r=n||`lead_${vu()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Wr(i),buildingSlug:e,initiatedChat:t}},xu=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if($u(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},$u=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(xr(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Pr(t.timestamp,24)};var Su;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(Su||(Su={}));const Au=e=>e.type===Tu.text,Eu=e=>e.type===Tu.media;var Tu;!function(e){e.text="text",e.media="media"}(Tu||(Tu={}));const ku=class{constructor(e,t,n,i=null,r,o,a=null,s=_c.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.widgetType=_c.Default,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==Su.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){this.simpleChatMessages.some(e=>e.type===Tu.text&&e.message.includes("confirmed for your"))&&Co("scheduledTourEvent",{tourDetails:e.message,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=this.simpleChatMessages.some(e=>{if(!Au(e))return!1;const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order});t&&(this.streamingMessageTimeout=setTimeout(()=>{jo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory()},e))},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Co("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===Su.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=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){const e=Cu(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===_c.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>Er({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(Co("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),Co("chatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(jo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Tu.media}):!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:Tu.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:Tu.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&jo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(cu())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:Bo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==Su.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&jo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}shouldCreateAsDevState(){return location.href.startsWith("https://app.meetelise.com/settings/widgets")||location.href.includes("demo/utilities")}},_u=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),Ou=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return _u.has(t)},Pu=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\(\d{3}\)[\s.-]?|\d{3}[\s.-])\d{3}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},y=document.body.getElementsByTagName("*");let b=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Ou(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Ou(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t}),C&&jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t}),b||jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:Bo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:Bo.error,buildingSlug:n,orgSlug:t,error:e}),0}};var Iu=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 Nu=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=qn,this.toExpand=!1}render(){return R`
|
|
6013
6035
|
<button
|
|
6014
6036
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
6015
6037
|
@click=${this.onClick}
|
|
@@ -6836,12 +6858,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6836
6858
|
padding-right: 28px;
|
|
6837
6859
|
}
|
|
6838
6860
|
`,Xd=(e="black")=>B`
|
|
6839
|
-
<svg width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6861
|
+
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6840
6862
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 0C17.7614 0 20 2.23858 20 5V15C20 17.7614 17.7614 20 15 20H5C2.23858 20 0 17.7614 0 15V5C0 2.23858 2.23858 0 5 0H15ZM18 5C18 3.34315 16.6569 2 15 2H5C3.34315 2 2 3.34315 2 5V15C2 16.6569 3.34315 18 5 18H15C16.6569 18 18 16.6569 18 15V5Z" fill="${e}"/>
|
|
6841
6863
|
<path d="M12.1893 9.25L10.4697 7.53033C10.1768 7.23744 10.1768 6.76256 10.4697 6.46967C10.7626 6.17678 11.2374 6.17678 11.5303 6.46967L13.8232 8.76256C14.5066 9.44598 14.5066 10.554 13.8232 11.2374L11.5303 13.5303C11.2374 13.8232 10.7626 13.8232 10.4697 13.5303C10.1768 13.2374 10.1768 12.7626 10.4697 12.4697L12.1893 10.75L6 10.75C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25L12.1893 9.25Z" fill="${e}"/>
|
|
6842
6864
|
</svg>
|
|
6843
6865
|
`,Zd=(e="black")=>B`
|
|
6844
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6866
|
+
<svg aria-hidden="true" focusable="false" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6845
6867
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 0C17.7614 0 20 2.23858 20 5V15C20 17.7614 17.7614 20 15 20H5C2.23858 20 0 17.7614 0 15V5C0 2.23858 2.23858 0 5 0H15ZM18 5C18 3.34315 16.6569 2 15 2H5C3.34315 2 2 3.34315 2 5V15C2 16.6569 3.34315 18 5 18H15C16.6569 18 18 16.6569 18 15V5Z" fill="${e}"/>
|
|
6846
6868
|
<path d="M12.1893 9.25L10.4697 7.53033C10.1768 7.23744 10.1768 6.76256 10.4697 6.46967C10.7626 6.17678 11.2374 6.17678 11.5303 6.46967L13.8232 8.76256C14.5066 9.44598 14.5066 10.554 13.8232 11.2374L11.5303 13.5303C11.2374 13.8232 10.7626 13.8232 10.4697 13.5303C10.1768 13.2374 10.1768 12.7626 10.4697 12.4697L12.1893 10.75L6 10.75C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25L12.1893 9.25Z" fill="${e}"/>
|
|
6847
6869
|
</svg>
|
|
@@ -7181,7 +7203,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7181
7203
|
</button>
|
|
7182
7204
|
</div>
|
|
7183
7205
|
</div>
|
|
7184
|
-
`}};ec.styles=[Oe,Lu,Du,Mu,Kd],Jd([ue({type:Number})],ec.prototype,"right",void 0),Jd([ue({type:Number})],ec.prototype,"bottom",void 0),Jd([ue({type:Number})],ec.prototype,"top",void 0),Jd([ue({type:Number})],ec.prototype,"left",void 0),Jd([ue({attribute:!0})],ec.prototype,"onMount",void 0),Jd([ue({attribute:!0})],ec.prototype,"channel",void 0),Jd([ue({attribute:!0})],ec.prototype,"isHealthChat",void 0),Jd([ue({attribute:!0})],ec.prototype,"myPubnub",void 0),Jd([ue({attribute:!0})],ec.prototype,"orgSlug",void 0),Jd([ue({attribute:!0})],ec.prototype,"buildingSlug",void 0),Jd([ue({attribute:!0})],ec.prototype,"widgetType",void 0),Jd([ue({attribute:!0})],ec.prototype,"building",void 0),Jd([ue({attribute:!0})],ec.prototype,"primaryColor",void 0),Jd([ue({attribute:!0})],ec.prototype,"backgroundColor",void 0),Jd([ue({attribute:!0})],ec.prototype,"onClickExit",void 0),Jd([ue({attribute:!0})],ec.prototype,"requiresConsent",void 0),Jd([ce("#message-input",!0)],ec.prototype,"messageInput",void 0),Jd([ce("#conversation-body",!0)],ec.prototype,"messageBody",void 0),Jd([de()],ec.prototype,"_isMobile",void 0),Jd([de()],ec.prototype,"messages",void 0),Jd([de()],ec.prototype,"isLoadingMessages",void 0),Jd([de()],ec.prototype,"hasReceivedConsent",void 0),Jd([de()],ec.prototype,"privacyPolicyUrl",void 0),Jd([de()],ec.prototype,"websitePreviewMapping",void 0),ec=Jd([se("pubnub-chat")],ec);const tc="cdn.skypack.dev/@meetelise/chat",nc="cdn.eliseai.com/@meetelise/chat",ic=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(tc)||n.includes(tc))return"skypack";if(e.includes(nc)||n.includes(nc))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},rc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,oc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},ac="https://applications.eliseai.com",sc=["Check Availability","Apply Now"],lc=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&sc.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),jo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:Bo.info,buildingSlug:i,orgSlug:n}),!0},uc=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&lc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)lc(s[e],t,n,i)}},dc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)lc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)uc(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class cc{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Rr(Br(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=mo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Ro()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));jo({logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=zo(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Rr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Wr(e.timestampInitiallyLogged).getTime()-Wr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Rr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Wr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var hc,pc=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 fc=hc=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=_r(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=fo.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=_c.Default,this.onWidgetLoaded=Rl(),this.onSstClose=Rl(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;const e=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return Zo(n.data)}(this.orgSlug):await Xo(this.orgSlug,this.buildingSlug);if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{ic(this.orgSlug,this.buildingSlug)}catch(e){}await Ga(e,this.buildingSlug,this.orgSlug)&&(Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==e?void 0:e.launchedDateTime)?.01:.05}),this.buildingWebchatView=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0))},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,N,M,D,L,U,R,B,j,F,H,G,z,Q,W,V,q,Y;const K=this.buildingWebchatView;if(!K)return;K&&this.orgSlug&&mc(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const X=K.featureFlagWebchatMarketingSourceDropdownConfiguration,Z=K.featureFlagWebchatUseDniPhoneNumberBySource,J=K.featureFlagInsertDniIntoWebsite,ee=K.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var te;te=bo.includes(K.orgId),wo=te;const[ne,ie,re]=await Promise.all([au(this.orgSlug,this.buildingSlug),go(this.buildingSlug),lu(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Gn(K.phoneNumber),this.buildingWebchatView.isAip=re),this.leadSources=ne,this.featureFlagShowDropdown=X;const oe=K.textWithUsPhoneNumber?K.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug),ae=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,se=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,le={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!oe)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!oe)&&void 0!==S&&S,sstDesktop:null!==(E=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(k=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==k&&k,calcDesktop:ae,calcMobile:se};var ue,de;this.enabledChatWidgets=Ql(le),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(de=this.handleTourClicked,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",e=>{e.preventDefault(),de(e)})}),ee&&(e=>{document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(t=>{t&&t.addEventListener("click",t=>{t.preventDefault(),e(t)})})})(this.handleTourClicked),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(_=this.LeadSourceClient)||void 0===_?void 0:_.leadSource)&&(ue=null!==(P=null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&void 0!==P?P:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(ue)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(I=this.buildingWebchatView.primaryColor)&&void 0!==I?I:null,this.backgroundColor=null!==(N=this.buildingWebchatView.secondaryColor)&&void 0!==N?N:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(M=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==M?M:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==D?D:null,this.webchatConfigHasAutoOpenChat=null!==(L=this.buildingWebchatView.autoOpenChat)&&void 0!==L&&L,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(R=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==R&&R,this.privacyPolicyUrl=null!==(B=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==B?B:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===Vo.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===Vo.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===Vo.EMOJI&&(this.designConcept=Vo.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=qn),null===this.backgroundColor&&(this.backgroundColor=Yn);const ce=null!==(F=null===(j=this.buildingWebchatView)||void 0===j?void 0:j.phoneNumber)&&void 0!==F?F:"";let he=null;if(Z&&(he=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Gn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(G=null===(H=this.LeadSourceClient)||void 0===H?void 0:H.leadSource)&&void 0!==G?G:null),he&&!he.isMatch&&(he.number=ce)),J&&(null==he?void 0:he.number)){const e=Pu(he.number,this.orgSlug,this.buildingSlug);e>0&&Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const pe=localStorage.getItem("eliseai_phone_number_devtest");pe&&Pu(pe,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=he||{number:ce,isMatch:!1,isPropertyWebsiteCatchall:!0};const fe=null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null;fe&&(this.leadSources.includes(fe)||this.leadSources.push(fe)),io(K.id);if((ie||(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isAip))&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.isLiveOnApplications)&&this.buildingSlug){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=rc(o,e);l.setAttribute("href",s),a++,jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:Bo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug)try{(e=>{const t=oc[e];if(!t)return 0;const n=`${ac}/building/${t}/units`,i=`${ac}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&dc(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=xu(this.buildingSlug),c=$u(this.buildingSlug,d),h=c?d:Cu(this.buildingSlug,!1);if(!h.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Qo,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new cc(this.orgSlug,this.buildingSlug),this.myPubnub=new ku(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,h.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const p=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,c&&null!==(n=h.leadId)&&void 0!==n?n:void 0);p&&Cu(this.buildingSlug,h.initiatedChat,p.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const f=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));f&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(f),"property-website"!==zo(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:zo(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const g=xu(this.buildingSlug);g.initiatedChat&&await this.myPubnub.initializePubnub(g)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Gr(Wr(t)));return!!e&&!!n&&!_r()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Rr(function(e,t){return ni(2,arguments),vi(e,6e4*bi(t))}(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.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let d=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&d.push(...this.collectFocusableElements(e)),t&&d.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(d=this.collectFocusableElements(e))}if(0===d.length)return;e.preventDefault();const c=this.getDeepActiveElement(),h=d.findIndex(e=>e===c);d[e.shiftKey?(h-1+d.length)%d.length:(h+1)%d.length].focus()},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,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Uo(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),wu(this.buildingSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),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),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=Or(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches(hc.FOCUSABLE_SELECTOR)&&hc.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){jo({logType:Bo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,N,M,D,L,U,B,j,F,H,G,z,Q;Hl();const W=this.hideLauncher&&!this.isLoading&&!this._isMobile;return R`
|
|
7206
|
+
`}};ec.styles=[Oe,Lu,Du,Mu,Kd],Jd([ue({type:Number})],ec.prototype,"right",void 0),Jd([ue({type:Number})],ec.prototype,"bottom",void 0),Jd([ue({type:Number})],ec.prototype,"top",void 0),Jd([ue({type:Number})],ec.prototype,"left",void 0),Jd([ue({attribute:!0})],ec.prototype,"onMount",void 0),Jd([ue({attribute:!0})],ec.prototype,"channel",void 0),Jd([ue({attribute:!0})],ec.prototype,"isHealthChat",void 0),Jd([ue({attribute:!0})],ec.prototype,"myPubnub",void 0),Jd([ue({attribute:!0})],ec.prototype,"orgSlug",void 0),Jd([ue({attribute:!0})],ec.prototype,"buildingSlug",void 0),Jd([ue({attribute:!0})],ec.prototype,"widgetType",void 0),Jd([ue({attribute:!0})],ec.prototype,"building",void 0),Jd([ue({attribute:!0})],ec.prototype,"primaryColor",void 0),Jd([ue({attribute:!0})],ec.prototype,"backgroundColor",void 0),Jd([ue({attribute:!0})],ec.prototype,"onClickExit",void 0),Jd([ue({attribute:!0})],ec.prototype,"requiresConsent",void 0),Jd([ce("#message-input",!0)],ec.prototype,"messageInput",void 0),Jd([ce("#conversation-body",!0)],ec.prototype,"messageBody",void 0),Jd([de()],ec.prototype,"_isMobile",void 0),Jd([de()],ec.prototype,"messages",void 0),Jd([de()],ec.prototype,"isLoadingMessages",void 0),Jd([de()],ec.prototype,"hasReceivedConsent",void 0),Jd([de()],ec.prototype,"privacyPolicyUrl",void 0),Jd([de()],ec.prototype,"websitePreviewMapping",void 0),ec=Jd([se("pubnub-chat")],ec);const tc="cdn.skypack.dev/@meetelise/chat",nc="cdn.eliseai.com/@meetelise/chat",ic=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(tc)||n.includes(tc))return"skypack";if(e.includes(nc)||n.includes(nc))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},rc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,oc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},ac="https://applications.eliseai.com",sc=["Check Availability","Apply Now"],lc=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&sc.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),jo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:Bo.info,buildingSlug:i,orgSlug:n}),!0},uc=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&lc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)lc(s[e],t,n,i)}},dc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)lc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)uc(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class cc{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Rr(Br(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=mo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Ro()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));jo({logType:Bo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=zo(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Rr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Wr(e.timestampInitiallyLogged).getTime()-Wr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Rr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Wr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var hc,pc=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 fc=hc=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=_r(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=fo.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=_c.Default,this.onWidgetLoaded=Rl(),this.onSstClose=Rl(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;const e=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return Zo(n.data)}(this.orgSlug):await Xo(this.orgSlug,this.buildingSlug);if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{ic(this.orgSlug,this.buildingSlug)}catch(e){}await Ga(e,this.buildingSlug,this.orgSlug)&&(Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==e?void 0:e.launchedDateTime)?.01:.05}),this.buildingWebchatView=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0))},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,N,M,D,L,U,R,B,j,F,H,G,z,Q,W,V,q,Y;const K=this.buildingWebchatView;if(!K)return;K&&this.orgSlug&&mc(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const X=K.featureFlagWebchatMarketingSourceDropdownConfiguration,Z=K.featureFlagWebchatUseDniPhoneNumberBySource,J=K.featureFlagInsertDniIntoWebsite,ee=K.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var te;te=bo.includes(K.orgId),wo=te;const[ne,ie,re]=await Promise.all([au(this.orgSlug,this.buildingSlug),go(this.buildingSlug),lu(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Gn(K.phoneNumber),this.buildingWebchatView.isAip=re),this.leadSources=ne,this.featureFlagShowDropdown=X;const oe=K.textWithUsPhoneNumber?K.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return jo({logType:Bo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),ae=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,se=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,le={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!oe)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!oe)&&void 0!==S&&S,sstDesktop:null!==(E=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(k=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==k&&k,calcDesktop:ae,calcMobile:se};var ue,de;this.enabledChatWidgets=Ql(le),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(de=this.handleTourClicked,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",e=>{e.preventDefault(),de(e)})}),ee&&(e=>{document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(t=>{t&&t.addEventListener("click",t=>{t.preventDefault(),e(t)})})})(this.handleTourClicked),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(_=this.LeadSourceClient)||void 0===_?void 0:_.leadSource)&&(ue=null!==(P=null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&void 0!==P?P:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(ue)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(I=this.buildingWebchatView.primaryColor)&&void 0!==I?I:null,this.backgroundColor=null!==(N=this.buildingWebchatView.secondaryColor)&&void 0!==N?N:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(M=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==M?M:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==D?D:null,this.webchatConfigHasAutoOpenChat=null!==(L=this.buildingWebchatView.autoOpenChat)&&void 0!==L&&L,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(R=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==R&&R,this.privacyPolicyUrl=null!==(B=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==B?B:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===Vo.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===Vo.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===Vo.EMOJI&&(this.designConcept=Vo.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=qn),null===this.backgroundColor&&(this.backgroundColor=Yn);const ce=null!==(F=null===(j=this.buildingWebchatView)||void 0===j?void 0:j.phoneNumber)&&void 0!==F?F:"";let he=null;if(Z&&(he=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Gn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(G=null===(H=this.LeadSourceClient)||void 0===H?void 0:H.leadSource)&&void 0!==G?G:null),he&&!he.isMatch&&(he.number=ce)),J&&(null==he?void 0:he.number)){const e=Pu(he.number,this.orgSlug,this.buildingSlug);e>0&&Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const pe=localStorage.getItem("eliseai_phone_number_devtest");pe&&Pu(pe,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=he||{number:ce,isMatch:!1,isPropertyWebsiteCatchall:!0};const fe=null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null;fe&&(this.leadSources.includes(fe)||this.leadSources.push(fe)),io(K.id);if((ie||(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isAip))&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.isLiveOnApplications)&&this.buildingSlug){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=rc(o,e);l.setAttribute("href",s),a++,jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:Bo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:Bo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&Fo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug)try{(e=>{const t=oc[e];if(!t)return 0;const n=`${ac}/building/${t}/units`,i=`${ac}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&dc(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=xu(this.buildingSlug),c=$u(this.buildingSlug,d),h=c?d:Cu(this.buildingSlug,!1);if(!h.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Qo,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new cc(this.orgSlug,this.buildingSlug),this.myPubnub=new ku(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,h.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const p=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,c&&null!==(n=h.leadId)&&void 0!==n?n:void 0);p&&Cu(this.buildingSlug,h.initiatedChat,p.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const f=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));f&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(f),"property-website"!==zo(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:zo(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const g=xu(this.buildingSlug);g.initiatedChat&&await this.myPubnub.initializePubnub(g)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Gr(Wr(t)));return!!e&&!!n&&!_r()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Rr(function(e,t){return ni(2,arguments),vi(e,6e4*bi(t))}(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.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let d=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&d.push(...this.collectFocusableElements(e)),t&&d.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(d=this.collectFocusableElements(e))}if(0===d.length)return;e.preventDefault();const c=this.getDeepActiveElement(),h=d.findIndex(e=>e===c);d[e.shiftKey?(h-1+d.length)%d.length:(h+1)%d.length].focus()},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,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Uo(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),wu(this.buildingSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),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),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=Or(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches(hc.FOCUSABLE_SELECTOR)&&hc.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){jo({logType:Bo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,N,M,D,L,U,B,j,F,H,G,z,Q;Hl();const W=this.hideLauncher&&!this.isLoading&&!this._isMobile;return R`
|
|
7185
7207
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7186
7208
|
${this.displayPubnubChat?R`
|
|
7187
7209
|
<pubnub-chat
|
|
@@ -7385,6 +7407,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7385
7407
|
aria-label="Close chat"
|
|
7386
7408
|
>
|
|
7387
7409
|
<svg
|
|
7410
|
+
aria-hidden="true"
|
|
7411
|
+
focusable="false"
|
|
7388
7412
|
width="16"
|
|
7389
7413
|
height="10"
|
|
7390
7414
|
viewBox="0 0 16 10"
|
|
@@ -7410,6 +7434,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7410
7434
|
aria-label="Open chat"
|
|
7411
7435
|
>
|
|
7412
7436
|
<svg
|
|
7437
|
+
aria-hidden="true"
|
|
7438
|
+
focusable="false"
|
|
7413
7439
|
width="24"
|
|
7414
7440
|
height="24"
|
|
7415
7441
|
viewBox="0 0 24 24"
|