@meetelise/chat 1.17.0 → 1.17.1

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.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -2079,7 +2079,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2079
2079
  </div>
2080
2080
  `}
2081
2081
  </div>
2082
- `}};ti.styles=Pn,ei([oe({type:Boolean})],ti.prototype,"isMobile",void 0),ei([oe({type:Boolean})],ti.prototype,"isFirstMount",void 0),ei([oe()],ti.prototype,"backgroundColor",void 0),ei([oe()],ti.prototype,"textColor",void 0),ei([oe({type:Boolean})],ti.prototype,"isMini",void 0),ei([oe()],ti.prototype,"phoneNumber",void 0),ei([oe({attribute:!1})],ti.prototype,"buildingId",void 0),ei([oe({type:Boolean})],ti.prototype,"hasEmailEnabled",void 0),ei([oe({type:Boolean})],ti.prototype,"hasSSTEnabled",void 0),ei([oe({type:Boolean})],ti.prototype,"hasTextUsEnabled",void 0),ei([oe({attribute:!1})],ti.prototype,"layoutOptions",void 0),ei([oe({attribute:!1})],ti.prototype,"tourTypeOptions",void 0),ei([oe({attribute:!1})],ti.prototype,"onChatTapped",void 0),ei([oe({attribute:!1})],ti.prototype,"launcherStyles",void 0),ei([ae()],ti.prototype,"isEmailWindowOpen",void 0),ei([ae()],ti.prototype,"isCallUsWindowOpen",void 0),ei([ae()],ti.prototype,"isSSTWindowOpen",void 0),ei([ae()],ti.prototype,"isTextUsWindowOpen",void 0),ti=ei([ie("meetelise-launcher")],ti);var ni=n(3379),ii=n.n(ni),ri=n(7795),oi=n.n(ri),ai=n(569),si=n.n(ai),ui=n(3565),li=n.n(ui),di=n(9216),ci=n.n(di),pi=n(4589),fi=n.n(pi),hi=n(3631),mi={};mi.styleTagTransform=fi(),mi.setAttributes=li(),mi.insert=si().bind(null,"head"),mi.domAPI=oi(),mi.insertStyleElement=ci(),ii()(hi.Z,mi),hi.Z&&hi.Z.locals&&hi.Z.locals;var vi,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=vi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Fn(),this.chatId="",this.analytics=null,this.isMobile=on(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),en(this.building.id),this.chatId=function(e,t){const n=In(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Rn(e,t),i=localStorage.getItem(n)||On(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:xn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Fn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new hn(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,vi.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(Mn(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&&vi.session))return;this.chatId=xn(this.orgSlug,this.buildingSlug);const e=await vi.session;this.analytics.chatId=this.chatId,this.popup.select(Mn(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;return 4930===(null===(e=this.building)||void 0===e?void 0:e.id)?D``:(window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ti),D`
2082
+ `}};ti.styles=Pn,ei([oe({type:Boolean})],ti.prototype,"isMobile",void 0),ei([oe({type:Boolean})],ti.prototype,"isFirstMount",void 0),ei([oe()],ti.prototype,"backgroundColor",void 0),ei([oe()],ti.prototype,"textColor",void 0),ei([oe({type:Boolean})],ti.prototype,"isMini",void 0),ei([oe()],ti.prototype,"phoneNumber",void 0),ei([oe({attribute:!1})],ti.prototype,"buildingId",void 0),ei([oe({type:Boolean})],ti.prototype,"hasEmailEnabled",void 0),ei([oe({type:Boolean})],ti.prototype,"hasSSTEnabled",void 0),ei([oe({type:Boolean})],ti.prototype,"hasTextUsEnabled",void 0),ei([oe({attribute:!1})],ti.prototype,"layoutOptions",void 0),ei([oe({attribute:!1})],ti.prototype,"tourTypeOptions",void 0),ei([oe({attribute:!1})],ti.prototype,"onChatTapped",void 0),ei([oe({attribute:!1})],ti.prototype,"launcherStyles",void 0),ei([ae()],ti.prototype,"isEmailWindowOpen",void 0),ei([ae()],ti.prototype,"isCallUsWindowOpen",void 0),ei([ae()],ti.prototype,"isSSTWindowOpen",void 0),ei([ae()],ti.prototype,"isTextUsWindowOpen",void 0),ti=ei([ie("meetelise-launcher")],ti);var ni=n(3379),ii=n.n(ni),ri=n(7795),oi=n.n(ri),ai=n(569),si=n.n(ai),ui=n(3565),li=n.n(ui),di=n(9216),ci=n.n(di),pi=n(4589),fi=n.n(pi),hi=n(3631),mi={};mi.styleTagTransform=fi(),mi.setAttributes=li(),mi.insert=si().bind(null,"head"),mi.domAPI=oi(),mi.insertStyleElement=ci(),ii()(hi.Z,mi),hi.Z&&hi.Z.locals&&hi.Z.locals;var vi,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=vi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Fn(),this.chatId="",this.analytics=null,this.isMobile=on(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),en(this.building.id),this.chatId=function(e,t){const n=In(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Rn(e,t),i=localStorage.getItem(n)||On(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:xn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Fn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new hn(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,vi.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(Mn(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&&vi.session))return;this.chatId=xn(this.orgSlug,this.buildingSlug);const e=await vi.session;this.analytics.chatId=this.chatId,this.popup.select(Mn(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;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ti),D`
2083
2083
  <div
2084
2084
  class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
2085
2085
  >
@@ -2088,18 +2088,18 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2088
2088
  .isMobile=${this.isMobile}
2089
2089
  .isFirstMount=${!this.hasMounted}
2090
2090
  .isMini=${this.useMiniWidget}
2091
- .buildingId=${null!==(n=null===(t=this.building)||void 0===t?void 0:t.id)&&void 0!==n?n:0}
2092
- .layoutOptions=${null!==(r=null===(i=this.building)||void 0===i?void 0:i.layoutOptions)&&void 0!==r?r:[]}
2093
- .tourTypeOptions=${null!==(a=null===(o=this.building)||void 0===o?void 0:o.tourTypeOptions)&&void 0!==a?a:[]}
2091
+ .buildingId=${null!==(t=null===(e=this.building)||void 0===e?void 0:e.id)&&void 0!==t?t:0}
2092
+ .layoutOptions=${null!==(i=null===(n=this.building)||void 0===n?void 0:n.layoutOptions)&&void 0!==i?i:[]}
2093
+ .tourTypeOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.tourTypeOptions)&&void 0!==o?o:[]}
2094
2094
  .launcherStyles=${this.launcherStyles}
2095
- phoneNumber="${null!==(u=null===(s=this.building)||void 0===s?void 0:s.phoneNumber)&&void 0!==u?u:""}"
2095
+ phoneNumber="${null!==(s=null===(a=this.building)||void 0===a?void 0:a.phoneNumber)&&void 0!==s?s:""}"
2096
2096
  textColor="${this.theme.chatHeader.textColor}"
2097
2097
  backgroundColor="${this.theme.chatPaneBackgroundColor}"
2098
2098
  ?hidden=${this.hideLauncher}
2099
2099
  >
2100
2100
  </meetelise-launcher>
2101
2101
  </div>
2102
- `)}};yi.styles=a`
2102
+ `}};yi.styles=a`
2103
2103
  :host {
2104
2104
  all: initial;
2105
2105
  }
@@ -265,9 +265,6 @@ export class MEChat extends LitElement {
265
265
  };
266
266
 
267
267
  render(): TemplateResult {
268
- if (this.building?.id === 4930) {
269
- return html``;
270
- }
271
268
  installLauncher();
272
269
 
273
270
  return html`