@meetelise/chat 1.20.172 → 1.20.174
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/demo/index.html
CHANGED
|
@@ -117,13 +117,59 @@
|
|
|
117
117
|
<!-- Webpack dev server will serve the bundle, index.js, at the path '/' -->
|
|
118
118
|
<script type="module" async>
|
|
119
119
|
import MEChat from "/index.js";
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
MEChat.start({
|
|
121
|
+
// // 123 Main Street
|
|
122
|
+
// organization: "test-company",
|
|
123
|
+
// building: "e2e-test-yardi-building",
|
|
124
|
+
|
|
125
|
+
organization: "sares-regis",
|
|
126
|
+
building: "608d79ae-c4d6-11ed-b197-7f59c780fbbb",
|
|
127
|
+
mobileStyles: {
|
|
128
|
+
bottom: "100px",
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
// organization: "mill-creek",
|
|
132
|
+
// building: "5ec32c42-2548-11ec-b813-e361780537f5",
|
|
133
|
+
|
|
134
|
+
// organization: "d1a1060d-3844-48d4-a454-1ba26292bc69",
|
|
135
|
+
// building: "25feb690-c76f-11ed-83b9-a7aa9698a486",
|
|
136
|
+
|
|
137
|
+
// organization: "TT",
|
|
138
|
+
// building: "ffc97070-5c73-11ed-8507-77860136d3bf",
|
|
139
|
+
|
|
140
|
+
// AMLI
|
|
141
|
+
// organization: "amli",
|
|
142
|
+
// building: "6e43581c-c4a4-11ec-a62b-9311f60f23f8",
|
|
143
|
+
|
|
144
|
+
// organization: "d1a1060d-3844-48d4-a454-1ba26292bc69",
|
|
145
|
+
// building: "25fead9e-c76f-11ed-83b2-7b1e7b442e9f",
|
|
146
|
+
|
|
147
|
+
// Taylor Street Apartments
|
|
148
|
+
// organization: "test-company",
|
|
149
|
+
// building: "e2e-test-yardi-building",
|
|
150
|
+
|
|
151
|
+
// The Qual People
|
|
152
|
+
// organization: "Pacific Urban Residential",
|
|
153
|
+
// building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
|
|
154
|
+
|
|
155
|
+
// organization: "Pacific Urban Residential",
|
|
156
|
+
// building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
|
|
157
|
+
|
|
158
|
+
// Cambridge House
|
|
159
|
+
// organization: "elise-ai",
|
|
160
|
+
// building: "the-cambridge-house-3",
|
|
161
|
+
|
|
162
|
+
// Artistry on 10th
|
|
163
|
+
// organization: "lindy",
|
|
164
|
+
// building: "c4cfc3ec-c4da-11ec-bda4-43aed00ca1b2",
|
|
165
|
+
|
|
166
|
+
// brandColor: "#a44ef5",
|
|
167
|
+
|
|
168
|
+
// organization: "Pacific Urban Residential",
|
|
169
|
+
// building: "1ac49f90-6150-11ed-b327-1b3f05e7b9db",
|
|
170
|
+
|
|
171
|
+
// organization: "sparrow",
|
|
172
|
+
// building: "8e87ae6e-eae8-11ed-aae8-fb82f4692a79",
|
|
127
173
|
});
|
|
128
174
|
</script>
|
|
129
175
|
<main>
|
package/public/dist/index.js
CHANGED
|
@@ -3288,6 +3288,10 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3288
3288
|
box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
|
|
3289
3289
|
box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
|
|
3290
3290
|
}
|
|
3291
|
+
|
|
3292
|
+
.with-box-shadow {
|
|
3293
|
+
box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.05);
|
|
3294
|
+
}
|
|
3291
3295
|
.message-text {
|
|
3292
3296
|
word-break: break-word;
|
|
3293
3297
|
margin: 0;
|
|
@@ -3464,7 +3468,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3464
3468
|
</div>
|
|
3465
3469
|
</div>
|
|
3466
3470
|
</a></div> `}))}
|
|
3467
|
-
</div>`:U``}};kr.styles=[ln,Mr],Dr([ue({attribute:!0})],kr.prototype,"message",void 0),Dr([ue({attribute:!0})],kr.prototype,"myPubnub",void 0),Dr([ue({attribute:!0})],kr.prototype,"onMount",void 0),Dr([le()],kr.prototype,"loadingPreviews",void 0),Dr([le()],kr.prototype,"parsedMessage",void 0),Dr([le()],kr.prototype,"websitePreviewInfo",void 0),Dr([le()],kr.prototype,"imagesToDisplay",void 0),Dr([le()],kr.prototype,"imageUrlError",void 0),kr=Dr([ae("pubnub-message")],kr);var Ur=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 qr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.isHealthChat=!1,this.brandColor=Fe,this.onClickExit=()=>({}),this.requiresConsent=!1,this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t;this.messageInput.value="",this.autoResizeMessageInput(),await(null===(t=this.myPubnub)||void 0===t?void 0:t.sendMessage(e))},this.scrollToChatBottom=()=>{this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"smooth"})},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>!!this.requiresConsent&&!!this.requiresConsent&&!this.hasReceivedConsent}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.messages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener((e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading})),this.onMount()}async updated(){this.scrollToChatBottom()}render(){var e,t,n;
|
|
3471
|
+
</div>`:U``}};kr.styles=[ln,Mr],Dr([ue({attribute:!0})],kr.prototype,"message",void 0),Dr([ue({attribute:!0})],kr.prototype,"myPubnub",void 0),Dr([ue({attribute:!0})],kr.prototype,"onMount",void 0),Dr([le()],kr.prototype,"loadingPreviews",void 0),Dr([le()],kr.prototype,"parsedMessage",void 0),Dr([le()],kr.prototype,"websitePreviewInfo",void 0),Dr([le()],kr.prototype,"imagesToDisplay",void 0),Dr([le()],kr.prototype,"imageUrlError",void 0),kr=Dr([ae("pubnub-message")],kr);var Ur=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 qr=class extends re{constructor(){super(...arguments),this.onMount=()=>({}),this.isHealthChat=!1,this.brandColor=Fe,this.onClickExit=()=>({}),this.requiresConsent=!1,this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t;this.messageInput.value="",this.autoResizeMessageInput(),await(null===(t=this.myPubnub)||void 0===t?void 0:t.sendMessage(e))},this.scrollToChatBottom=()=>{this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"smooth"})},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>!!this.requiresConsent&&!!this.requiresConsent&&!this.hasReceivedConsent}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.messages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener((e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading})),this.onMount()}async updated(){this.scrollToChatBottom()}render(){var e,t,n;if(!this.buildingSlug)return U``;if(this.isHealthChat)return U`
|
|
3468
3472
|
<div
|
|
3469
3473
|
id="healthchat-container"
|
|
3470
3474
|
class=${fe({"pubnub-container__mobile":un(),"healthchat-container__desktop":!un()})}
|
|
@@ -3565,7 +3569,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3565
3569
|
</div>
|
|
3566
3570
|
</div>
|
|
3567
3571
|
</div>
|
|
3568
|
-
|
|
3572
|
+
`;if(!this.building)return U``;const i=this.building.orgId;return U`
|
|
3569
3573
|
<div
|
|
3570
3574
|
id="pubnub-chat-container"
|
|
3571
3575
|
class=${fe({"pubnub-container__mobile":un(),"pubnub-container__desktop":!un()})}
|
|
@@ -3586,6 +3590,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3586
3590
|
</div>
|
|
3587
3591
|
<div
|
|
3588
3592
|
id="conversation-body"
|
|
3593
|
+
style=${Pe({background:444===this.building.orgId?"rgba(229, 229, 229, 1);":void 0})}
|
|
3589
3594
|
class=${fe({hidden:this.needsConsent(),"leasing-conversation-body-backdrop":!0})}
|
|
3590
3595
|
>
|
|
3591
3596
|
<ul
|
|
@@ -3593,7 +3598,9 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3593
3598
|
class=${fe({hidden:this.needsConsent()})}
|
|
3594
3599
|
>
|
|
3595
3600
|
${Br(null!==(n=this.orgSlug)&&void 0!==n?n:"")}
|
|
3596
|
-
${this.building.welcomeMessage?U` <li
|
|
3601
|
+
${this.building.welcomeMessage?U` <li
|
|
3602
|
+
class=${fe({"message-container":!0,"ai-message":!0,"with-box-shadow":444===i})}
|
|
3603
|
+
>
|
|
3597
3604
|
<p
|
|
3598
3605
|
class=${fe({"message-text":!0,"webchat-font__desktop":!un(),"webchat-font__mobile":un()})}
|
|
3599
3606
|
>
|
|
@@ -3602,9 +3609,8 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3602
3609
|
</li>`:""}
|
|
3603
3610
|
${this.messages.map((e=>{var t,n;return U`
|
|
3604
3611
|
<li
|
|
3605
|
-
class=${(null===(t=this.myPubnub)||void 0===t?void 0:t.isLeadMessage(e)
|
|
3612
|
+
class=${Ln()("message-container",{"lead-message":null===(t=this.myPubnub)||void 0===t?void 0:t.isLeadMessage(e),"ai-message":!(null===(n=this.myPubnub)||void 0===n?void 0:n.isLeadMessage(e)),"with-box-shadow":444===i})}
|
|
3606
3613
|
key=${e.timetoken}
|
|
3607
|
-
style=${Pe({background:(null===(n=this.myPubnub)||void 0===n?void 0:n.isLeadMessage(e))?this.brandColor:void 0})}
|
|
3608
3614
|
>
|
|
3609
3615
|
<pubnub-message
|
|
3610
3616
|
.message=${e}
|
|
@@ -3644,7 +3650,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3644
3650
|
</button>
|
|
3645
3651
|
</div>
|
|
3646
3652
|
</div>
|
|
3647
|
-
|
|
3653
|
+
`}};qr.styles=[ln,Mr,Fr,Pr],Ur([ue({attribute:!0})],qr.prototype,"onMount",void 0),Ur([ue({attribute:!0})],qr.prototype,"channel",void 0),Ur([ue({attribute:!0})],qr.prototype,"isHealthChat",void 0),Ur([ue({attribute:!0})],qr.prototype,"myPubnub",void 0),Ur([ue({attribute:!0})],qr.prototype,"orgSlug",void 0),Ur([ue({attribute:!0})],qr.prototype,"buildingSlug",void 0),Ur([ue({attribute:!0})],qr.prototype,"building",void 0),Ur([ue({attribute:!0})],qr.prototype,"brandColor",void 0),Ur([ue({attribute:!0})],qr.prototype,"onClickExit",void 0),Ur([ue({attribute:!0})],qr.prototype,"requiresConsent",void 0),Ur([de("#message-input",!0)],qr.prototype,"messageInput",void 0),Ur([de("#conversation-body",!0)],qr.prototype,"messageBody",void 0),Ur([le()],qr.prototype,"messages",void 0),Ur([le()],qr.prototype,"isLoadingMessages",void 0),Ur([le()],qr.prototype,"hasReceivedConsent",void 0),Ur([le()],qr.prototype,"privacyPolicyUrl",void 0),Ur([le()],qr.prototype,"websitePreviewMapping",void 0),qr=Ur([ae("pubnub-chat")],qr);const Br=e=>"avb"===e?U`
|
|
3648
3654
|
<li class="message-container disclaimer-message">
|
|
3649
3655
|
<p class="disclaimer-inner">
|
|
3650
3656
|
Chats may be recorded by us and our vendors.
|
|
@@ -3758,7 +3764,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3758
3764
|
>
|
|
3759
3765
|
I agree
|
|
3760
3766
|
</button>
|
|
3761
|
-
</div>`;var Jr=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 jr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=zn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=xe(),this.firstUpdated=async()=>{await this.setBuildingDerivedInfo(),await this.initializeChatVariables(),this.handleChatInitializeAnalytics()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y;if(!this.buildingSlug||!this.orgSlug)return;const b=await li(this.orgSlug,this.buildingSlug);if(b.conversationMaintenanceMode)return void console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.");if(1!==b.active)return void console.warn("MeetElise has detected this building is NOT active. Chat icon will not appear.");b&&this.orgSlug&&Gr(this.orgSlug,this.buildingSlug);const[w,S,T,x,A,O,C]=await Promise.all([hi(this.buildingSlug),dr(this.buildingSlug),fi(this.buildingSlug,document.referrer),Wn(this.buildingSlug),Qn(this.buildingSlug),pi(b.id),Vn(this.buildingSlug)]);b.phoneNumber=Ne(b.phoneNumber),this.building=b,this.designConcept=null!==(e=null==w?void 0:w.abTestType)&&void 0!==e?e:"",this.leadSources=S,this.currentLeadSource=T,this.featureFlagShowDropdown=x;const I=await(async e=>{try{const n="https://app.meetelise.com",i=await t().get(`${n}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ii({logType:ni.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug);var N,E;this.enabledChatWidgets={call:O&&!O.isGlobalDefault?O.config.shouldShowPhone:null===(r=null===(i=null===(n=this.building)||void 0===n?void 0:n.chatWidgets)||void 0===i?void 0:i.includes("CALL"))||void 0===r||r,chat:O&&!O.isGlobalDefault?O.config.shouldShowChat:null===(s=null===(a=null===(o=this.building)||void 0===o?void 0:o.chatWidgets)||void 0===a?void 0:a.includes("CHAT"))||void 0===s||s,email:O&&!O.isGlobalDefault?O.config.shouldShowEmail:null===(d=null===(l=null===(u=this.building)||void 0===u?void 0:u.chatWidgets)||void 0===l?void 0:l.includes("EMAIL"))||void 0===d||d,text:(O&&!O.isGlobalDefault?O.config.shouldShowText:null===(h=null===(p=null===(c=this.building)||void 0===c?void 0:c.chatWidgets)||void 0===p?void 0:p.includes("SMS"))||void 0===h||h)&&!!I,sst:O&&!O.isGlobalDefault?O.config.shouldShowSst:null===(g=null===(m=null===(f=this.building)||void 0===f?void 0:f.chatWidgets)||void 0===m?void 0:m.includes("SST"))||void 0===g||g},this.enabledChatWidgets.sst?(E=this.handleTourClicked,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",(e=>{e.preventDefault(),E(e)}))})),((e,t,n)=>{if("be948f76-d8f9-11eb-b710-2bc5b16e7492"===t){const e=document.querySelector('a[href="/schedule-a-tour/"]');e&&e.addEventListener("click",(e=>{e.preventDefault(),n(e)}))}})(this.orgSlug,this.buildingSlug,this.handleTourClicked)):this.currentLeadSource&&(N=this.currentLeadSource,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(N)}`)}}))),O&&O.config&&(this.brandColor=null!==(v=O.config.primaryColor)&&void 0!==v?v:null,this.webchatConfigHasAutoOpenChat=O.config.autoOpenChat,this.requiresConsent=O.config.requiresConsent,this.privacyPolicyUrl=null!==(y=O.config.privacyPolicyUrl)&&void 0!==y?y:this.privacyPolicyUrl,O.config.displayStyle===di.MINIMIZED&&(this.isMinimized=!0),O.config.displayStyle===di.PILLS&&(this.designConcept=null),O.config.displayStyle===di.EMOJI&&(this.designConcept=di.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);let R=null;A&&(R=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.
|
|
3767
|
+
</div>`;var Jr=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 jr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=zn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=xe(),this.firstUpdated=async()=>{await this.setBuildingDerivedInfo(),await this.initializeChatVariables(),this.handleChatInitializeAnalytics()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y;if(!this.buildingSlug||!this.orgSlug)return;const b=await li(this.orgSlug,this.buildingSlug);if(b.conversationMaintenanceMode)return void console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.");if(1!==b.active)return void console.warn("MeetElise has detected this building is NOT active. Chat icon will not appear.");b&&this.orgSlug&&Gr(this.orgSlug,this.buildingSlug);const[w,S,T,x,A,O,C]=await Promise.all([hi(this.buildingSlug),dr(this.buildingSlug),fi(this.buildingSlug,document.referrer),Wn(this.buildingSlug),Qn(this.buildingSlug),pi(b.id),Vn(this.buildingSlug)]);b.phoneNumber=Ne(b.phoneNumber),this.building=b,this.designConcept=null!==(e=null==w?void 0:w.abTestType)&&void 0!==e?e:"",this.leadSources=S,this.currentLeadSource=T,this.featureFlagShowDropdown=x;const I=await(async e=>{try{const n="https://app.meetelise.com",i=await t().get(`${n}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ii({logType:ni.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug);var N,E;this.enabledChatWidgets={call:O&&!O.isGlobalDefault?O.config.shouldShowPhone:null===(r=null===(i=null===(n=this.building)||void 0===n?void 0:n.chatWidgets)||void 0===i?void 0:i.includes("CALL"))||void 0===r||r,chat:O&&!O.isGlobalDefault?O.config.shouldShowChat:null===(s=null===(a=null===(o=this.building)||void 0===o?void 0:o.chatWidgets)||void 0===a?void 0:a.includes("CHAT"))||void 0===s||s,email:O&&!O.isGlobalDefault?O.config.shouldShowEmail:null===(d=null===(l=null===(u=this.building)||void 0===u?void 0:u.chatWidgets)||void 0===l?void 0:l.includes("EMAIL"))||void 0===d||d,text:(O&&!O.isGlobalDefault?O.config.shouldShowText:null===(h=null===(p=null===(c=this.building)||void 0===c?void 0:c.chatWidgets)||void 0===p?void 0:p.includes("SMS"))||void 0===h||h)&&!!I,sst:O&&!O.isGlobalDefault?O.config.shouldShowSst:null===(g=null===(m=null===(f=this.building)||void 0===f?void 0:f.chatWidgets)||void 0===m?void 0:m.includes("SST"))||void 0===g||g},this.enabledChatWidgets.sst?(E=this.handleTourClicked,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",(e=>{e.preventDefault(),E(e)}))})),((e,t,n)=>{if("be948f76-d8f9-11eb-b710-2bc5b16e7492"===t){const e=document.querySelector('a[href="/schedule-a-tour/"]');e&&e.addEventListener("click",(e=>{e.preventDefault(),n(e)}))}})(this.orgSlug,this.buildingSlug,this.handleTourClicked)):this.currentLeadSource&&(N=this.currentLeadSource,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(N)}`)}}))),O&&O.config&&(this.brandColor=null!==(v=O.config.primaryColor)&&void 0!==v?v:null,this.webchatConfigHasAutoOpenChat=O.config.autoOpenChat,this.requiresConsent=O.config.requiresConsent,this.privacyPolicyUrl=null!==(y=O.config.privacyPolicyUrl)&&void 0!==y?y:this.privacyPolicyUrl,O.config.displayStyle===di.MINIMIZED&&(this.isMinimized=!0),O.config.displayStyle===di.PILLS&&(this.designConcept=null),O.config.displayStyle===di.EMOJI&&(this.designConcept=di.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);let R=null;A&&(R=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.match,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource),R&&!R.isMatch&&(R.number=b.phoneNumber)),C&&(null==R?void 0:R.number)&&Er(R.number,this.orgSlug,this.buildingSlug);const _=localStorage.getItem("eliseai_phone_number_devtest");_&&(console.info("Using dev test phone number: ",_),Er(_,this.orgSlug,this.buildingSlug)),this.phoneNumberForSource=R||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),Fn(this.building.id)},this.initializeChatVariables=async()=>{if(!this.building)return;if(this.building.conversationMaintenanceMode)return void console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.");const e=Or(this.buildingSlug),t=Cr(this.buildingSlug,e)?e:Ar(this.buildingSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Nr(this.buildingSlug,this.building,this.orgSlug,this.currentLeadSource,t.leadId),t.initiatedChat&&await this.myPubnub.initializePubnub(e),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!gn(yn(t)));return!!e&&!!n&&!un()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",pn(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0})},this.renderChatAdditionalActions=(e,t)=>U` <div
|
|
3762
3768
|
id=${e}
|
|
3763
3769
|
class=${fe({showTab:t,hideTab:!t})}
|
|
3764
3770
|
>
|
|
@@ -63,6 +63,10 @@ export const pubnubChatStyles = css`
|
|
|
63
63
|
box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
|
|
64
64
|
box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
.with-box-shadow {
|
|
68
|
+
box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.05);
|
|
69
|
+
}
|
|
66
70
|
.message-text {
|
|
67
71
|
word-break: break-word;
|
|
68
72
|
margin: 0;
|
|
@@ -18,6 +18,7 @@ import { healthChatStyles } from "./healthchat-styles";
|
|
|
18
18
|
import { leasingChatStyles } from "./leasing-chat-styles";
|
|
19
19
|
import { pubnubChatStyles } from "./pubnub-chat-styles";
|
|
20
20
|
import "./pubnub-message";
|
|
21
|
+
import classNames from "classnames";
|
|
21
22
|
|
|
22
23
|
@customElement("pubnub-chat")
|
|
23
24
|
export class PubnubChat extends LitElement {
|
|
@@ -284,6 +285,8 @@ export class PubnubChat extends LitElement {
|
|
|
284
285
|
return html``;
|
|
285
286
|
}
|
|
286
287
|
|
|
288
|
+
const orgId = this.building.orgId;
|
|
289
|
+
|
|
287
290
|
return html`
|
|
288
291
|
<div
|
|
289
292
|
id="pubnub-chat-container"
|
|
@@ -324,6 +327,12 @@ export class PubnubChat extends LitElement {
|
|
|
324
327
|
</div>
|
|
325
328
|
<div
|
|
326
329
|
id="conversation-body"
|
|
330
|
+
style=${styleMap({
|
|
331
|
+
background:
|
|
332
|
+
this.building.orgId === 444
|
|
333
|
+
? "rgba(229, 229, 229, 1);"
|
|
334
|
+
: undefined,
|
|
335
|
+
})}
|
|
327
336
|
class=${classMap({
|
|
328
337
|
["hidden"]: this.needsConsent(),
|
|
329
338
|
["leasing-conversation-body-backdrop"]: true,
|
|
@@ -337,7 +346,13 @@ export class PubnubChat extends LitElement {
|
|
|
337
346
|
>
|
|
338
347
|
${getChatDisclaimer(this.orgSlug ?? "")}
|
|
339
348
|
${this.building.welcomeMessage
|
|
340
|
-
? html` <li
|
|
349
|
+
? html` <li
|
|
350
|
+
class=${classMap({
|
|
351
|
+
"message-container": true,
|
|
352
|
+
"ai-message": true,
|
|
353
|
+
"with-box-shadow": orgId === 444,
|
|
354
|
+
})}
|
|
355
|
+
>
|
|
341
356
|
<p
|
|
342
357
|
class=${classMap({
|
|
343
358
|
["message-text"]: true,
|
|
@@ -352,15 +367,12 @@ export class PubnubChat extends LitElement {
|
|
|
352
367
|
${this.messages.map((message) => {
|
|
353
368
|
return html`
|
|
354
369
|
<li
|
|
355
|
-
class=${
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
style=${styleMap({
|
|
360
|
-
background: this.myPubnub?.isLeadMessage(message)
|
|
361
|
-
? this.brandColor
|
|
362
|
-
: undefined,
|
|
370
|
+
class=${classNames("message-container", {
|
|
371
|
+
"lead-message": this.myPubnub?.isLeadMessage(message),
|
|
372
|
+
"ai-message": !this.myPubnub?.isLeadMessage(message),
|
|
373
|
+
"with-box-shadow": orgId === 444,
|
|
363
374
|
})}
|
|
375
|
+
key=${message.timetoken}
|
|
364
376
|
>
|
|
365
377
|
<pubnub-message
|
|
366
378
|
.message=${message}
|
|
@@ -19,7 +19,7 @@ export default async function fetchPhoneNumberFromSource(
|
|
|
19
19
|
if (phoneNumberResponse.data) {
|
|
20
20
|
return {
|
|
21
21
|
number: formatPhoneNumber(phoneNumberResponse.data.number),
|
|
22
|
-
isMatch: phoneNumberResponse.data.
|
|
22
|
+
isMatch: phoneNumberResponse.data.match,
|
|
23
23
|
isPropertyWebsiteCatchall:
|
|
24
24
|
phoneNumberResponse.data.isPropertyWebsiteCatchall,
|
|
25
25
|
};
|