@meetelise/chat 1.20.9 → 1.20.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.20.9",
3
+ "version": "1.20.11",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -610,7 +610,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
610
610
  <me-select
611
611
  id="layoutType"
612
612
  placeholder="Select layout"
613
- .options="${_n(this.layoutOptions).map((e=>{return{label:(t=e,"studio"==t?"Studio":{"1br":"1 bedroom","2br":"2 bedrooms","3br":"3 bedrooms","4br":"4 bedrooms","5br":"5 bedrooms","6br":"6 bedrooms","7br":"7 bedrooms","8br":"8 bedrooms","9br":"9 bedrooms","10br":"10 bedroom"}[t]),value:e};var t}))}"
613
+ .options="${_n(this.layoutOptions).map((e=>{return{label:(t=e,"studio"==t?"Studio":{"1br":"1 bedroom","2br":"2 bedroom","3br":"3 bedroom","4br":"4 bedroom","5br":"5 bedroom","6br":"6 bedroom","7br":"7 bedroom","8br":"8 bedroom","9br":"9 bedroom","10br":"10 bedroom"}[t]),value:e};var t}))}"
614
614
  defaultOption="Studio"
615
615
  @change=${()=>{this.requestUpdate()}}
616
616
  >Studio
@@ -1922,7 +1922,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
1922
1922
  .call-us-window__open-times {
1923
1923
  text-transform: lowercase;
1924
1924
  }
1925
- `],hi([oe({attribute:!1})],mi.prototype,"onCloseClicked",void 0),hi([oe()],mi.prototype,"phoneNumber",void 0),hi([oe({attribute:!1})],mi.prototype,"buildingId",void 0),hi([oe({attribute:!0})],mi.prototype,"chatCallUsHeader",void 0),hi([oe({attribute:!1})],mi.prototype,"officeHoursTextInfo",void 0),mi=hi([ie("call-us-window")],mi);const vi={};var gi=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 yi=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.chatCallUsHeader="Call us",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=we(),this.textUsWindowRef=we(),this.tourSchedulerRef=we(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(vi[e])return vi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Zt().get(t);return vi[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return D`
1925
+ `],hi([oe({attribute:!1})],mi.prototype,"onCloseClicked",void 0),hi([oe()],mi.prototype,"phoneNumber",void 0),hi([oe({attribute:!1})],mi.prototype,"buildingId",void 0),hi([oe({attribute:!0})],mi.prototype,"chatCallUsHeader",void 0),hi([oe({attribute:!1})],mi.prototype,"officeHoursTextInfo",void 0),mi=hi([ie("call-us-window")],mi);const vi={};var gi=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 yi=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.autoOpenChatWidget=!1,this.phoneNumber="",this.chatCallUsHeader="Call us",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=we(),this.textUsWindowRef=we(),this.tourSchedulerRef=we(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(vi[e])return vi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Zt().get(t);return vi[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return D`
1926
1926
  <div
1927
1927
  @click=${this.onClickEmailOption}
1928
1928
  class="launcher__call-to-action-option"
@@ -2146,7 +2146,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2146
2146
  </div>
2147
2147
  `}
2148
2148
  </div>
2149
- `}};yi.styles=Qn,gi([oe({type:Boolean})],yi.prototype,"isMobile",void 0),gi([oe({type:Boolean})],yi.prototype,"isFirstMount",void 0),gi([oe()],yi.prototype,"backgroundColor",void 0),gi([oe()],yi.prototype,"textColor",void 0),gi([oe({type:Boolean})],yi.prototype,"isMini",void 0),gi([oe()],yi.prototype,"phoneNumber",void 0),gi([oe({attribute:!0})],yi.prototype,"chatCallUsHeader",void 0),gi([oe({attribute:!1})],yi.prototype,"buildingId",void 0),gi([oe({attribute:!0})],yi.prototype,"buildingSlug",void 0),gi([oe({attribute:!0})],yi.prototype,"orgSlug",void 0),gi([oe({type:Boolean})],yi.prototype,"hasCallUsEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasChatEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasEmailEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasSSTEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasTextUsEnabled",void 0),gi([oe({attribute:!1})],yi.prototype,"layoutOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"unitOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"tourTypeOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"onChatTapped",void 0),gi([oe({attribute:!1})],yi.prototype,"launcherStyles",void 0),gi([ae()],yi.prototype,"isEmailWindowOpen",void 0),gi([ae()],yi.prototype,"isCallUsWindowOpen",void 0),gi([ae()],yi.prototype,"isSSTWindowOpen",void 0),gi([ae()],yi.prototype,"isTextUsWindowOpen",void 0),yi=gi([ie("meetelise-launcher")],yi);var bi=n(3379),wi=n.n(bi),Si=n(7795),Ti=n.n(Si),xi=n(569),Oi=n.n(xi),Ii=n(3565),Ri=n.n(Ii),Ni=n(9216),Ai=n.n(Ni),Ci=n(4589),_i=n.n(Ci),Ei=n(3631),Fi={};Fi.styleTagTransform=_i(),Fi.setAttributes=Ri(),Fi.insert=Oi().bind(null,"head"),Fi.domAPI=Ti(),Fi.insertStyleElement=Ai(),wi()(Ei.Z,Fi),Ei.Z&&Ei.Z.locals&&Ei.Z.locals;var Mi,Pi=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Di=Mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Xn(),this.chatId="",this.analytics=null,this.isMobile=Sn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=we(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n="https://app.meetelise.com",i=`${n}/api/pub/v1/organization/${e}/building/${t}`,r=await fetch(i),o=await r.json(),a=await fetch(`${n}/eliseCrmApi/pub/building/${t}/units`),s=await a.json(),u=await fetch(`${n}/eliseCrmApi/pub/building/${t}/layouts`),l=await u.json();return o.unitOptionsV2=s,o.layoutOptionsV2=l,o}(this.orgSlug,this.buildingSlug),gn(this.building.id),this.chatId=function(e,t){const n=jn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Hn(e,t),i=localStorage.getItem(n)||Bn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Ln(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Xn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new En(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,Mi.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{const r=n.createPopup(Zn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&Mi.session))return;this.chatId=Ln(this.orgSlug,this.buildingSlug);const e=await Mi.session;this.analytics.chatId=this.chatId,this.popup.select(Zn(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",yi),D`
2149
+ `}};yi.styles=Qn,gi([oe({type:Boolean})],yi.prototype,"isMobile",void 0),gi([oe({type:Boolean})],yi.prototype,"isFirstMount",void 0),gi([oe()],yi.prototype,"backgroundColor",void 0),gi([oe()],yi.prototype,"textColor",void 0),gi([oe({type:Boolean})],yi.prototype,"isMini",void 0),gi([oe({attribute:!1})],yi.prototype,"autoOpenChatWidget",void 0),gi([oe()],yi.prototype,"phoneNumber",void 0),gi([oe({attribute:!0})],yi.prototype,"chatCallUsHeader",void 0),gi([oe({attribute:!1})],yi.prototype,"buildingId",void 0),gi([oe({attribute:!0})],yi.prototype,"buildingSlug",void 0),gi([oe({attribute:!0})],yi.prototype,"orgSlug",void 0),gi([oe({type:Boolean})],yi.prototype,"hasCallUsEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasChatEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasEmailEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasSSTEnabled",void 0),gi([oe({type:Boolean})],yi.prototype,"hasTextUsEnabled",void 0),gi([oe({attribute:!1})],yi.prototype,"layoutOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"unitOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"tourTypeOptions",void 0),gi([oe({attribute:!1})],yi.prototype,"onChatTapped",void 0),gi([oe({attribute:!1})],yi.prototype,"launcherStyles",void 0),gi([ae()],yi.prototype,"isEmailWindowOpen",void 0),gi([ae()],yi.prototype,"isCallUsWindowOpen",void 0),gi([ae()],yi.prototype,"isSSTWindowOpen",void 0),gi([ae()],yi.prototype,"isTextUsWindowOpen",void 0),yi=gi([ie("meetelise-launcher")],yi);var bi=n(3379),wi=n.n(bi),Si=n(7795),Ti=n.n(Si),xi=n(569),Oi=n.n(xi),Ii=n(3565),Ri=n.n(Ii),Ni=n(9216),Ai=n.n(Ni),Ci=n(4589),_i=n.n(Ci),Ei=n(3631),Fi={};Fi.styleTagTransform=_i(),Fi.setAttributes=Ri(),Fi.insert=Oi().bind(null,"head"),Fi.domAPI=Ti(),Fi.insertStyleElement=Ai(),wi()(Ei.Z,Fi),Ei.Z&&Ei.Z.locals&&Ei.Z.locals;var Mi,Pi=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Di=Mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Xn(),this.chatId="",this.analytics=null,this.isMobile=Sn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=we(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n="https://app.meetelise.com",i=`${n}/api/pub/v1/organization/${e}/building/${t}`,r=await fetch(i),o=await r.json(),a=await fetch(`${n}/eliseCrmApi/pub/building/${t}/units`),s=await a.json(),u=await fetch(`${n}/eliseCrmApi/pub/building/${t}/layouts`),l=await u.json();return o.unitOptionsV2=s,o.layoutOptionsV2=l,o}(this.orgSlug,this.buildingSlug),gn(this.building.id),this.chatId=function(e,t){const n=jn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Hn(e,t),i=localStorage.getItem(n)||Bn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Ln(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Xn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new En(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,Mi.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{const r=n.createPopup(Zn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r,e.autoOpenChatWidget&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0)},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&Mi.session))return;this.chatId=Ln(this.orgSlug,this.buildingSlug);const e=await Mi.session;this.analytics.chatId=this.chatId,this.popup.select(Zn(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S,T;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",yi),D`
2150
2150
  <div
2151
2151
  class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
2152
2152
  >
@@ -2160,18 +2160,19 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2160
2160
  .unitOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.unitOptionsV2)&&void 0!==o?o:[]}
2161
2161
  .tourTypeOptions=${null!==(s=null===(a=this.building)||void 0===a?void 0:a.tourTypeOptions)&&void 0!==s?s:[]}
2162
2162
  .launcherStyles=${this.launcherStyles}
2163
- chatCallUsHeader=${null!==(l=null===(u=this.building)||void 0===u?void 0:u.chatCallUsHeader)&&void 0!==l?l:"Call us"}
2164
- phoneNumber="${null!==(c=null===(d=this.building)||void 0===d?void 0:d.phoneNumber)&&void 0!==c?c:""}"
2163
+ .autoOpenChatWidget=${null!==(u=this.building.autoOpenChatWidget)&&void 0!==u&&u}
2164
+ chatCallUsHeader=${null!==(d=null===(l=this.building)||void 0===l?void 0:l.chatCallUsHeader)&&void 0!==d?d:"Call us"}
2165
+ phoneNumber="${null!==(p=null===(c=this.building)||void 0===c?void 0:c.phoneNumber)&&void 0!==p?p:""}"
2165
2166
  textColor="${this.theme.chatHeader.textColor}"
2166
2167
  backgroundColor="${this.theme.chatPaneBackgroundColor}"
2167
2168
  orgSlug="${this.orgSlug}"
2168
2169
  buildingSlug="${this.buildingSlug}"
2169
2170
  ?hidden=${this.hideLauncher}
2170
- ?hasCallUsEnabled=${!(null===(p=this.building)||void 0===p?void 0:p.chatWidgets)||(null===(f=this.building)||void 0===f?void 0:f.chatWidgets.includes("CALL"))}
2171
- ?hasChatEnabled=${!(null===(h=this.building)||void 0===h?void 0:h.chatWidgets)||(null===(m=this.building)||void 0===m?void 0:m.chatWidgets.includes("CHAT"))}
2172
- ?hasEmailEnabled=${!(null===(v=this.building)||void 0===v?void 0:v.chatWidgets)||(null===(g=this.building)||void 0===g?void 0:g.chatWidgets.includes("EMAIL"))}
2173
- ?hasTextUsEnabled=${!(null===(y=this.building)||void 0===y?void 0:y.chatWidgets)||(null===(b=this.building)||void 0===b?void 0:b.chatWidgets.includes("SMS"))}
2174
- ?hasSSTEnabled=${!(null===(w=this.building)||void 0===w?void 0:w.chatWidgets)||(null===(S=this.building)||void 0===S?void 0:S.chatWidgets.includes("SST"))}
2171
+ ?hasCallUsEnabled=${!(null===(f=this.building)||void 0===f?void 0:f.chatWidgets)||(null===(h=this.building)||void 0===h?void 0:h.chatWidgets.includes("CALL"))}
2172
+ ?hasChatEnabled=${!(null===(m=this.building)||void 0===m?void 0:m.chatWidgets)||(null===(v=this.building)||void 0===v?void 0:v.chatWidgets.includes("CHAT"))}
2173
+ ?hasEmailEnabled=${!(null===(g=this.building)||void 0===g?void 0:g.chatWidgets)||(null===(y=this.building)||void 0===y?void 0:y.chatWidgets.includes("EMAIL"))}
2174
+ ?hasTextUsEnabled=${!(null===(b=this.building)||void 0===b?void 0:b.chatWidgets)||(null===(w=this.building)||void 0===w?void 0:w.chatWidgets.includes("SMS"))}
2175
+ ?hasSSTEnabled=${!(null===(S=this.building)||void 0===S?void 0:S.chatWidgets)||(null===(T=this.building)||void 0===T?void 0:T.chatWidgets.includes("SST"))}
2175
2176
  >
2176
2177
  </meetelise-launcher>`:""}
2177
2178
  </div>
@@ -31,6 +31,8 @@ export class Launcher extends LitElement {
31
31
 
32
32
  @property({ type: Boolean })
33
33
  isMini = true;
34
+ @property({ attribute: false })
35
+ autoOpenChatWidget = false;
34
36
 
35
37
  @property()
36
38
  phoneNumber = "";
@@ -31,14 +31,14 @@ const getHumanReadableLayout = (layout: string) => {
31
31
  if (layout == "studio") return "Studio";
32
32
  return {
33
33
  "1br": "1 bedroom",
34
- "2br": "2 bedrooms",
35
- "3br": "3 bedrooms",
36
- "4br": "4 bedrooms",
37
- "5br": "5 bedrooms",
38
- "6br": "6 bedrooms",
39
- "7br": "7 bedrooms",
40
- "8br": "8 bedrooms",
41
- "9br": "9 bedrooms",
34
+ "2br": "2 bedroom",
35
+ "3br": "3 bedroom",
36
+ "4br": "4 bedroom",
37
+ "5br": "5 bedroom",
38
+ "6br": "6 bedroom",
39
+ "7br": "7 bedroom",
40
+ "8br": "8 bedroom",
41
+ "9br": "9 bedroom",
42
42
  "10br": "10 bedroom",
43
43
  }[layout];
44
44
  };
@@ -221,11 +221,17 @@ export class MEChat extends LitElement {
221
221
  }
222
222
  (talkjsPopupElement as HTMLElement).style.zIndex = "99999999999";
223
223
  this.popup = popup;
224
+ if (building.autoOpenChatWidget) {
225
+ this.popup.show();
226
+ this.hideLauncher = true;
227
+ this.hasMounted = true;
228
+ }
224
229
  };
225
230
 
226
231
  /**
227
232
  * Remove the instance from the screen.
228
233
  *
234
+ *
229
235
  * Chat will be unusable after this. If you just need to hide the
230
236
  * chat button, use {@link MEChat#hide} instead.
231
237
  */
@@ -289,6 +295,7 @@ export class MEChat extends LitElement {
289
295
  .unitOptions=${this.building?.unitOptionsV2 ?? []}
290
296
  .tourTypeOptions=${this.building?.tourTypeOptions ?? []}
291
297
  .launcherStyles=${this.launcherStyles}
298
+ .autoOpenChatWidget=${this.building.autoOpenChatWidget ?? false}
292
299
  chatCallUsHeader=${this.building?.chatCallUsHeader ?? "Call us"}
293
300
  phoneNumber="${this.building?.phoneNumber ?? ""}"
294
301
  textColor="${this.theme.chatHeader.textColor}"
@@ -26,6 +26,7 @@ export interface Building {
26
26
  chatCallUsHeader?: string;
27
27
  unitOptionsV2: UnitV2[];
28
28
  layoutOptionsV2: string[];
29
+ autoOpenChatWidget: boolean;
29
30
  }
30
31
 
31
32
  export type UnitV2 = {