@meetelise/chat 1.74.0 → 1.76.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.
Files changed (35) hide show
  1. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +6 -0
  2. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +1 -1
  3. package/dist/src/WebComponent/SchedulerV2/booking-confirmation.d.ts +2 -0
  4. package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +9 -3
  5. package/dist/src/WebComponent/SchedulerV2/itinerary-editor.d.ts +18 -1
  6. package/dist/src/WebComponent/SchedulerV2/itineraryStopStyles.d.ts +1 -2
  7. package/dist/src/WebComponent/SchedulerV2/schedulerIcons.d.ts +18 -0
  8. package/dist/src/WebComponent/SchedulerV2/schedulerRequests.d.ts +2 -0
  9. package/dist/src/WebComponent/SchedulerV2/schedulerV2Styles.d.ts +9 -0
  10. package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +17 -1
  11. package/dist/src/WebComponent/SchedulerV2/tourItineraryApi.d.ts +12 -0
  12. package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +3 -1
  13. package/dist/src/WebComponent/actions/international-phone-input.d.ts +7 -0
  14. package/dist/src/WebComponent/me-select.d.ts +2 -0
  15. package/package.json +1 -1
  16. package/public/dist/index.js +2411 -1446
  17. package/src/WebComponent/Scheduler/date-picker.ts +130 -51
  18. package/src/WebComponent/Scheduler/time-picker.ts +62 -0
  19. package/src/WebComponent/Scheduler/tour-type-option.ts +31 -10
  20. package/src/WebComponent/SchedulerV2/booking-confirmation.ts +54 -45
  21. package/src/WebComponent/SchedulerV2/community-picker.ts +222 -160
  22. package/src/WebComponent/SchedulerV2/contact-form.ts +100 -70
  23. package/src/WebComponent/SchedulerV2/itinerary-editor.ts +316 -151
  24. package/src/WebComponent/SchedulerV2/itineraryStopStyles.ts +44 -21
  25. package/src/WebComponent/SchedulerV2/scheduler-popover.ts +6 -6
  26. package/src/WebComponent/SchedulerV2/schedulerIcons.ts +143 -0
  27. package/src/WebComponent/SchedulerV2/schedulerRequests.ts +10 -0
  28. package/src/WebComponent/SchedulerV2/schedulerV2Styles.ts +347 -0
  29. package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +493 -172
  30. package/src/WebComponent/SchedulerV2/tourItineraryApi.ts +12 -0
  31. package/src/WebComponent/SchedulerV2/tourTimes.ts +16 -3
  32. package/src/WebComponent/actions/action-confirm-button.ts +4 -3
  33. package/src/WebComponent/actions/international-phone-input.ts +84 -1
  34. package/src/WebComponent/me-select.ts +74 -0
  35. package/src/tourSchedulerV2Booking.test.ts +129 -7
@@ -1,6 +1,7 @@
1
1
  import { css, html, LitElement, PropertyValues, TemplateResult } from "lit";
2
2
  import { customElement, property, state } from "lit/decorators.js";
3
3
  import { classMap } from "lit/directives/class-map.js";
4
+ import { ref } from "lit/directives/ref.js";
4
5
  import { v4 as uuid } from "uuid";
5
6
  import "./community-picker";
6
7
  import "./itinerary-editor";
@@ -9,11 +10,13 @@ import "./booking-confirmation";
9
10
  import "../actions/action-confirm-button";
10
11
  import "../loaders/mega-loader";
11
12
  import "../mini-loader";
12
- import { tourSchedulerStyles } from "../Scheduler/tourSchedulerStyles";
13
- import { InputStyles } from "../actions/InputStyles";
14
- import { ChevronLeftIcon } from "../icons/ChevronLeftIcon";
15
- import { XOutlineIcon } from "../icons/XOutlineIcon";
16
- import { CalendarCheckIcon } from "../icons/CalendarCheckIcon";
13
+ import { schedulerV2Styles, schedulerV2Tokens } from "./schedulerV2Styles";
14
+ import {
15
+ CheckCircleLineIcon,
16
+ ChevronLeftLineIcon,
17
+ CloseLineIcon,
18
+ MapLineIcon,
19
+ } from "./schedulerIcons";
17
20
  import formDisclaimer from "../../disclaimers";
18
21
  import {
19
22
  BookingResponse,
@@ -155,6 +158,8 @@ export class TourSchedulerV2 extends LitElement {
155
158
  @state() private date: string | null = null;
156
159
  @state() private firstStart: string | null = null;
157
160
  @state() private laterStarts: Record<number, string> = {};
161
+ /** Stops the prospect moved to their own day, away from `date`. */
162
+ @state() private stopDates: Record<number, string> = {};
158
163
  @state() private plan: PlanResponse | null = null;
159
164
  @state() private planLoading = false;
160
165
  @state() private planError: string | null = null;
@@ -184,6 +189,20 @@ export class TourSchedulerV2 extends LitElement {
184
189
  private planRequestId = 0;
185
190
  private idempotency: { booking: string; key: string } | null = null;
186
191
  private cleanupMobileListener?: () => void;
192
+ /**
193
+ * Below this width the modal can't fit the schedule step's three columns
194
+ * (the chat beside it, or a narrow window), so the step stacks.
195
+ */
196
+ private static readonly THREE_COLUMN_MIN_WIDTH = 840;
197
+ @state() private narrow = false;
198
+ private readonly modalResize = new ResizeObserver(([entry]) => {
199
+ this.narrow =
200
+ entry.contentRect.width < TourSchedulerV2.THREE_COLUMN_MIN_WIDTH;
201
+ });
202
+ private observeModal = (modal?: Element): void => {
203
+ this.modalResize.disconnect();
204
+ if (modal) this.modalResize.observe(modal);
205
+ };
187
206
 
188
207
  connectedCallback(): void {
189
208
  super.connectedCallback();
@@ -354,6 +373,7 @@ export class TourSchedulerV2 extends LitElement {
354
373
  this.plan = null;
355
374
  this.firstStart = null;
356
375
  this.laterStarts = {};
376
+ this.stopDates = {};
357
377
  this.linkTourType = null;
358
378
  this.notice = null;
359
379
  this.bookingError = null;
@@ -371,6 +391,7 @@ export class TourSchedulerV2 extends LitElement {
371
391
  date: this.date ?? toIsoDate(new Date()),
372
392
  firstStart: this.firstStart,
373
393
  laterStarts: this.laterStarts,
394
+ stopDates: this.stopDates,
374
395
  existingEventIds: this.existingEventIds,
375
396
  };
376
397
  }
@@ -402,7 +423,11 @@ export class TourSchedulerV2 extends LitElement {
402
423
  if (!plan.tour_types.includes(choice.tourType)) {
403
424
  if (plan.tour_types.length === 0) break;
404
425
  this.tourType = plan.tour_types[0];
426
+ this.stopDates = {};
405
427
  } else if (
428
+ // bookable_dates are the days every stop chains on together, which
429
+ // the tour's day needn't be once a stop is on its own day.
430
+ Object.keys(choice.stopDates).length === 0 &&
406
431
  plan.bookable_dates.length > 0 &&
407
432
  !plan.bookable_dates.includes(choice.date)
408
433
  ) {
@@ -515,6 +540,7 @@ export class TourSchedulerV2 extends LitElement {
515
540
  this.tourType = tourType;
516
541
  this.firstStart = null;
517
542
  this.laterStarts = {};
543
+ this.stopDates = {};
518
544
  void this.runPlan();
519
545
  }
520
546
 
@@ -524,9 +550,40 @@ export class TourSchedulerV2 extends LitElement {
524
550
  tourType: this.tourType,
525
551
  buildingId: this.buildingId,
526
552
  });
553
+ // The whole tour moves, including any stop on its own day.
527
554
  this.date = date;
528
555
  this.firstStart = null;
529
556
  this.laterStarts = {};
557
+ this.stopDates = {};
558
+ void this.runPlan();
559
+ }
560
+
561
+ private stopDatesWithout(buildingId: number): Record<number, string> {
562
+ return Object.fromEntries(
563
+ Object.entries(this.stopDates).filter(([id]) => Number(id) !== buildingId)
564
+ );
565
+ }
566
+
567
+ private onStopDate(buildingId: number, date: string): void {
568
+ const index = this.selectedIds.indexOf(buildingId);
569
+ if (index < 0) return;
570
+ pushGtmEvent("tourStopDateSelected", {
571
+ tourType: this.tourType,
572
+ buildingId: this.buildingId,
573
+ stopNumber: index + 1,
574
+ });
575
+ const others = this.stopDatesWithout(buildingId);
576
+ this.stopDates =
577
+ date === this.date ? others : { ...others, [buildingId]: date };
578
+ // The stop starts afresh on its new day, and the stops after it may move,
579
+ // so their own picks are dropped.
580
+ if (index === 0) this.firstStart = null;
581
+ this.laterStarts = Object.fromEntries(
582
+ this.selectedIds
583
+ .slice(1, index)
584
+ .filter((id) => this.laterStarts[id])
585
+ .map((id) => [id, this.laterStarts[id]])
586
+ );
530
587
  void this.runPlan();
531
588
  }
532
589
 
@@ -587,6 +644,7 @@ export class TourSchedulerV2 extends LitElement {
587
644
  if (this.selectedIds[0] === buildingId) this.firstStart = null;
588
645
  this.selectedIds = remaining;
589
646
  this.laterStarts = {};
647
+ this.stopDates = this.stopDatesWithout(buildingId);
590
648
  void this.runPlan();
591
649
  }
592
650
 
@@ -748,6 +806,8 @@ export class TourSchedulerV2 extends LitElement {
748
806
  error: stop.error?.message ?? null,
749
807
  distanceFromPrevMi:
750
808
  plannedStops.get(stop.building_id)?.distance_from_prev_mi ?? null,
809
+ travelMinutesFromPrev:
810
+ plannedStops.get(stop.building_id)?.travel_minutes_from_prev ?? null,
751
811
  };
752
812
  });
753
813
  const bookedStops = response.stops.filter(
@@ -847,6 +907,13 @@ export class TourSchedulerV2 extends LitElement {
847
907
  count: 1,
848
908
  mode: "extend",
849
909
  });
910
+ // The list was fetched after the last stop, on that stop's day, so the new
911
+ // stop joins it there.
912
+ const lastDay =
913
+ this.stopDates[this.selectedIds[this.selectedIds.length - 1]];
914
+ if (lastDay) {
915
+ this.stopDates = { ...this.stopDates, [community.building_id]: lastDay };
916
+ }
850
917
  this.selectedIds = [...this.selectedIds, community.building_id];
851
918
  void this.runPlan();
852
919
  }
@@ -1045,7 +1112,7 @@ export class TourSchedulerV2 extends LitElement {
1045
1112
  });
1046
1113
  }
1047
1114
 
1048
- /** Today's scheduler's body area, which scrolls the whole sheet on phones. */
1115
+ /** The body area, which scrolls the whole sheet on phones. */
1049
1116
  private container(content: TemplateResult): TemplateResult {
1050
1117
  return html`<div
1051
1118
  id=${this.mobile ? "mobile-body-container" : "scheduler-container"}
@@ -1074,8 +1141,9 @@ export class TourSchedulerV2 extends LitElement {
1074
1141
 
1075
1142
  /** Adding stops to a booking: the design's itinerary heading. */
1076
1143
  private renderItineraryHeading(): TemplateResult {
1077
- return html`<div class="itinerary-heading">
1078
- <h2>
1144
+ return html`<div class="page-intro itinerary-heading">
1145
+ ${MapLineIcon(32)}
1146
+ <h2 class="page-heading">
1079
1147
  Create Your Tour Itinerary
1080
1148
  ${this.planLoading ? html`<mini-loader></mini-loader>` : ""}
1081
1149
  </h2>
@@ -1086,13 +1154,6 @@ export class TourSchedulerV2 extends LitElement {
1086
1154
  /** "Add another stop": the nearby communities, under the itinerary. */
1087
1155
  private renderAddStop(): TemplateResult {
1088
1156
  return html`<div class="add-stop-picker">
1089
- <button
1090
- class="close-add-stop"
1091
- aria-label="Close nearby communities"
1092
- @click=${() => (this.addingStop = false)}
1093
- >
1094
- ${XOutlineIcon("#737373")}
1095
- </button>
1096
1157
  <community-picker
1097
1158
  variant="extend"
1098
1159
  .load=${this.loadAddStopCommunities}
@@ -1101,127 +1162,162 @@ export class TourSchedulerV2 extends LitElement {
1101
1162
  @selection-change=${(
1102
1163
  e: CustomEvent<{ communities: CommunitySummary[] }>
1103
1164
  ) => this.onStopAdded(e.detail.communities)}
1104
- ></community-picker>
1165
+ >
1166
+ <button
1167
+ slot="heading-action"
1168
+ class="icon-button close-add-stop"
1169
+ aria-label="Close nearby communities"
1170
+ @click=${() => (this.addingStop = false)}
1171
+ >
1172
+ ${CloseLineIcon(16)}
1173
+ </button>
1174
+ </community-picker>
1105
1175
  </div>`;
1106
1176
  }
1107
1177
 
1108
- private renderSchedule(): TemplateResult {
1109
- if (this.reschedulePrompt !== null) return this.renderReschedulePrompt();
1178
+ private renderEditor(): TemplateResult {
1110
1179
  const plan = this.plan;
1111
- return html`${this.container(html`
1112
- ${this.planError
1113
- ? html`<p class="error-message" role="alert">
1114
- ${this.planError}
1115
- <button class="link-button" @click=${() => this.runPlan()}>
1116
- Try again
1117
- </button>
1118
- </p>`
1119
- : ""}
1120
- ${this.extending ? this.renderItineraryHeading() : ""}
1121
- ${this.notice
1122
- ? html`<p class="explanation notice" role="status">${this.notice}</p>`
1180
+ return html` <itinerary-editor
1181
+ .stops=${plan?.stops ?? []}
1182
+ .communities=${this.communities}
1183
+ .problems=${this.problems()}
1184
+ .tourTypes=${this.tourTypeChoices()}
1185
+ .tourType=${this.shownTourType}
1186
+ .bookableDates=${plan?.bookable_dates ?? []}
1187
+ .date=${this.date}
1188
+ ?single=${!this.isMultiStop()}
1189
+ ?stopsOnly=${this.extending}
1190
+ ?canAddStop=${this.extending && !this.addingStop && this.canAddStop}
1191
+ ?canEditCommunities=${this.group !== null && !this.extending}
1192
+ ?loading=${this.planLoading}
1193
+ ?planned=${plan !== null}
1194
+ .primaryColor=${this.primaryColor}
1195
+ .foregroundColorOnPrimaryBackgroundColor=${this
1196
+ .foregroundColorOnPrimaryBackgroundColor}
1197
+ @tour-type-change=${(e: CustomEvent<{ tourType: TourTypeId }>) =>
1198
+ this.onTourType(e.detail.tourType)}
1199
+ @date-change=${(e: CustomEvent<{ date: string }>) =>
1200
+ this.onDate(e.detail.date)}
1201
+ @stop-time-change=${(
1202
+ e: CustomEvent<{ buildingId: number; start: string }>
1203
+ ) => this.onStopTime(e.detail.buildingId, e.detail.start)}
1204
+ @stop-date-change=${(
1205
+ e: CustomEvent<{ buildingId: number; date: string }>
1206
+ ) => this.onStopDate(e.detail.buildingId, e.detail.date)}
1207
+ @stops-reorder=${(e: CustomEvent<{ buildingIds: number[] }>) =>
1208
+ this.onReorder(e.detail.buildingIds)}
1209
+ @stop-remove=${(e: CustomEvent<{ buildingId: number }>) =>
1210
+ this.onRemove(e.detail.buildingId)}
1211
+ @edit-communities=${() => this.onEditCommunities()}
1212
+ @add-stop=${() => (this.addingStop = true)}
1213
+ @open-tour-link=${() =>
1214
+ this.activeLinkType && this.openTourLink(this.activeLinkType)}
1215
+ ></itinerary-editor>`;
1216
+ }
1217
+
1218
+ private renderContactForm(): TemplateResult {
1219
+ return html`<contact-form
1220
+ .values=${this.formValues}
1221
+ .layoutOptions=${this.bedroomOptions}
1222
+ ?bedroomsRequired=${this.bedroomsRequired}
1223
+ .leadSources=${this.leadSources}
1224
+ ?showLeadSourceDropdown=${this.showLeadSourceDropdown()}
1225
+ currentLeadSource=${this.currentLeadSource}
1226
+ .country=${this.country}
1227
+ ?mobile=${this.mobile}
1228
+ @contact-change=${(e: CustomEvent<{ values: ContactValues }>) =>
1229
+ this.onContactChange(e.detail.values)}
1230
+ @lead-source-selected=${(e: CustomEvent<{ leadSource: string }>) =>
1231
+ pushGtmEvent("tourLeadSourceSelected", {
1232
+ leadSource: e.detail.leadSource,
1233
+ buildingId: this.buildingId,
1234
+ })}
1235
+ ></contact-form>`;
1236
+ }
1237
+
1238
+ /** The consent text and the submit button, under the form or the itinerary. */
1239
+ private renderFooter(): TemplateResult {
1240
+ return html`<div
1241
+ id="tour-scheduler-footer"
1242
+ class=${classMap({ itinerary: this.extending })}
1243
+ >
1244
+ <div class="explanation consent">
1245
+ We'll send a confirmation and any follow-ups to your email address,
1246
+ please reply to the email to make any appointment changes.
1247
+ ${this.disclaimer()}
1248
+ ${this.bookingError
1249
+ ? html`<p class="error-message" role="alert">${this.bookingError}</p>`
1123
1250
  : ""}
1251
+ </div>
1252
+ <action-confirm-button
1253
+ id="schedule-bttn"
1254
+ .onClick=${() => this.submit()}
1255
+ .isLoading=${this.submitting}
1256
+ height="36px"
1257
+ width="100%"
1258
+ text=${this.extending
1259
+ ? "Confirm Tour Itinerary"
1260
+ : this.isMultiStop()
1261
+ ? "Schedule Tours"
1262
+ : "Schedule Tour"}
1263
+ ?disabled=${!this.canSubmit()}
1264
+ ></action-confirm-button>
1265
+ </div>`;
1266
+ }
1267
+
1268
+ private renderSchedule(): TemplateResult {
1269
+ if (this.reschedulePrompt !== null) return this.renderReschedulePrompt();
1270
+ const main = html`${this.planError
1271
+ ? html`<p class="error-message plan-error" role="alert">
1272
+ ${this.planError}
1273
+ <button class="link-button" @click=${() => this.runPlan()}>
1274
+ Try again
1275
+ </button>
1276
+ </p>`
1277
+ : ""}
1278
+ ${this.extending ? this.renderItineraryHeading() : ""}
1279
+ ${this.notice
1280
+ ? html`<p class="explanation notice" role="status">${this.notice}</p>`
1281
+ : ""}`;
1282
+ // Adding stops, phones and narrow modals: one column that scrolls, with
1283
+ // the footer under it.
1284
+ if (this.extending || this.mobile || this.narrow) {
1285
+ return html`${this.container(html`${main}
1124
1286
  <div
1125
1287
  id="book-tour-journey-items"
1126
1288
  class=${classMap({ itinerary: this.extending })}
1127
1289
  >
1128
- <itinerary-editor
1129
- .stops=${plan?.stops ?? []}
1130
- .communities=${this.communities}
1131
- .problems=${this.problems()}
1132
- .tourTypes=${this.tourTypeChoices()}
1133
- .tourType=${this.shownTourType}
1134
- .bookableDates=${plan?.bookable_dates ?? []}
1135
- .date=${this.date}
1136
- ?single=${!this.isMultiStop()}
1137
- ?stopsOnly=${this.extending}
1138
- ?canAddStop=${this.extending && !this.addingStop && this.canAddStop}
1139
- ?canEditCommunities=${this.group !== null && !this.extending}
1140
- ?loading=${this.planLoading}
1141
- ?planned=${plan !== null}
1142
- .primaryColor=${this.primaryColor}
1143
- .foregroundColorOnPrimaryBackgroundColor=${this
1144
- .foregroundColorOnPrimaryBackgroundColor}
1145
- @tour-type-change=${(e: CustomEvent<{ tourType: TourTypeId }>) =>
1146
- this.onTourType(e.detail.tourType)}
1147
- @date-change=${(e: CustomEvent<{ date: string }>) =>
1148
- this.onDate(e.detail.date)}
1149
- @stop-time-change=${(
1150
- e: CustomEvent<{ buildingId: number; start: string }>
1151
- ) => this.onStopTime(e.detail.buildingId, e.detail.start)}
1152
- @stops-reorder=${(e: CustomEvent<{ buildingIds: number[] }>) =>
1153
- this.onReorder(e.detail.buildingIds)}
1154
- @stop-remove=${(e: CustomEvent<{ buildingId: number }>) =>
1155
- this.onRemove(e.detail.buildingId)}
1156
- @edit-communities=${() => this.onEditCommunities()}
1157
- @add-stop=${() => (this.addingStop = true)}
1158
- @open-tour-link=${() =>
1159
- this.activeLinkType && this.openTourLink(this.activeLinkType)}
1160
- ></itinerary-editor>
1290
+ ${this.renderEditor()}
1161
1291
  ${this.extending
1162
1292
  ? ""
1163
- : html`<contact-form
1164
- .values=${this.formValues}
1165
- .layoutOptions=${this.bedroomOptions}
1166
- ?bedroomsRequired=${this.bedroomsRequired}
1167
- .leadSources=${this.leadSources}
1168
- ?showLeadSourceDropdown=${this.showLeadSourceDropdown()}
1169
- currentLeadSource=${this.currentLeadSource}
1170
- .country=${this.country}
1171
- ?mobile=${this.mobile}
1172
- @contact-change=${(e: CustomEvent<{ values: ContactValues }>) =>
1173
- this.onContactChange(e.detail.values)}
1174
- @lead-source-selected=${(
1175
- e: CustomEvent<{ leadSource: string }>
1176
- ) =>
1177
- pushGtmEvent("tourLeadSourceSelected", {
1178
- leadSource: e.detail.leadSource,
1179
- buildingId: this.buildingId,
1180
- })}
1181
- ></contact-form>`}
1182
- </div>
1183
- ${this.extending && this.addingStop ? this.renderAddStop() : ""}
1184
- `)}
1185
- <div
1186
- id="tour-scheduler-footer"
1187
- class=${classMap({ stacked: this.mobile })}
1188
- >
1189
- <div class="explanation">
1190
- We'll send a confirmation and any follow-ups to your email address,
1191
- please reply to the email to make any appointment changes.
1192
- ${this.disclaimer()}
1193
- ${this.bookingError
1194
- ? html`<p class="error-message" role="alert">
1195
- ${this.bookingError}
1196
- </p>`
1197
- : ""}
1293
+ : html`<div class="info-row">${this.renderContactForm()}</div>`}
1198
1294
  </div>
1199
- <action-confirm-button
1200
- id="schedule-bttn"
1201
- .onClick=${() => this.submit()}
1202
- .isLoading=${this.submitting}
1203
- height="50px"
1204
- width=${this.mobile ? "100%" : this.extending ? "200px" : "145px"}
1205
- text=${this.extending
1206
- ? "Confirm tour itinerary"
1207
- : this.isMultiStop()
1208
- ? "Schedule tours"
1209
- : "Schedule tour"}
1210
- ?disabled=${!this.canSubmit()}
1211
- ></action-confirm-button>
1212
- </div>`;
1295
+ ${this.extending && this.addingStop ? this.renderAddStop() : ""}`)}
1296
+ ${this.renderFooter()}`;
1297
+ }
1298
+ // The design's three columns: the form and its footer in the right one.
1299
+ return html`<div class="schedule-body">
1300
+ <div id="scheduler-container">
1301
+ ${main}
1302
+ <div id="book-tour-journey-items">${this.renderEditor()}</div>
1303
+ </div>
1304
+ <div class="info-column">
1305
+ <div class="info-scroll">${this.renderContactForm()}</div>
1306
+ ${this.renderFooter()}
1307
+ </div>
1308
+ </div>`;
1213
1309
  }
1214
1310
 
1215
1311
  /** Today's reschedule prompt, with the server's reason. */
1216
1312
  private renderReschedulePrompt(): TemplateResult {
1217
- return html`${this.container(html`<div>
1218
- <h2 class="journey-header">Reschedule Tour</h2>
1219
- <div class="explanation">
1313
+ return html`${this.container(html`<div class="page-intro">
1314
+ <h2 class="page-heading">Reschedule Tour</h2>
1315
+ <p class="explanation">
1220
1316
  ${this.reschedulePrompt} Would you like to reschedule?
1221
- </div>
1317
+ </p>
1222
1318
  </div>`)}
1223
- <div id="tour-scheduler-footer">
1224
- <div class="explanation">${this.disclaimer()}</div>
1319
+ <div id="tour-scheduler-footer" class="itinerary">
1320
+ <div class="explanation consent">${this.disclaimer()}</div>
1225
1321
  <div class="reschedule-buttons-wrapper">
1226
1322
  <action-confirm-button
1227
1323
  id="cancel-reschedule-bttn"
@@ -1232,16 +1328,16 @@ export class TourSchedulerV2 extends LitElement {
1232
1328
  else this.rescheduleCanceled = true;
1233
1329
  }}
1234
1330
  .isLoading=${this.submitting}
1235
- height="50px"
1236
- width="145px"
1331
+ height="36px"
1332
+ width="100%"
1237
1333
  text="Cancel"
1238
1334
  ></action-confirm-button>
1239
1335
  <action-confirm-button
1240
1336
  id="reschedule-button"
1241
1337
  .onClick=${() => this.submit(true)}
1242
1338
  .isLoading=${this.submitting}
1243
- height="50px"
1244
- width="145px"
1339
+ height="36px"
1340
+ width="100%"
1245
1341
  text="Reschedule"
1246
1342
  ></action-confirm-button>
1247
1343
  </div>
@@ -1249,11 +1345,13 @@ export class TourSchedulerV2 extends LitElement {
1249
1345
  }
1250
1346
 
1251
1347
  private renderRescheduleCanceled(): TemplateResult {
1252
- return html`<div id="confirmationMessage">
1253
- ${CalendarCheckIcon()}
1254
- <p>Thank you!</p>
1255
- <p>We'll see you at your originally scheduled tour time.</p>
1256
- </div>`;
1348
+ return this.container(html`<div id="confirmationMessage" class="page-intro">
1349
+ ${CheckCircleLineIcon(32)}
1350
+ <h2 class="page-heading">Thank you!</h2>
1351
+ <p class="explanation">
1352
+ We'll see you at your originally scheduled tour time.
1353
+ </p>
1354
+ </div>`);
1257
1355
  }
1258
1356
 
1259
1357
  private renderBooked(): TemplateResult {
@@ -1264,6 +1362,7 @@ export class TourSchedulerV2 extends LitElement {
1264
1362
  >
1265
1363
  ${this.extendInitial
1266
1364
  ? html`<community-picker
1365
+ class="nearby"
1267
1366
  variant="extend"
1268
1367
  .load=${this.loadExtendCommunities}
1269
1368
  .initial=${this.extendInitial}
@@ -1282,17 +1381,16 @@ export class TourSchedulerV2 extends LitElement {
1282
1381
  switch (this.step) {
1283
1382
  case "loading":
1284
1383
  return html`<div class="center-tour-not-avail" role="status">
1285
- <h1>Searching for availabilities...</h1>
1286
- <div class="loading-entire-tour-icon">
1287
- <mega-loader size="48"></mega-loader>
1288
- </div>
1384
+ <mega-loader size="48"></mega-loader>
1385
+ <h1 class="explanation">Searching for availabilities...</h1>
1289
1386
  </div>`;
1290
1387
  case "error":
1291
1388
  return html`<div class="center-tour-not-avail">
1292
1389
  <p class="error-message" role="alert">${this.loadError}</p>
1293
1390
  <action-confirm-button
1294
1391
  text="Try again"
1295
- height="40px"
1392
+ height="36px"
1393
+ width="160px"
1296
1394
  .onClick=${() => this.start()}
1297
1395
  ></action-confirm-button>
1298
1396
  </div>`;
@@ -1308,6 +1406,7 @@ export class TourSchedulerV2 extends LitElement {
1308
1406
  render(): TemplateResult {
1309
1407
  const back = this.backStep();
1310
1408
  return html`<div
1409
+ ${ref(this.observeModal)}
1311
1410
  class=${classMap({
1312
1411
  "tour-scheduler-full": !this.compactDesign && !this.mobile,
1313
1412
  "tour-scheduler-compact": !!this.compactDesign && !this.mobile,
@@ -1322,17 +1421,17 @@ export class TourSchedulerV2 extends LitElement {
1322
1421
  aria-label="Back"
1323
1422
  @click=${() => this.goTo(back)}
1324
1423
  >
1325
- ${ChevronLeftIcon("#202020")}
1424
+ ${ChevronLeftLineIcon(18)}
1326
1425
  </button>`
1327
1426
  : ""}
1328
- <h1 id="tour-header-title">Schedule a Tour</h1>
1427
+ <h1 id="tour-header-title">Schedule Tour</h1>
1329
1428
  </div>
1330
1429
  <button
1331
1430
  id="close-button"
1332
1431
  aria-label="Close scheduler"
1333
1432
  @click=${(e: MouseEvent) => this.onCloseClicked?.(e)}
1334
1433
  >
1335
- ${XOutlineIcon("#202020")}
1434
+ ${CloseLineIcon(16)}
1336
1435
  </button>
1337
1436
  </div>
1338
1437
  ${this.renderBody()}
@@ -1340,83 +1439,305 @@ export class TourSchedulerV2 extends LitElement {
1340
1439
  }
1341
1440
 
1342
1441
  static styles = [
1343
- tourSchedulerStyles,
1344
- InputStyles,
1442
+ schedulerV2Tokens,
1443
+ schedulerV2Styles,
1345
1444
  css`
1346
- /* New layout only: the back button beside the title. */
1445
+ /* The design's modal: 920px wide, a fixed height, its body scrolling. */
1446
+ .tour-scheduler-full,
1447
+ .tour-scheduler-compact,
1448
+ .tour-scheduler-mobile {
1449
+ background: #ffffff;
1450
+ border-radius: 16px;
1451
+ box-shadow: var(--tsv2-shadow);
1452
+ color: var(--tsv2-text);
1453
+ display: flex;
1454
+ flex-direction: column;
1455
+ font-family: var(--tsv2-font);
1456
+ letter-spacing: -0.01em;
1457
+ overflow: hidden;
1458
+ -webkit-font-smoothing: antialiased;
1459
+ }
1460
+
1461
+ .tour-scheduler-full {
1462
+ height: min(640px, calc(100vh - 64px));
1463
+ left: 50%;
1464
+ max-width: 920px;
1465
+ position: fixed;
1466
+ top: 50%;
1467
+ transform: translate(-50%, -50%);
1468
+ width: calc(100% - 32px);
1469
+ }
1470
+
1471
+ .tour-scheduler-compact {
1472
+ height: min(640px, calc(100vh - 64px));
1473
+ left: 5%;
1474
+ max-width: min(920px, calc(90% - 340px)); /* 340px is the chat popup */
1475
+ position: fixed;
1476
+ top: 50%;
1477
+ transform: translate(0%, -50%);
1478
+ width: 100%;
1479
+ }
1480
+
1481
+ .tour-scheduler-mobile {
1482
+ bottom: 0;
1483
+ height: calc(100vh - 12px);
1484
+ height: calc(100svh - 12px);
1485
+ left: 6px;
1486
+ position: fixed;
1487
+ right: 0;
1488
+ top: 6px;
1489
+ width: calc(100% - 12px);
1490
+ }
1491
+
1492
+ #top-header {
1493
+ align-items: center;
1494
+ border-bottom: 1px solid var(--tsv2-line);
1495
+ display: flex;
1496
+ flex: none;
1497
+ justify-content: space-between;
1498
+ padding: 16px;
1499
+ }
1500
+
1347
1501
  .title {
1348
1502
  align-items: center;
1349
1503
  display: flex;
1350
- gap: 12px;
1504
+ gap: 4px;
1351
1505
  }
1352
1506
 
1353
- #back-button {
1507
+ #tour-header-title {
1508
+ font-size: 16px;
1509
+ font-weight: 400;
1510
+ line-height: 24px;
1511
+ }
1512
+
1513
+ #back-button,
1514
+ #close-button {
1354
1515
  align-items: center;
1355
1516
  background: none;
1356
1517
  border: none;
1518
+ border-radius: 4px;
1519
+ color: #212529;
1357
1520
  cursor: pointer;
1358
1521
  display: inline-flex;
1359
- height: 24px;
1360
1522
  justify-content: center;
1361
1523
  padding: 0;
1524
+ }
1525
+
1526
+ #back-button {
1527
+ color: #000000;
1528
+ height: 24px;
1529
+ margin: -4px 0 -4px -6px;
1362
1530
  width: 24px;
1363
1531
  }
1364
1532
 
1365
- #back-button svg {
1366
- height: 12px;
1367
- width: 8px;
1533
+ #back-button:hover {
1534
+ background: var(--tsv2-hover);
1368
1535
  }
1369
1536
 
1370
- .notice {
1371
- margin: 0 0 16px;
1537
+ #close-button {
1538
+ margin-right: -3px;
1539
+ }
1540
+
1541
+ #scheduler-container,
1542
+ #mobile-body-container {
1543
+ flex: 1;
1544
+ min-height: 0;
1545
+ overflow-y: auto;
1546
+ position: relative;
1547
+ }
1548
+
1549
+ #scheduler-container {
1550
+ padding: 24px 20px;
1551
+ }
1552
+
1553
+ #mobile-body-container {
1554
+ padding: 20px 16px;
1555
+ }
1556
+
1557
+ /* The schedule step: the editor's two columns, then "Your Information". */
1558
+ .schedule-body {
1559
+ display: flex;
1560
+ flex: 1;
1561
+ min-height: 0;
1562
+ }
1563
+
1564
+ .schedule-body #scheduler-container {
1565
+ padding: 20px;
1566
+ }
1567
+
1568
+ #book-tour-journey-items {
1569
+ display: grid;
1570
+ gap: 16px;
1571
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
1572
+ }
1573
+
1574
+ /* A narrow modal: the editor's two columns, then "Your Information". */
1575
+ .info-row {
1576
+ grid-column: 1 / -1;
1577
+ }
1578
+
1579
+ .tour-scheduler-mobile #book-tour-journey-items {
1580
+ display: flex;
1581
+ flex-direction: column;
1582
+ gap: 24px;
1372
1583
  }
1373
1584
 
1374
- /* Adding stops: the design's one centred column of stops. */
1375
1585
  #book-tour-journey-items.itinerary {
1376
1586
  display: block;
1377
1587
  margin: 0 auto;
1378
- max-width: 30rem;
1588
+ max-width: 360px;
1379
1589
  }
1380
1590
 
1381
- .itinerary-heading {
1382
- margin-bottom: 16px;
1591
+ .info-column {
1592
+ border-left: 1px solid var(--tsv2-line);
1593
+ display: flex;
1594
+ flex: 0 0 320px;
1595
+ flex-direction: column;
1596
+ min-height: 0;
1597
+ }
1598
+
1599
+ .info-scroll {
1600
+ flex: 1;
1601
+ min-height: 0;
1602
+ overflow-y: auto;
1603
+ padding: 20px;
1604
+ }
1605
+
1606
+ #tour-scheduler-footer {
1607
+ background: #ffffff;
1608
+ border-top: 1px solid var(--tsv2-line);
1609
+ display: flex;
1610
+ flex: none;
1611
+ flex-direction: column;
1612
+ gap: 16px;
1613
+ padding: 16px;
1614
+ }
1615
+
1616
+ #tour-scheduler-footer.itinerary {
1617
+ align-items: center;
1618
+ }
1619
+
1620
+ #tour-scheduler-footer.itinerary > * {
1621
+ max-width: 360px;
1622
+ width: 100%;
1623
+ }
1624
+
1625
+ /* The consent runs wider than the button, so it takes fewer lines. */
1626
+ #tour-scheduler-footer.itinerary > .consent {
1627
+ max-width: 568px;
1628
+ text-align: center;
1629
+ }
1630
+
1631
+ .consent {
1632
+ font-size: 10px;
1633
+ line-height: 14px;
1634
+ }
1635
+
1636
+ /* formDisclaimer's own block: the design runs it on as one paragraph. */
1637
+ .consent > div {
1638
+ display: inline;
1639
+ padding-top: 0 !important;
1640
+ }
1641
+
1642
+ /* formDisclaimer colours its links inline; the design's are the accent. */
1643
+ .consent a {
1644
+ color: var(--tsv2-accent) !important;
1645
+ text-decoration: none;
1646
+ }
1647
+
1648
+ .consent a:hover {
1649
+ text-decoration: underline;
1650
+ }
1651
+
1652
+ action-confirm-button {
1653
+ --action-confirm-button-font: var(--tsv2-font);
1654
+ --action-confirm-button-radius: 4px;
1655
+ --action-confirm-button-disabled-background: var(--tsv2-line);
1656
+ display: block;
1657
+ }
1658
+
1659
+ .reschedule-buttons-wrapper {
1660
+ display: grid;
1661
+ gap: 8px;
1662
+ grid-template-columns: 1fr 1fr;
1663
+ }
1664
+
1665
+ .notice {
1666
+ margin: 0 0 16px;
1667
+ }
1668
+
1669
+ .plan-error {
1670
+ font-size: 12px;
1671
+ line-height: 16px;
1672
+ margin: 0 0 16px;
1673
+ }
1674
+
1675
+ /* A page's centred icon, title and line under it. */
1676
+ .page-intro {
1677
+ align-items: center;
1678
+ display: flex;
1679
+ flex-direction: column;
1383
1680
  text-align: center;
1384
1681
  }
1385
1682
 
1386
- /* The pickers' heading size. */
1387
- .itinerary-heading h2 {
1683
+ .page-intro > svg {
1684
+ flex: none;
1685
+ margin-bottom: 12px;
1686
+ }
1687
+
1688
+ .page-intro .page-heading {
1388
1689
  align-items: center;
1389
1690
  display: flex;
1390
- font-size: 20px;
1391
- font-weight: 400;
1392
1691
  gap: 8px;
1393
1692
  justify-content: center;
1394
- margin: 0;
1693
+ }
1694
+
1695
+ .page-intro .explanation {
1696
+ margin-top: 8px;
1697
+ }
1698
+
1699
+ .itinerary-heading {
1700
+ margin-bottom: 24px;
1701
+ }
1702
+
1703
+ .itinerary-heading .page-heading {
1704
+ line-height: 24px;
1705
+ }
1706
+
1707
+ .itinerary-heading .explanation {
1708
+ margin-top: 2px;
1709
+ }
1710
+
1711
+ .center-tour-not-avail {
1712
+ align-items: center;
1713
+ display: flex;
1714
+ flex: 1;
1715
+ flex-direction: column;
1716
+ gap: 16px;
1717
+ justify-content: center;
1718
+ padding: 24px;
1719
+ text-align: center;
1720
+ }
1721
+
1722
+ .center-tour-not-avail h1 {
1723
+ font-weight: 400;
1395
1724
  }
1396
1725
 
1397
1726
  .add-stop-picker {
1398
- margin-top: 24px;
1399
- position: relative;
1727
+ margin: 24px auto 0;
1728
+ max-width: 568px;
1400
1729
  }
1401
1730
 
1402
- /* The extend picker's top rule and padding put its heading 24px down. */
1403
1731
  .close-add-stop {
1404
- background: none;
1405
- border: none;
1406
- cursor: pointer;
1407
- padding: 4px;
1408
- position: absolute;
1409
- right: 0;
1410
- top: 24px;
1732
+ margin-left: 4px;
1411
1733
  }
1412
1734
 
1413
- .link-button {
1414
- background: none;
1415
- border: none;
1416
- color: inherit;
1417
- cursor: pointer;
1418
- font: inherit;
1419
- text-decoration: underline;
1735
+ /* The nearby list under a booking, below a rule. */
1736
+ community-picker.nearby {
1737
+ border-top: 1px solid var(--tsv2-line);
1738
+ margin: 24px auto 0;
1739
+ max-width: 568px;
1740
+ padding-top: 24px;
1420
1741
  }
1421
1742
  `,
1422
1743
  ];