@meetelise/chat 1.20.30 → 1.20.32

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.30",
3
+ "version": "1.20.32",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -2202,7 +2202,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2202
2202
  </div>
2203
2203
  `}
2204
2204
  </div>
2205
- `}};Ei.styles=Yn,Ai([ae({type:Boolean})],Ei.prototype,"isMobile",void 0),Ai([ae({type:Boolean})],Ei.prototype,"isFirstMount",void 0),Ai([ae()],Ei.prototype,"backgroundColor",void 0),Ai([ae()],Ei.prototype,"textColor",void 0),Ai([ae({type:Boolean})],Ei.prototype,"isMini",void 0),Ai([ae({attribute:!1})],Ei.prototype,"autoOpenChatWidget",void 0),Ai([ae()],Ei.prototype,"phoneNumber",void 0),Ai([ae({attribute:!0})],Ei.prototype,"chatCallUsHeader",void 0),Ai([ae({attribute:!1})],Ei.prototype,"buildingId",void 0),Ai([ae({attribute:!0})],Ei.prototype,"buildingSlug",void 0),Ai([ae({attribute:!0})],Ei.prototype,"orgSlug",void 0),Ai([ae({attribute:!0})],Ei.prototype,"sgtUrl",void 0),Ai([ae({attribute:!0})],Ei.prototype,"buildingABTestType",void 0),Ai([ae({attribute:!0})],Ei.prototype,"escortedToursLink",void 0),Ai([ae({attribute:!0})],Ei.prototype,"virtualToursLink",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasCallUsEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasChatEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasEmailEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasSSTEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasTextUsEnabled",void 0),Ai([ae({attribute:!1})],Ei.prototype,"layoutOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"unitOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"tourTypeOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"onChatTapped",void 0),Ai([ae({attribute:!1})],Ei.prototype,"launcherStyles",void 0),Ai([se()],Ei.prototype,"isEmailWindowOpen",void 0),Ai([se()],Ei.prototype,"isCallUsWindowOpen",void 0),Ai([se()],Ei.prototype,"isSSTWindowOpen",void 0),Ai([se()],Ei.prototype,"isTextUsWindowOpen",void 0),Ei=Ai([re("meetelise-launcher")],Ei);var _i=n(3379),Fi=n.n(_i),Mi=n(7795),Pi=n.n(Mi),Di=n(569),qi=n.n(Di),Ui=n(3565),Ji=n.n(Ui),ki=n(9216),Li=n.n(ki),Bi=n(4589),ji=n.n(Bi),Hi=n(3631),Wi={};Wi.styleTagTransform=ji(),Wi.setAttributes=Ji(),Wi.insert=qi().bind(null,"head"),Wi.domAPI=Pi(),Wi.insertStyleElement=Li(),Fi()(Hi.Z,Wi),Hi.Z&&Hi.Z.locals&&Hi.Z.locals;var Gi,$i=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Vi=Gi=class extends ne{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Qn(),this.chatId="",this.analytics=null,this.isMobile=xn(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.myContactHeader=null,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t;if(!this.buildingSlug||!this.orgSlug)return;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);const n=await async function(e){try{return(await Qt().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}(this.buildingSlug);this.buildingABTestType=null!==(e=null==n?void 0:n.abTestType)&&void 0!==e?e:"",bn(this.building.id),this.chatId=function(e,t){const n=Wn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Gn(e,t),i=localStorage.getItem(n)||Hn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Qn(null!==(t=this.themeId)&&void 0!==t?t:this.building.themeId),this.analytics=new Mn(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,Gi.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)=>{var r;const o=n.createPopup(Kn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await o.mount({show:!1}),o.on("close",(()=>{this.hideLauncher=!1}));const a=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=a,!a)throw new Error("Failed to find chat window");a.classList.add("meetelise-chat","pane"),this.isMobile||a.classList.add("launcher__desktop"),a.style.zIndex="99999999999",this.popup=o;const s=sessionStorage.getItem("autoOpenedTimestamp"),u=!s||s&&tn(rn(s));e.autoOpenChatWidget&&u&&!xn()&&"close"!==this.buildingABTestType&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",Xt(function(e,t){Fe(2,arguments);var n=Xe(t);return Ze(e,6e4*n)}(new Date,15))),null===(r=this.analytics)||void 0===r||r.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=function(e){const t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY}}(this.talkjsPopupElement),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("contactTabPopup");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.top-50+"px"}},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),this.adjustTopHeaderContactCoords(),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&&Gi.session))return;this.chatId=jn(this.orgSlug,this.buildingSlug);const e=await Gi.session;this.analytics.chatId=this.chatId,this.popup.select(Kn(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")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}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,x,O,I,R,C,N,A;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Ei),D`
2205
+ `}};Ei.styles=Yn,Ai([ae({type:Boolean})],Ei.prototype,"isMobile",void 0),Ai([ae({type:Boolean})],Ei.prototype,"isFirstMount",void 0),Ai([ae()],Ei.prototype,"backgroundColor",void 0),Ai([ae()],Ei.prototype,"textColor",void 0),Ai([ae({type:Boolean})],Ei.prototype,"isMini",void 0),Ai([ae({attribute:!1})],Ei.prototype,"autoOpenChatWidget",void 0),Ai([ae()],Ei.prototype,"phoneNumber",void 0),Ai([ae({attribute:!0})],Ei.prototype,"chatCallUsHeader",void 0),Ai([ae({attribute:!1})],Ei.prototype,"buildingId",void 0),Ai([ae({attribute:!0})],Ei.prototype,"buildingSlug",void 0),Ai([ae({attribute:!0})],Ei.prototype,"orgSlug",void 0),Ai([ae({attribute:!0})],Ei.prototype,"sgtUrl",void 0),Ai([ae({attribute:!0})],Ei.prototype,"buildingABTestType",void 0),Ai([ae({attribute:!0})],Ei.prototype,"escortedToursLink",void 0),Ai([ae({attribute:!0})],Ei.prototype,"virtualToursLink",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasCallUsEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasChatEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasEmailEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasSSTEnabled",void 0),Ai([ae({type:Boolean})],Ei.prototype,"hasTextUsEnabled",void 0),Ai([ae({attribute:!1})],Ei.prototype,"layoutOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"unitOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"tourTypeOptions",void 0),Ai([ae({attribute:!1})],Ei.prototype,"onChatTapped",void 0),Ai([ae({attribute:!1})],Ei.prototype,"launcherStyles",void 0),Ai([se()],Ei.prototype,"isEmailWindowOpen",void 0),Ai([se()],Ei.prototype,"isCallUsWindowOpen",void 0),Ai([se()],Ei.prototype,"isSSTWindowOpen",void 0),Ai([se()],Ei.prototype,"isTextUsWindowOpen",void 0),Ei=Ai([re("meetelise-launcher")],Ei);var _i=n(3379),Fi=n.n(_i),Mi=n(7795),Pi=n.n(Mi),Di=n(569),qi=n.n(Di),Ui=n(3565),Ji=n.n(Ui),ki=n(9216),Li=n.n(ki),Bi=n(4589),ji=n.n(Bi),Hi=n(3631),Wi={};Wi.styleTagTransform=ji(),Wi.setAttributes=Ji(),Wi.insert=qi().bind(null,"head"),Wi.domAPI=Pi(),Wi.insertStyleElement=Li(),Fi()(Hi.Z,Wi),Hi.Z&&Hi.Z.locals&&Hi.Z.locals;var Gi,$i=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Vi=Gi=class extends ne{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Qn(),this.chatId="",this.analytics=null,this.isMobile=xn(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.myContactHeader=null,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t;if(!this.buildingSlug||!this.orgSlug)return;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);const n=await async function(e){try{return(await Qt().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}(this.buildingSlug);this.buildingABTestType=null!==(e=null==n?void 0:n.abTestType)&&void 0!==e?e:"",bn(this.building.id),this.chatId=function(e,t){const n=Wn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Gn(e,t),i=localStorage.getItem(n)||Hn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Qn(null!==(t=this.themeId)&&void 0!==t?t:this.building.themeId),this.analytics=new Mn(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},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,Gi.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)=>{var r;const o=n.createPopup(Kn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await o.mount({show:!1}),o.on("close",(()=>{this.hideLauncher=!1}));const a=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=a,!a)throw new Error("Failed to find chat window");a.classList.add("meetelise-chat","pane"),this.isMobile||a.classList.add("launcher__desktop"),a.style.zIndex="99999999999",this.popup=o;const s=sessionStorage.getItem("autoOpenedTimestamp"),u=!s||s&&tn(rn(s));e.autoOpenChatWidget&&u&&!xn()&&"close"!==this.buildingABTestType&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",Xt(function(e,t){Fe(2,arguments);var n=Xe(t);return Ze(e,6e4*n)}(new Date,15))),null===(r=this.analytics)||void 0===r||r.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}(this.talkjsPopupElement),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("contactTabPopup");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.top-50+"px"}},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),this.adjustTopHeaderContactCoords(),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&&Gi.session))return;this.chatId=jn(this.orgSlug,this.buildingSlug);const e=await Gi.session;this.analytics.chatId=this.chatId,this.popup.select(Kn(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")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}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,x,O,I,R,C,N,A;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Ei),D`
2206
2206
  <div>
2207
2207
  <div
2208
2208
  id="contactTabPopup"
@@ -165,6 +165,7 @@ export class MEChat extends LitElement {
165
165
  this.buildingSlug,
166
166
  this.chatId
167
167
  );
168
+ this.analytics.ping("webchat_heartbeat");
168
169
  };
169
170
 
170
171
  private initializeLaunchJS = async () => {
@@ -493,7 +494,7 @@ declare global {
493
494
  function getOffset(el: Element) {
494
495
  const rect = el.getBoundingClientRect();
495
496
  return {
496
- left: rect.left + window.scrollX,
497
- top: rect.top + window.scrollY,
497
+ left: rect.left,
498
+ top: rect.top,
498
499
  };
499
500
  }