@meetelise/chat 1.12.4 → 1.12.5

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.12.4",
3
+ "version": "1.12.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "public/dist/index.js",
@@ -430,7 +430,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
430
430
  .option.active {
431
431
  background-color: var(--active-option-color);
432
432
  }
433
- `,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ne("me-select")],$t),Math.pow(10,8);var Vt=36e5,Xt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Qt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kt(e){var t,i={},n=e.split(Xt.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?t=n[0]:(i.date=n[0],t=n[1],Xt.timeZoneDelimiter.test(i.date)&&(i.date=e.split(Xt.timeZoneDelimiter)[0],t=e.substr(i.date.length,e.length))),t){var r=Xt.timezone.exec(t);r?(i.time=t.replace(r[1],""),i.timezone=r[1]):i.time=t}return i}function ei(e,t){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(i);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((n[1]||n[2]).length)}}function ti(e,t){if(null===t)return new Date(NaN);var i=e.match(Qt);if(!i)return new Date(NaN);var n=!!i[4],r=ii(i[1]),o=ii(i[2])-1,a=ii(i[3]),s=ii(i[4]),u=ii(i[5])-1;if(n)return function(e,t,i){return t>=1&&t<=53&&i>=0&&i<=6}(0,s,u)?function(e,t,i){var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*(t-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,i){return t>=0&&t<=11&&i>=1&&i<=(ai[t]||(si(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(si(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function ii(e){return e?parseInt(e):1}function ni(e){var t=e.match(Zt);if(!t)return NaN;var i=ri(t[1]),n=ri(t[2]),r=ri(t[3]);return function(e,t,i){return 24===e?0===t&&0===i:i>=0&&i<60&&t>=0&&t<60&&e>=0&&e<25}(i,n,r)?i*Vt+6e4*n+1e3*r:NaN}function ri(e){return e&&parseFloat(e.replace(",","."))||0}function oi(e){if("Z"===e)return 0;var t=e.match(Yt);if(!t)return 0;var i="+"===t[1]?-1:1,n=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?i*(n*Vt+6e4*r):NaN}var ai=[31,null,31,30,31,30,31,31,30,31,30,31];function si(e){return e%400==0||e%4==0&&e%100!=0}var ui=i(9669),li=i.n(ui),di=i(7739),ci=i.n(di);const pi={},fi=async e=>{if(pi[e])return pi[e];const t=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),i=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var i=Fe(e),n=Ve(t);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}(t,30))),n=`https://app.meetelise.com/api/pub/v1/buildings/${e}/tour/availabilities?startTime=${zt(t)}&endTime=${i}`,r=await li().get(n);return pi[e]=r.data,r.data},mi=async e=>(async(e,t)=>{var i;const n=await(async(e,t)=>{var i,n,r;const o=await fi(e),a=(null===(i=o.availability)||void 0===i?void 0:i[t])?null===(r=null===(n=o.availability)||void 0===n?void 0:n[t].availableTourStartTimes)||void 0===r?void 0:r.map((e=>function(e,t){_e(1,arguments);var i=t||{},n=null==i.additionalDigits?2:Ve(i.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=Kt(e);if(o.date){var a=ei(o.date,n);r=ti(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=ni(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=oi(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}(e))):[];return o.availability?{...o.availability[t],availableTourStartTimes:a}:null})(e,t);return n?ci()(null!==(i=n.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(e,"yyyy-MM-dd"))):{}})(Object.keys(pi).map(Number)[0],e);var hi=i(9991);i(7294);const vi=()=>window.matchMedia("(max-width: 767px)").matches;var gi=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let yi=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.tourType=wi.Guided,this.email="",this.phoneNumber="",this.hasPhoneNumberError=!1,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await mi(Si[this.tourType])},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const i=e.target.selectionStart;if(1!==e.key.length||Ne(e)){if("Backspace"===e.key){if(Ne(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,n=this.phoneNumber.slice(0,i).replace(/\D/g,""),r=this.phoneNumber.slice(i).replace(/\D/g,""),o=`${n.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=i-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Ne(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,i).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,n=i-e>-1?i-e:0;this.phoneInput.setSelectionRange(n,n)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(i).split(/\d+/)[0].length||0)+1,t=i+e<this.phoneNumber.length?i+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,i)+e.key+this.phoneNumber.slice(i);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const i=this.phoneInput.selectionStart,n=i?this.phoneInput.value.slice(i).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=n.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>!isNaN(this.tourType),dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t;return!!(null===(e=this.nameInput)||void 0===e?void 0:e.value)&&(null===(t=this.emailInput)||void 0===t?void 0:t.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length},unitType:()=>!!this.unitTypeSelect.value},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo()&&this.validators.unitType(),this.timeStringToHoursAndMinutes=e=>{const[t,i]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(i)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime)return;const[t,i]=this.timeStringToHoursAndMinutes(this.selectedTime),n=new Date(this.selectedDate.getTime());n.setHours(t,i);const r=n.toISOString(),o={email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.nameInput.value.split(" ")[0],last_name:this.nameInput.value.split(" ").slice(1).join(" "),tour_type:bi[this.tourType],tour_time:r};200===(await li().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",o)).status&&(this.tourIsBooked=!0)},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo()&&this.validators.unitType(),nextButtonText:"Schedule tour",nextButtonAction:this.submit,render:()=>D`${this.userInfoAndLayoutMenu()}`}]}tourTypeMenu(){return D`<h2 id="tourType">Tour Type</h2>
433
+ `,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ne("me-select")],$t),Math.pow(10,8);var Vt=36e5,Xt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Qt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kt(e){var t,i={},n=e.split(Xt.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?t=n[0]:(i.date=n[0],t=n[1],Xt.timeZoneDelimiter.test(i.date)&&(i.date=e.split(Xt.timeZoneDelimiter)[0],t=e.substr(i.date.length,e.length))),t){var r=Xt.timezone.exec(t);r?(i.time=t.replace(r[1],""),i.timezone=r[1]):i.time=t}return i}function ei(e,t){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(i);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((n[1]||n[2]).length)}}function ti(e,t){if(null===t)return new Date(NaN);var i=e.match(Qt);if(!i)return new Date(NaN);var n=!!i[4],r=ii(i[1]),o=ii(i[2])-1,a=ii(i[3]),s=ii(i[4]),u=ii(i[5])-1;if(n)return function(e,t,i){return t>=1&&t<=53&&i>=0&&i<=6}(0,s,u)?function(e,t,i){var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*(t-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,i){return t>=0&&t<=11&&i>=1&&i<=(ai[t]||(si(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(si(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function ii(e){return e?parseInt(e):1}function ni(e){var t=e.match(Zt);if(!t)return NaN;var i=ri(t[1]),n=ri(t[2]),r=ri(t[3]);return function(e,t,i){return 24===e?0===t&&0===i:i>=0&&i<60&&t>=0&&t<60&&e>=0&&e<25}(i,n,r)?i*Vt+6e4*n+1e3*r:NaN}function ri(e){return e&&parseFloat(e.replace(",","."))||0}function oi(e){if("Z"===e)return 0;var t=e.match(Yt);if(!t)return 0;var i="+"===t[1]?-1:1,n=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?i*(n*Vt+6e4*r):NaN}var ai=[31,null,31,30,31,30,31,31,30,31,30,31];function si(e){return e%400==0||e%4==0&&e%100!=0}var ui=i(9669),li=i.n(ui),di=i(7739),ci=i.n(di);const pi={},fi=async e=>{if(pi[e])return pi[e];const t=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),i=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var i=Fe(e),n=Ve(t);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}(t,30))),n=`https://app.meetelise.com/api/pub/v1/buildings/${e}/tour/availabilities?startTime=${zt(t)}&endTime=${i}`,r=await li().get(n);return pi[e]=r.data,r.data},mi=async e=>(async(e,t)=>{var i;const n=await(async(e,t)=>{var i,n,r;const o=await fi(e),a=(null===(i=o.availability)||void 0===i?void 0:i[t])?null===(r=null===(n=o.availability)||void 0===n?void 0:n[t].availableTourStartTimes)||void 0===r?void 0:r.map((e=>function(e,t){_e(1,arguments);var i=t||{},n=null==i.additionalDigits?2:Ve(i.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=Kt(e);if(o.date){var a=ei(o.date,n);r=ti(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=ni(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=oi(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}(e))):[];return o.availability?{...o.availability[t],availableTourStartTimes:a}:null})(e,t);return n?ci()(null!==(i=n.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(e,"yyyy-MM-dd"))):{}})(Object.keys(pi).map(Number)[0],e);var hi=i(9991);i(7294);const vi=()=>window.matchMedia("(max-width: 767px)").matches;var gi=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let yi=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.tourType=wi.Guided,this.email="",this.phoneNumber="",this.hasPhoneNumberError=!1,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await mi(Si[this.tourType])},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const i=e.target.selectionStart;if(1!==e.key.length||Ne(e)){if("Backspace"===e.key){if(Ne(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,n=this.phoneNumber.slice(0,i).replace(/\D/g,""),r=this.phoneNumber.slice(i).replace(/\D/g,""),o=`${n.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=i-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Ne(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,i).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,n=i-e>-1?i-e:0;this.phoneInput.setSelectionRange(n,n)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(i).split(/\d+/)[0].length||0)+1,t=i+e<this.phoneNumber.length?i+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,i)+e.key+this.phoneNumber.slice(i);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const i=this.phoneInput.selectionStart,n=i?this.phoneInput.value.slice(i).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=n.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>!isNaN(this.tourType),dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t;return!!(null===(e=this.nameInput)||void 0===e?void 0:e.value)&&(null===(t=this.emailInput)||void 0===t?void 0:t.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,i]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(i)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime)return;const[t,i]=this.timeStringToHoursAndMinutes(this.selectedTime),n=new Date(this.selectedDate.getTime());n.setHours(t,i);const r=n.toISOString(),o={email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.nameInput.value.split(" ")[0],last_name:this.nameInput.value.split(" ").slice(1).join(" "),tour_type:bi[this.tourType],tour_time:r};200===(await li().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",o)).status&&(this.tourIsBooked=!0)},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:"Schedule tour",nextButtonAction:this.submit,render:()=>D`${this.userInfoAndLayoutMenu()}`}]}tourTypeMenu(){return D`<h2 id="tourType">Tour Type</h2>
434
434
  <div id="tourTypeMenu">
435
435
  ${this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")?D` <tour-type-option
436
436
  tourtype="guided"
@@ -557,20 +557,20 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
557
557
  @change=${()=>this.requestUpdate()}
558
558
  />
559
559
  </div>
560
- <div id="unitChoiceMenu">
561
- <h2 id="unitChoice">What would you like to view?</h2>
562
- <div id="unitOptions">
563
- <!-- TODO: display option.label, store option.value to send to backend -->
564
- <me-select
565
- id="unitType"
566
- placeholder="Select type"
567
- .options="${this.layoutOptions.map((e=>e.label))}"
568
- defaultOption="Studio"
569
- @change=${()=>{this.requestUpdate()}}
570
- >Studio
571
- </me-select>
572
- </div>
573
- </div>`}confirmationMessage(){if(!this.selectedDate)return D``;const e=`${Pt(this.selectedDate,"MMMM Lo, y")} at ${this.selectedTime}`;return D`
560
+
561
+ ${this.layoutOptions.length>0?D`<div id="unitChoiceMenu">
562
+ <h2 id="unitChoice">What would you like to view?</h2>
563
+ <div id="unitOptions">
564
+ <me-select
565
+ id="unitType"
566
+ placeholder="Select type"
567
+ .options="${this.layoutOptions.map((e=>e.label))}"
568
+ defaultOption="Studio"
569
+ @change=${()=>{this.requestUpdate()}}
570
+ >Studio
571
+ </me-select>
572
+ </div>
573
+ </div>`:""} `}confirmationMessage(){if(!this.selectedDate)return D``;const e=`${Pt(this.selectedDate,"MMMM Lo, y")} at ${this.selectedTime}`;return D`
574
574
  <div id="confirmationMessage">
575
575
  <svg
576
576
  width="20"
@@ -221,15 +221,13 @@ export class TourScheduler extends LitElement {
221
221
  // TODO: deleting phone number doesn't cause validation to fail, at least on mobile
222
222
  !!this.phoneNumber &&
223
223
  this.phoneNumber.length === 14,
224
- unitType: (): boolean => !!this.unitTypeSelect.value,
225
224
  };
226
225
 
227
226
  formIsValidForSubmission = (): boolean => {
228
227
  const isValid =
229
228
  this.validators.tourType() &&
230
229
  this.validators.dateAndTime() &&
231
- this.validators.leadInfo() &&
232
- this.validators.unitType();
230
+ this.validators.leadInfo();
233
231
  return isValid;
234
232
  };
235
233
 
@@ -769,8 +767,7 @@ export class TourScheduler extends LitElement {
769
767
  },
770
768
  },
771
769
  {
772
- validate: (): boolean =>
773
- this.validators.leadInfo() && this.validators.unitType(),
770
+ validate: (): boolean => this.validators.leadInfo(),
774
771
  nextButtonText: "Schedule tour",
775
772
  nextButtonAction: this.submit,
776
773
  render: (): TemplateResult => {
@@ -803,23 +800,25 @@ export class TourScheduler extends LitElement {
803
800
  @change=${() => this.requestUpdate()}
804
801
  />
805
802
  </div>
806
- <div id="unitChoiceMenu">
807
- <h2 id="unitChoice">What would you like to view?</h2>
808
- <div id="unitOptions">
809
- <!-- TODO: display option.label, store option.value to send to backend -->
810
- <me-select
811
- id="unitType"
812
- placeholder="Select type"
813
- .options="${this.layoutOptions.map((o) => o.label)}"
814
- defaultOption="Studio"
815
- @change=${() => {
816
- // to revalidate the form
817
- this.requestUpdate();
818
- }}
819
- >Studio
820
- </me-select>
821
- </div>
822
- </div>`;
803
+
804
+ ${this.layoutOptions.length > 0
805
+ ? html`<div id="unitChoiceMenu">
806
+ <h2 id="unitChoice">What would you like to view?</h2>
807
+ <div id="unitOptions">
808
+ <me-select
809
+ id="unitType"
810
+ placeholder="Select type"
811
+ .options="${this.layoutOptions.map((o) => o.label)}"
812
+ defaultOption="Studio"
813
+ @change=${() => {
814
+ // to revalidate the form
815
+ this.requestUpdate();
816
+ }}
817
+ >Studio
818
+ </me-select>
819
+ </div>
820
+ </div>`
821
+ : ""} `;
823
822
  }
824
823
 
825
824
  confirmationMessage(): TemplateResult {