@meetelise/chat 1.16.0 → 1.18.0
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
|
@@ -1047,7 +1047,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1047
1047
|
margin-top: 37px;
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
|
-
`,ln([oe({attribute:!1})],dn.prototype,"layoutOptions",void 0),ln([oe({attribute:!1})],dn.prototype,"tourTypeOptions",void 0),ln([oe({type:Number})],dn.prototype,"buildingId",void 0),ln([oe({attribute:!1})],dn.prototype,"onCloseClicked",void 0),ln([ae()],dn.prototype,"tourType",void 0),ln([ae()],dn.prototype,"shouldShowTourType",void 0),ln([ae()],dn.prototype,"email",void 0),ln([ae()],dn.prototype,"phoneNumber",void 0),ln([ae()],dn.prototype,"availabilitiesGroupedByDay",void 0),ln([ae()],dn.prototype,"waitingForAvailabilities",void 0),ln([ae()],dn.prototype,"selectedDate",void 0),ln([ae()],dn.prototype,"selectedTime",void 0),ln([ae()],dn.prototype,"mobilePageIndex",void 0),ln([ae()],dn.prototype,"isSubmitting",void 0),ln([ae()],dn.prototype,"tourIsBooked",void 0),ln([se(".inputContainer#firstName input")],dn.prototype,"firstNameInput",void 0),ln([se(".inputContainer#lastName input")],dn.prototype,"lastNameInput",void 0),ln([se(".inputContainer#email input")],dn.prototype,"emailInput",void 0),ln([se(".inputContainer#phone input")],dn.prototype,"phoneInput",void 0),ln([se("me-select#unitType")],dn.prototype,"unitTypeSelect",void 0),dn=ln([ie("tour-scheduler")],dn),function(e){e[e.Guided=0]="Guided",e[e.Self=1]="Self",e[e.Virtual=2]="Virtual"}(cn||(cn={}));const pn={[cn.Guided]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[cn.Self]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[cn.Virtual]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},fn={[cn.Guided]:"escorted-tour",[cn.Self]:"self-guided-tour",[cn.Virtual]:"live-virtual-tour"};class hn{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}campaignSources(){var e,t,n;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;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}}ping(e){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:this.campaignSources()})})}}var mn,vn=new Uint8Array(16);function gn(){if(!mn&&!(mn="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 mn(vn)}const yn=/^(?:[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,wn=function(e){return"string"==typeof e&&yn.test(e)};for(var bn=[],Sn=0;Sn<256;++Sn)bn.push((Sn+256).toString(16).substr(1));const Tn=function(e,t,n){var i=(e=e||{}).random||(e.rng||gn)();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 function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(bn[e[t+0]]+bn[e[t+1]]+bn[e[t+2]]+bn[e[t+3]]+"-"+bn[e[t+4]]+bn[e[t+5]]+"-"+bn[e[t+6]]+bn[e[t+7]]+"-"+bn[e[t+8]]+bn[e[t+9]]+"-"+bn[e[t+10]]+bn[e[t+11]]+bn[e[t+12]]+bn[e[t+13]]+bn[e[t+14]]+bn[e[t+15]]).toLowerCase();if(!wn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function xn(e,t){const n=In(e,t),i=Tn();return localStorage.setItem(n,i),On(e,t),i}function On(e,t){const n=Rn(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function In(e,t){return`com.meetelise.chatID-${e}-${t}`}function Rn(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const Nn="#FFFFFF",An="#202020",Cn={user:{textColor:Nn,backgroundColor:"#1990FF"},agent:{textColor:Nn,backgroundColor:"#1E1E1E"}},_n={user:{textColor:Nn,backgroundColor:"#83818E"},agent:{textColor:Nn,backgroundColor:An}},En={Light:{chatHeader:{backgroundColor:Nn,textColor:An},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:Cn},Dark:{chatHeader:{backgroundColor:An,textColor:Nn},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:Cn},Purple:{chatHeader:{backgroundColor:"#550098",textColor:Nn},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:Cn},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:Nn},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:Cn},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:An},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:_n},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:Nn},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:Cn},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:An},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:_n},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:Nn},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:Cn},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:Nn},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:Cn}},Fn=e=>En[e&&Object.keys(En).includes(e)?e:"Light"];function Mn(e,t,n,i,r,o){var a;const s=new Oe.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===_n).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://s3.us-west-2.amazonaws.com/meetelise.com/looping-gradient.gif"},u}const Pn=a`
|
|
1050
|
+
`,ln([oe({attribute:!1})],dn.prototype,"layoutOptions",void 0),ln([oe({attribute:!1})],dn.prototype,"tourTypeOptions",void 0),ln([oe({type:Number})],dn.prototype,"buildingId",void 0),ln([oe({attribute:!1})],dn.prototype,"onCloseClicked",void 0),ln([ae()],dn.prototype,"tourType",void 0),ln([ae()],dn.prototype,"shouldShowTourType",void 0),ln([ae()],dn.prototype,"email",void 0),ln([ae()],dn.prototype,"phoneNumber",void 0),ln([ae()],dn.prototype,"availabilitiesGroupedByDay",void 0),ln([ae()],dn.prototype,"waitingForAvailabilities",void 0),ln([ae()],dn.prototype,"selectedDate",void 0),ln([ae()],dn.prototype,"selectedTime",void 0),ln([ae()],dn.prototype,"mobilePageIndex",void 0),ln([ae()],dn.prototype,"isSubmitting",void 0),ln([ae()],dn.prototype,"tourIsBooked",void 0),ln([se(".inputContainer#firstName input")],dn.prototype,"firstNameInput",void 0),ln([se(".inputContainer#lastName input")],dn.prototype,"lastNameInput",void 0),ln([se(".inputContainer#email input")],dn.prototype,"emailInput",void 0),ln([se(".inputContainer#phone input")],dn.prototype,"phoneInput",void 0),ln([se("me-select#unitType")],dn.prototype,"unitTypeSelect",void 0),dn=ln([ie("tour-scheduler")],dn),function(e){e[e.Guided=0]="Guided",e[e.Self=1]="Self",e[e.Virtual=2]="Virtual"}(cn||(cn={}));const pn={[cn.Guided]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[cn.Self]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[cn.Virtual]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},fn={[cn.Guided]:"escorted-tour",[cn.Self]:"self-guided-tour",[cn.Virtual]:"live-virtual-tour"};class hn{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}campaignSources(){var e,t,n;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;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}}ping(e){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:this.campaignSources()})})}}var mn,vn=new Uint8Array(16);function gn(){if(!mn&&!(mn="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 mn(vn)}const yn=/^(?:[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,wn=function(e){return"string"==typeof e&&yn.test(e)};for(var bn=[],Sn=0;Sn<256;++Sn)bn.push((Sn+256).toString(16).substr(1));const Tn=function(e,t,n){var i=(e=e||{}).random||(e.rng||gn)();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 function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(bn[e[t+0]]+bn[e[t+1]]+bn[e[t+2]]+bn[e[t+3]]+"-"+bn[e[t+4]]+bn[e[t+5]]+"-"+bn[e[t+6]]+bn[e[t+7]]+"-"+bn[e[t+8]]+bn[e[t+9]]+"-"+bn[e[t+10]]+bn[e[t+11]]+bn[e[t+12]]+bn[e[t+13]]+bn[e[t+14]]+bn[e[t+15]]).toLowerCase();if(!wn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function xn(e,t){const n=In(e,t),i=Tn();return localStorage.setItem(n,i),On(e,t),i}function On(e,t){const n=Rn(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function In(e,t){return`com.meetelise.chatID-${e}-${t}`}function Rn(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const Nn="#FFFFFF",An="#202020",Cn={user:{textColor:Nn,backgroundColor:"#1990FF"},agent:{textColor:Nn,backgroundColor:"#1E1E1E"}},_n={user:{textColor:Nn,backgroundColor:"#83818E"},agent:{textColor:Nn,backgroundColor:An}},En={Light:{chatHeader:{backgroundColor:Nn,textColor:An},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:Cn},Dark:{chatHeader:{backgroundColor:An,textColor:Nn},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:Cn},Purple:{chatHeader:{backgroundColor:"#550098",textColor:Nn},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:Cn},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:Nn},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:Cn},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:An},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:_n},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:Nn},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:Cn},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:An},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:_n},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:Nn},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:Cn},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:Nn},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:Cn}},Fn=e=>En[e&&Object.keys(En).includes(e)?e:"Light"];function Mn(e,t,n,i,r,o){var a;const s=new Oe.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===_n).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://s3.us-west-2.amazonaws.com/meetelise.com/looping-gradient.gif"},u}const Pn=a`
|
|
1051
1051
|
:host {
|
|
1052
1052
|
--glowBarHeight: 11.2px;
|
|
1053
1053
|
--enterAnimationDuration: 0.5s;
|
|
@@ -1863,7 +1863,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1863
1863
|
.call-us-window__open-times {
|
|
1864
1864
|
text-transform: lowercase;
|
|
1865
1865
|
}
|
|
1866
|
-
`],Kn([oe({attribute:!1})],Zn.prototype,"onCloseClicked",void 0),Kn([oe()],Zn.prototype,"phoneNumber",void 0),Kn([oe({attribute:!1})],Zn.prototype,"buildingId",void 0),Kn([oe({attribute:!1})],Zn.prototype,"officeHoursTextInfo",void 0),Zn=Kn([ie("call-us-window")],Zn);const Yn={};var ei=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 ti=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.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],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.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(Yn[e])return Yn[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return Yn[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId
|
|
1866
|
+
`],Kn([oe({attribute:!1})],Zn.prototype,"onCloseClicked",void 0),Kn([oe()],Zn.prototype,"phoneNumber",void 0),Kn([oe({attribute:!1})],Zn.prototype,"buildingId",void 0),Kn([oe({attribute:!1})],Zn.prototype,"officeHoursTextInfo",void 0),Zn=Kn([ie("call-us-window")],Zn);const Yn={};var ei=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 ti=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.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],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.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(Yn[e])return Yn[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return Yn[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&(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`
|
|
1867
1867
|
<div
|
|
1868
1868
|
@click=${this.onClickEmailOption}
|
|
1869
1869
|
class="launcher__call-to-action-option"
|
|
@@ -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
|
|
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!==(
|
|
2092
|
-
.layoutOptions=${null!==(
|
|
2093
|
-
.tourTypeOptions=${null!==(
|
|
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!==(
|
|
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
|
-
`
|
|
2102
|
+
`}};yi.styles=a`
|
|
2103
2103
|
:host {
|
|
2104
2104
|
all: initial;
|
|
2105
2105
|
}
|
|
@@ -85,13 +85,13 @@ export class Launcher extends LitElement {
|
|
|
85
85
|
);
|
|
86
86
|
this.hasTextUsEnabled =
|
|
87
87
|
registeredPhoneNumbers.length > 0 && this.buildingId !== 4895;
|
|
88
|
-
// TODO: replace this with
|
|
88
|
+
// TODO: replace this with the real API call once the endpoint exists
|
|
89
89
|
const schedulingIsEnabled = await (async function putApiCallHere(
|
|
90
90
|
buildingId: number
|
|
91
91
|
) {
|
|
92
92
|
return !!buildingId;
|
|
93
93
|
})(this.buildingId);
|
|
94
|
-
if (
|
|
94
|
+
if (schedulingIsEnabled) {
|
|
95
95
|
this.hasSSTEnabled = true;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -24,7 +24,10 @@ export default function createConversation(
|
|
|
24
24
|
const conversation = session.getOrCreateConversation(chatID);
|
|
25
25
|
conversation.setParticipant(session.me);
|
|
26
26
|
conversation.setParticipant(agent);
|
|
27
|
-
conversation.subject =
|
|
27
|
+
conversation.subject =
|
|
28
|
+
building.orgId === 16
|
|
29
|
+
? "Leasing team" // by AVB request
|
|
30
|
+
: building.chatTitle ?? building.userFirstName;
|
|
28
31
|
conversation.custom = {
|
|
29
32
|
buildingId: building.id.toString(),
|
|
30
33
|
userId: building.userId.toString(),
|