@meetelise/chat 1.22.24 → 1.22.26
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
|
@@ -104,6 +104,21 @@
|
|
|
104
104
|
</style>
|
|
105
105
|
</head>
|
|
106
106
|
<body>
|
|
107
|
+
<script>
|
|
108
|
+
document.addEventListener("keydown", (e) => {
|
|
109
|
+
if (e.target.tagName.toLowerCase() === "me-chat") {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
console.log(
|
|
112
|
+
"🚫\n" +
|
|
113
|
+
"Hijacking your keyboard.\n" +
|
|
114
|
+
"Sure would be annoying if some websites used libraries which inserted document-level key listeners which prevent typing in webchat.\n" +
|
|
115
|
+
"Glad that's not a thing and never will be.\n" +
|
|
116
|
+
"Anyway, if you're seeing this message you've messed up our focus trap and should fix it. Thanks.\n" +
|
|
117
|
+
"🚫\n"
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
</script>
|
|
107
122
|
<!-- <script>
|
|
108
123
|
<!-- Before closing body tag -->
|
|
109
124
|
<!-- (function (d, s, id, k, r) {
|
package/public/dist/index.js
CHANGED
|
@@ -2995,7 +2995,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2995
2995
|
</div>
|
|
2996
2996
|
</div>
|
|
2997
2997
|
</div>
|
|
2998
|
-
`:"Pacific Urban Residential"===this.orgSlug?U` <div class="vertical-pill-list">
|
|
2998
|
+
`:"Pacific Urban Residential"===this.orgSlug||"cbc11aba-21c4-4571-bc43-ff9d86a029e3"===this.orgSlug?U` <div class="vertical-pill-list">
|
|
2999
2999
|
${this.hasChatEnabledDesktop?U`<button
|
|
3000
3000
|
@click=${this.onClickMinimize}
|
|
3001
3001
|
class="minimize-button"
|
|
@@ -4283,6 +4283,8 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4283
4283
|
id="pubnub-chat-container"
|
|
4284
4284
|
class=${fe({"pubnub-container__mobile":ci(),"pubnub-container__desktop":!ci()})}
|
|
4285
4285
|
style=${Pe(s)}
|
|
4286
|
+
@keydown=${e=>e.stopPropagation()}
|
|
4287
|
+
@keyup=${e=>e.stopPropagation()}
|
|
4286
4288
|
>
|
|
4287
4289
|
<div
|
|
4288
4290
|
id="leasing-header"
|
|
@@ -4904,4 +4906,4 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4904
4906
|
line-height: 150%;
|
|
4905
4907
|
font-size: 16px;
|
|
4906
4908
|
}
|
|
4907
|
-
`,Fo([le({type:String})],Do.prototype,"orgSlug",void 0),Fo([le({type:Number})],Do.prototype,"right",void 0),Fo([le({type:Number})],Do.prototype,"bottom",void 0),Fo([le({type:Number})],Do.prototype,"top",void 0),Fo([le({type:Number})],Do.prototype,"left",void 0),Fo([ue()],Do.prototype,"launcher",void 0),Fo([ue()],Do.prototype,"currentLeadSource",void 0),Fo([ue()],Do.prototype,"displayPubnubChat",void 0),Fo([ue()],Do.prototype,"myPubnub",void 0),Fo([ue()],Do.prototype,"requiresConsent",void 0),Fo([ue()],Do.prototype,"privacyPolicyUrl",void 0),Fo([ue()],Do.prototype,"isLoading",void 0),Do=Fo([ae("utilities-chat")],Do);const ko=async e=>{const i=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(i)}`,r=await t().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&un({logType:r&&r.data?ln.info:ln.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${r?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:r.data,url:i,orgSlug:e,givenBuildingSlug:null,reason:r&&r.data?null:"No match found"}}),r.data};class Uo{static healthcareStart(e,t=!0){var i,n,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),Bo();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","dialog"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("aria-describedby","aria-describe-info"),a.setAttribute("aria-modal","true"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(i=e.right)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("bottom",(null===(n=e.bottom)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),Uo.healthChat=a}static start(e,t=!0){var i,n,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"
|
|
4909
|
+
`,Fo([le({type:String})],Do.prototype,"orgSlug",void 0),Fo([le({type:Number})],Do.prototype,"right",void 0),Fo([le({type:Number})],Do.prototype,"bottom",void 0),Fo([le({type:Number})],Do.prototype,"top",void 0),Fo([le({type:Number})],Do.prototype,"left",void 0),Fo([ue()],Do.prototype,"launcher",void 0),Fo([ue()],Do.prototype,"currentLeadSource",void 0),Fo([ue()],Do.prototype,"displayPubnubChat",void 0),Fo([ue()],Do.prototype,"myPubnub",void 0),Fo([ue()],Do.prototype,"requiresConsent",void 0),Fo([ue()],Do.prototype,"privacyPolicyUrl",void 0),Fo([ue()],Do.prototype,"isLoading",void 0),Do=Fo([ae("utilities-chat")],Do);const ko=async e=>{const i=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(i)}`,r=await t().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&un({logType:r&&r.data?ln.info:ln.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${r?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:r.data,url:i,orgSlug:e,givenBuildingSlug:null,reason:r&&r.data?null:"No match found"}}),r.data};class Uo{static healthcareStart(e,t=!0){var i,n,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),Bo();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","dialog"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("aria-describedby","aria-describe-info"),a.setAttribute("aria-modal","true"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(i=e.right)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("bottom",(null===(n=e.bottom)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),Uo.healthChat=a}static start(e,t=!0){var i,n,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization,this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.right,bottom:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),Bo();let d=null;switch(e.widgetType){case Lo.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case Lo.Default:d=document.createElement("me-chat");break;case Lo.Utilities:d=document.createElement("utilities-chat");break;default:d=document.createElement("me-chat")}if(!d)throw new Error("Invalid widget type");d.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization),d.setAttribute("widgetType",e.widgetType||Lo.Default),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","dialog"),d.setAttribute("aria-label","EliseAI Widget"),d.setAttribute("aria-describedby","aria-describe-info"),d.setAttribute("aria-modal","true"),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("brandColor",((e,t)=>{const i=(r=e,{r:parseInt(r.substring(1,3),16),g:parseInt(r.substring(3,5),16),b:parseInt(r.substring(5,7),16)}),n={r:i.r+Math.round(.3*(0-i.r)),g:i.g+Math.round(.3*(0-i.g)),b:i.b+Math.round(.3*(0-i.b))};var r;return((e,t,i)=>"#"+[e,t,i].map((e=>{const t=e.toString(16);return 1===t.length?"0"+t:t})).join(""))(n.r,n.g,n.b)})(e.brandColor))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof Co&&(this.handleBuildingslug(d,e.organization,e.building),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(d.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await(async(e,t=5e3)=>new Promise(((i,n)=>{const r=new MutationObserver(((t,n)=>{const r=document.getElementById(e);r&&(n.disconnect(),i(r))}));r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout((()=>{r.disconnect(),n(new Error(`Element ${e} did not appear within ${t}ms`))}),t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),i(a))})))("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),d.overrideRentgrata=!0),e.onSstClose&&(d.onSstClose=e.onSstClose)),e.position&&(d.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),d.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),d.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),d.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(d),d instanceof Co&&(Uo.meChat=d),d instanceof Do&&(Uo.utilitiesChat=d)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),Uo.meChat=null)}static async handleBuildingslug(e,t,i){if(i)return void e.setAttribute("buildingSlug",i);if(this.mutationObserver)return;if(!t)return;const n=await ko(t);if(n){const e={organization:t,building:n,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",(()=>{requestAnimationFrame((()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,ko(t).then((e=>{if(!e)return;const i={organization:t,building:e,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)})))}))}),!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,i=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await t().get(i,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&un({logType:n&&n.data?ln.info:ln.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const r={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(r,!1)}static async calculateBuildingSlugForLogging(e){const i=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(i)}`,r=await t().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&un({logType:r&&r.data===e?ln.info:ln.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${r&&r.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:r.data,url:i,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:r&&r.data===e?null:r&&!r.data?"No match found":r&&r.data!==e?"Mismatch":"No match found"}}),r&&r.data}}var Lo;Uo.meChat=null,Uo.healthChat=null,Uo.utilitiesChat=null,Uo.orgSlug="",Uo.mutationObserver=null,Uo.previousUrl="",Uo.hasBuildingSlug=null,Uo.brandColor="",Uo.backgroundColor="",Uo.healthcareId="",Uo.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(Lo||(Lo={}));const Bo=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)}})();var r=n.l,o=n.Z;export{r as WidgetType,o as default};
|
|
@@ -541,7 +541,10 @@ export class Launcher extends LitElement {
|
|
|
541
541
|
{
|
|
542
542
|
/* PUR is very insistent on the ordering of our launch statuses */
|
|
543
543
|
}
|
|
544
|
-
if (
|
|
544
|
+
if (
|
|
545
|
+
this.orgSlug === "Pacific Urban Residential" ||
|
|
546
|
+
this.orgSlug === "cbc11aba-21c4-4571-bc43-ff9d86a029e3"
|
|
547
|
+
) {
|
|
545
548
|
return html` <div class="vertical-pill-list">
|
|
546
549
|
${this.hasChatEnabledDesktop
|
|
547
550
|
? html`<button
|
|
@@ -147,6 +147,7 @@ export class PubnubChat extends LitElement {
|
|
|
147
147
|
}
|
|
148
148
|
await this.myPubnub?.sendMessage(message);
|
|
149
149
|
};
|
|
150
|
+
|
|
150
151
|
firstUpdated(): void {
|
|
151
152
|
this.messages = this.myPubnub?.simpleChatMessages || [];
|
|
152
153
|
this.myPubnub?.addChatListener(
|
|
@@ -581,6 +582,8 @@ export class PubnubChat extends LitElement {
|
|
|
581
582
|
["pubnub-container__desktop"]: !isMobile(),
|
|
582
583
|
})}
|
|
583
584
|
style=${styleMap(styles)}
|
|
585
|
+
@keydown=${(e: KeyboardEvent) => e.stopPropagation()}
|
|
586
|
+
@keyup=${(e: KeyboardEvent) => e.stopPropagation()}
|
|
584
587
|
>
|
|
585
588
|
<div
|
|
586
589
|
id="leasing-header"
|
package/src/main/MEChat.ts
CHANGED
|
@@ -92,7 +92,7 @@ export default class MEChat {
|
|
|
92
92
|
if (isInitialStart) {
|
|
93
93
|
this.orgSlug =
|
|
94
94
|
opts.organization === "Pacific Urban Residential"
|
|
95
|
-
? "
|
|
95
|
+
? "cbc11aba-21c4-4571-bc43-ff9d86a029e3"
|
|
96
96
|
: opts.organization;
|
|
97
97
|
this.hasBuildingSlug = !!opts.building;
|
|
98
98
|
this.overridePlacement = {
|
|
@@ -132,7 +132,7 @@ export default class MEChat {
|
|
|
132
132
|
meChatElement.setAttribute(
|
|
133
133
|
"orgSlug",
|
|
134
134
|
opts.organization === "Pacific Urban Residential"
|
|
135
|
-
? "
|
|
135
|
+
? "cbc11aba-21c4-4571-bc43-ff9d86a029e3"
|
|
136
136
|
: opts.organization
|
|
137
137
|
);
|
|
138
138
|
meChatElement.setAttribute(
|