@meetelise/chat 1.13.1 → 1.13.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/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -1953,7 +1953,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1953
1953
|
</div>
|
|
1954
1954
|
`}
|
|
1955
1955
|
</div>
|
|
1956
|
-
`}};ei.styles=Mn,Yn([oe({type:Boolean})],ei.prototype,"isMobile",void 0),Yn([oe({type:Boolean})],ei.prototype,"isFirstMount",void 0),Yn([oe()],ei.prototype,"backgroundColor",void 0),Yn([oe()],ei.prototype,"textColor",void 0),Yn([oe({type:Boolean})],ei.prototype,"isMini",void 0),Yn([oe()],ei.prototype,"phoneNumber",void 0),Yn([oe({attribute:!1})],ei.prototype,"buildingId",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasEmailEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasSSTEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasTextUsEnabled",void 0),Yn([oe({attribute:!1})],ei.prototype,"layoutOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"tourTypeOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"onChatTapped",void 0),Yn([oe()],ei.prototype,"launcherStyles",void 0),Yn([ae()],ei.prototype,"isEmailWindowOpen",void 0),Yn([ae()],ei.prototype,"isCallUsWindowOpen",void 0),Yn([ae()],ei.prototype,"isSSTWindowOpen",void 0),Yn([ae()],ei.prototype,"isTextUsWindowOpen",void 0),ei=Yn([ie("meetelise-launcher")],ei);var ti=n(3379),ni=n.n(ti),ii=n(7795),ri=n.n(ii),oi=n(569),ai=n.n(oi),si=n(3565),ui=n.n(si),li=n(9216),di=n.n(li),ci=n(4589),pi=n.n(ci),fi=n(3631),hi={};hi.styleTagTransform=pi(),hi.setAttributes=ui(),hi.insert=ai().bind(null,"head"),hi.domAPI=ri(),hi.insertStyleElement=di(),ni()(fi.Z,hi),fi.Z&&fi.Z.locals&&fi.Z.locals;var mi,vi=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 gi=mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=An(),this.chatId="",this.analytics=null,this.isMobile=rn(),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),Yt(this.building.id),this.chatId=function(e,t){const n=Tn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=xn(e,t),i=localStorage.getItem(n)||Sn(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=An(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,n,i]=await Promise.all([this.building,this.theme,this.avatarSrc,mi.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,i,n),this.configureLauncherElement(),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(_n(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=bn(this.orgSlug,this.buildingSlug);const e=await mi.session;this.analytics.chatId=this.chatId,this.popup.select(_n(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
|
|
1956
|
+
`}};ei.styles=Mn,Yn([oe({type:Boolean})],ei.prototype,"isMobile",void 0),Yn([oe({type:Boolean})],ei.prototype,"isFirstMount",void 0),Yn([oe()],ei.prototype,"backgroundColor",void 0),Yn([oe()],ei.prototype,"textColor",void 0),Yn([oe({type:Boolean})],ei.prototype,"isMini",void 0),Yn([oe()],ei.prototype,"phoneNumber",void 0),Yn([oe({attribute:!1})],ei.prototype,"buildingId",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasEmailEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasSSTEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasTextUsEnabled",void 0),Yn([oe({attribute:!1})],ei.prototype,"layoutOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"tourTypeOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"onChatTapped",void 0),Yn([oe()],ei.prototype,"launcherStyles",void 0),Yn([ae()],ei.prototype,"isEmailWindowOpen",void 0),Yn([ae()],ei.prototype,"isCallUsWindowOpen",void 0),Yn([ae()],ei.prototype,"isSSTWindowOpen",void 0),Yn([ae()],ei.prototype,"isTextUsWindowOpen",void 0),ei=Yn([ie("meetelise-launcher")],ei);var ti=n(3379),ni=n.n(ti),ii=n(7795),ri=n.n(ii),oi=n(569),ai=n.n(oi),si=n(3565),ui=n.n(si),li=n(9216),di=n.n(li),ci=n(4589),pi=n.n(ci),fi=n(3631),hi={};hi.styleTagTransform=pi(),hi.setAttributes=ui(),hi.insert=ai().bind(null,"head"),hi.domAPI=ri(),hi.insertStyleElement=di(),ni()(fi.Z,hi),fi.Z&&fi.Z.locals&&fi.Z.locals;var mi,vi=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 gi=mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=An(),this.chatId="",this.analytics=null,this.isMobile=rn(),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),Yt(this.building.id),this.chatId=function(e,t){const n=Tn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=xn(e,t),i=localStorage.getItem(n)||Sn(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=An(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,n,i]=await Promise.all([this.building,this.theme,this.avatarSrc,mi.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,i,n),this.configureLauncherElement(),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(_n(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=bn(this.orgSlug,this.buildingSlug);const e=await mi.session;this.analytics.chatId=this.chatId,this.popup.select(_n(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;return 182===(null===(e=this.building)||void 0===e?void 0:e.orgId)||4930===(null===(t=this.building)||void 0===t?void 0:t.id)?D``:(window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ei),D`
|
|
1957
1957
|
<div
|
|
1958
1958
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
1959
1959
|
>
|
|
@@ -1962,11 +1962,11 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1962
1962
|
.isMobile=${this.isMobile}
|
|
1963
1963
|
.isFirstMount=${!this.hasMounted}
|
|
1964
1964
|
.isMini=${this.useMiniWidget}
|
|
1965
|
-
.buildingId=${null!==(
|
|
1966
|
-
.layoutOptions=${null!==(
|
|
1967
|
-
.tourTypeOptions=${null!==(
|
|
1965
|
+
.buildingId=${null!==(i=null===(n=this.building)||void 0===n?void 0:n.id)&&void 0!==i?i:0}
|
|
1966
|
+
.layoutOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.layoutOptions)&&void 0!==o?o:[]}
|
|
1967
|
+
.tourTypeOptions=${null!==(s=null===(a=this.building)||void 0===a?void 0:a.tourTypeOptions)&&void 0!==s?s:[]}
|
|
1968
1968
|
.launcherStyles=${this.launcherStyles}
|
|
1969
|
-
phoneNumber="${null!==(
|
|
1969
|
+
phoneNumber="${null!==(l=null===(u=this.building)||void 0===u?void 0:u.phoneNumber)&&void 0!==l?l:""}"
|
|
1970
1970
|
textColor="${this.theme.chatHeader.textColor}"
|
|
1971
1971
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
1972
1972
|
?hidden=${this.hideLauncher}
|