@meetelise/chat 1.20.36 → 1.20.39

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.20.36",
3
+ "version": "1.20.39",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -234,7 +234,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
234
234
  .dayNumber:is(.differentMonth, .past, .noAvailabilities) {
235
235
  opacity: 30%;
236
236
  }
237
- `,Bt([ae({attribute:"month",type:String})],jt.prototype,"defaultMonth",void 0),Bt([ae({attribute:"year",type:Number})],jt.prototype,"defaultYear",void 0),Bt([ae({attribute:!1})],jt.prototype,"availabilities",void 0),Bt([ae({attribute:!1})],jt.prototype,"selectedDate",null),Bt([se()],jt.prototype,"monthShown",null),Bt([se()],jt.prototype,"yearShown",void 0),jt=Bt([re("date-picker")],jt);const Ht=(e,t)=>{const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n};var Wt=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};const Gt=(e,t)=>e.reduce((function(e,t){return e[t.displayTime]=t,e}),{})[t];let $t=class extends ne{constructor(){super(...arguments),this.options=[],this.selectedDateExists=!1,this.horizontal=!1}get selectedTime(){return this.selected}render(){var e;return(null===(e=this.options)||void 0===e?void 0:e.length)?D`
237
+ `,Bt([ae({attribute:"month",type:String})],jt.prototype,"defaultMonth",void 0),Bt([ae({attribute:"year",type:Number})],jt.prototype,"defaultYear",void 0),Bt([ae({attribute:!1})],jt.prototype,"availabilities",void 0),Bt([ae({attribute:!1})],jt.prototype,"selectedDate",null),Bt([se()],jt.prototype,"monthShown",null),Bt([se()],jt.prototype,"yearShown",void 0),jt=Bt([re("date-picker")],jt);const Ht=(e,t)=>{const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n};var Wt=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};const Gt=(e,t)=>e.reduce((function(e,t){return e[t.displayTime]=t,e}),{})[t];let $t=class extends ne{constructor(){super(...arguments),this.options=[],this.selectedDateExists=!1,this.horizontal=!1}get selectedTime(){return this.selected}render(){var e,t;return 1===(null===(e=this.options)||void 0===e?void 0:e.length)&&(this.selected=Gt(this.options,this.options[0].displayTime)),(null===(t=this.options)||void 0===t?void 0:t.length)?D`
238
238
  <div
239
239
  id="optionContainer"
240
240
  class=${this.horizontal?"horizontal":""}
@@ -252,7 +252,9 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
252
252
  id="noAvailabilityText"
253
253
  class=${this.horizontal?"horizontal":""}
254
254
  >
255
- ${this.selectedDateExists?D`<p>No available appointments for this day</p>`:D`<p>Select a date</p>`}
255
+ ${this.selectedDateExists?D`<p>No available appointments for this day</p>`:D`<p>
256
+ Please select a tour type to see available dates/times
257
+ </p>`}
256
258
  </div>`}};$t.styles=a`
257
259
  * {
258
260
  box-sizing: border-box;
@@ -2383,4 +2385,4 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2383
2385
  .heavyLabel {
2384
2386
  font-weight: bold;
2385
2387
  }
2386
- `,Vi.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),$i([ae({type:String})],Vi.prototype,"buildingSlug",void 0),$i([ae({type:String})],Vi.prototype,"orgSlug",void 0),$i([ae({type:String})],Vi.prototype,"themeId",void 0),$i([ae({attribute:!1})],Vi.prototype,"avatarSrc",void 0),$i([ae({type:Boolean})],Vi.prototype,"useMiniWidget",void 0),$i([ae({type:Object})],Vi.prototype,"launcherStyles",void 0),$i([se()],Vi.prototype,"popup",void 0),$i([se()],Vi.prototype,"theme",void 0),$i([se()],Vi.prototype,"chatId",void 0),$i([se()],Vi.prototype,"analytics",void 0),$i([se()],Vi.prototype,"isMobile",void 0),$i([se()],Vi.prototype,"launcher",void 0),$i([se()],Vi.prototype,"building",void 0),$i([se()],Vi.prototype,"buildingABTestType",void 0),$i([se()],Vi.prototype,"hasMounted",void 0),$i([se()],Vi.prototype,"hideLauncher",void 0),$i([se()],Vi.prototype,"isLoading",void 0),$i([se()],Vi.prototype,"talkjsPopupElement",void 0),$i([se()],Vi.prototype,"myContactHeader",void 0),Vi=Gi=$i([re("me-chat")],Vi);class zi{static start(e){if(window.location.pathname.includes("residentservices"))return;Xi(),Zi();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),zi.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),zi.meChat=null)}}zi.meChat=null;const Xi=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)},Zi=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
2388
+ `,Vi.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),$i([ae({type:String})],Vi.prototype,"buildingSlug",void 0),$i([ae({type:String})],Vi.prototype,"orgSlug",void 0),$i([ae({type:String})],Vi.prototype,"themeId",void 0),$i([ae({attribute:!1})],Vi.prototype,"avatarSrc",void 0),$i([ae({type:Boolean})],Vi.prototype,"useMiniWidget",void 0),$i([ae({type:Object})],Vi.prototype,"launcherStyles",void 0),$i([se()],Vi.prototype,"popup",void 0),$i([se()],Vi.prototype,"theme",void 0),$i([se()],Vi.prototype,"chatId",void 0),$i([se()],Vi.prototype,"analytics",void 0),$i([se()],Vi.prototype,"isMobile",void 0),$i([se()],Vi.prototype,"launcher",void 0),$i([se()],Vi.prototype,"building",void 0),$i([se()],Vi.prototype,"buildingABTestType",void 0),$i([se()],Vi.prototype,"hasMounted",void 0),$i([se()],Vi.prototype,"hideLauncher",void 0),$i([se()],Vi.prototype,"isLoading",void 0),$i([se()],Vi.prototype,"talkjsPopupElement",void 0),$i([se()],Vi.prototype,"myContactHeader",void 0),Vi=Gi=$i([re("me-chat")],Vi);class zi{static start(e){if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;Xi(),Zi();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),zi.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),zi.meChat=null)}}zi.meChat=null;const Xi=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)},Zi=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
package/src/MEChat.ts CHANGED
@@ -20,8 +20,11 @@ export default class MEChat {
20
20
 
21
21
  static start(opts: Options): void {
22
22
  // If our clients are Yardi and have a resident portal with rentcafe,
23
- // we do NOT want to display the launcher
24
- if (window.location.pathname.includes("residentservices")) {
23
+ // we do NOT want to display the launcher (if following in shows up anywhere in url)
24
+ if (
25
+ window.location.pathname.includes("residentservices") ||
26
+ window.location.pathname.includes("onlineleasing")
27
+ ) {
25
28
  return;
26
29
  }
27
30
  installFont();
@@ -108,7 +108,15 @@ export class TimePicker extends LitElement {
108
108
  margin-left: 0;
109
109
  }
110
110
  `;
111
+
111
112
  render(): TemplateResult {
113
+ if (this.options?.length === 1) {
114
+ // default select the only option (if just one option)
115
+ this.selected = getDateWithTimezoneOffset(
116
+ this.options,
117
+ this.options[0].displayTime
118
+ );
119
+ }
112
120
  return this.options?.length
113
121
  ? html`
114
122
  <div
@@ -162,7 +170,9 @@ export class TimePicker extends LitElement {
162
170
  >
163
171
  ${this.selectedDateExists
164
172
  ? html`<p>No available appointments for this day</p>`
165
- : html`<p>Select a date</p>`}
173
+ : html`<p>
174
+ Please select a tour type to see available dates/times
175
+ </p>`}
166
176
  </div>`;
167
177
  }
168
178
  }