@meetelise/chat 1.30.0 → 1.30.2

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 (228) hide show
  1. package/dist/src/MyPubnub.d.ts +116 -0
  2. package/dist/src/WebComponent/FeeCalculator/components/addon-item/addon-item-styles.d.ts +2 -0
  3. package/dist/src/WebComponent/FeeCalculator/components/addon-item/addon-item.d.ts +22 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/addon-item/index.d.ts +1 -0
  5. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
  6. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +34 -0
  7. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
  8. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
  9. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
  10. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
  11. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
  12. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +33 -0
  13. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
  14. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
  15. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
  16. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
  17. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
  18. package/dist/src/WebComponent/FeeCalculator/constants.d.ts +2 -0
  19. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
  20. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +59 -0
  21. package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
  22. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +80 -0
  23. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
  24. package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
  25. package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
  26. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
  27. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +14 -0
  28. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +100 -0
  29. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
  30. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
  31. package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
  32. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
  33. package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
  34. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
  35. package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
  36. package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
  37. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
  38. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
  39. package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
  40. package/dist/src/WebComponent/health-chat.d.ts +47 -0
  41. package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
  42. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
  43. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
  44. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
  45. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
  46. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
  47. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
  48. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
  49. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +3 -0
  50. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
  51. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
  52. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
  53. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
  54. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
  55. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
  56. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
  57. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
  58. package/dist/src/WebComponent/index.d.ts +2 -0
  59. package/dist/src/WebComponent/launcher/Launcher.d.ts +98 -0
  60. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
  61. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
  62. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
  63. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
  64. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
  65. package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
  66. package/dist/src/WebComponent/me-chat.d.ts +91 -0
  67. package/dist/src/WebComponent/me-select.d.ts +24 -0
  68. package/dist/src/WebComponent/mega-loader.d.ts +7 -0
  69. package/dist/src/WebComponent/mini-loader.d.ts +5 -0
  70. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
  71. package/dist/src/WebComponent/pubnub-chat.d.ts +49 -0
  72. package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
  73. package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
  74. package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
  75. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
  76. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
  77. package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
  78. package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
  79. package/dist/src/WebComponent/utils.d.ts +31 -0
  80. package/dist/src/analytics.d.ts +64 -0
  81. package/dist/src/disclaimers.d.ts +8 -0
  82. package/dist/src/fetchBuildingABTestType.d.ts +8 -0
  83. package/dist/src/fetchBuildingInfo.d.ts +57 -0
  84. package/dist/src/fetchBuildingWebchatView.d.ts +123 -0
  85. package/dist/src/fetchFeatureFlag.d.ts +14 -0
  86. package/dist/src/fetchLeadSources.d.ts +4 -0
  87. package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
  88. package/dist/src/getAvailabilities.d.ts +45 -0
  89. package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
  90. package/dist/src/getShouldAllowScheduling.d.ts +1 -0
  91. package/dist/src/getShouldShowWebchat.d.ts +3 -0
  92. package/dist/src/getTimezoneString.d.ts +1 -0
  93. package/dist/src/globals.d.ts +1 -0
  94. package/dist/src/gtm.d.ts +6 -0
  95. package/dist/src/handleChatId.d.ts +11 -0
  96. package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
  97. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
  98. package/dist/src/main/MEChat.d.ts +74 -0
  99. package/dist/src/main/utils.d.ts +2 -0
  100. package/dist/src/postLeadSources.d.ts +3 -0
  101. package/dist/src/rentgrata.d.ts +4 -0
  102. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
  103. package/dist/src/services/fees/calculateQuote.d.ts +53 -0
  104. package/dist/src/services/fees/fetchBuildingFees.d.ts +24 -0
  105. package/dist/src/services/fees/fetchBuildingFloorplans.d.ts +21 -0
  106. package/dist/src/services/fees/utils.d.ts +1 -0
  107. package/dist/src/svgIcons.d.ts +5 -0
  108. package/dist/src/themes.d.ts +5 -0
  109. package/dist/src/types/rest-sdk.types.d.ts +11 -0
  110. package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
  111. package/dist/src/utils.d.ts +13 -0
  112. package/package.json +1 -1
  113. package/public/dist/index.js +2 -3
  114. package/src/MyPubnub.ts +792 -0
  115. package/src/WebComponent/FeeCalculator/components/addon-item/addon-item-styles.ts +79 -0
  116. package/src/WebComponent/FeeCalculator/components/addon-item/addon-item.ts +121 -0
  117. package/src/WebComponent/FeeCalculator/components/addon-item/index.ts +1 -0
  118. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +126 -0
  119. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +205 -0
  120. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
  121. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
  122. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
  123. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
  124. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +144 -0
  125. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +241 -0
  126. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +74 -0
  127. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +72 -0
  128. package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
  129. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
  130. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
  131. package/src/WebComponent/FeeCalculator/constants.ts +3 -0
  132. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +334 -0
  133. package/src/WebComponent/FeeCalculator/fee-calculator.ts +369 -0
  134. package/src/WebComponent/FeeCalculator/index.ts +4 -0
  135. package/src/WebComponent/FeeCalculator/model/building-fee.ts +124 -0
  136. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
  137. package/src/WebComponent/LeadSourceClient.ts +332 -0
  138. package/src/WebComponent/MEChat.css +5 -0
  139. package/src/WebComponent/OfficeHours.ts +73 -0
  140. package/src/WebComponent/Scheduler/date-picker.ts +405 -0
  141. package/src/WebComponent/Scheduler/time-picker.ts +190 -0
  142. package/src/WebComponent/Scheduler/tour-scheduler.ts +1373 -0
  143. package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
  144. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
  145. package/src/WebComponent/actions/InputStyles.ts +57 -0
  146. package/src/WebComponent/actions/action-confirm-button.ts +125 -0
  147. package/src/WebComponent/actions/call-us-window.ts +445 -0
  148. package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
  149. package/src/WebComponent/actions/details-window.ts +150 -0
  150. package/src/WebComponent/actions/email-us-window.ts +555 -0
  151. package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
  152. package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
  153. package/src/WebComponent/chat-additional-actions.ts +135 -0
  154. package/src/WebComponent/health-chat.ts +270 -0
  155. package/src/WebComponent/healthchat-styles.ts +119 -0
  156. package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
  157. package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
  158. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +22 -0
  159. package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
  160. package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
  161. package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
  162. package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
  163. package/src/WebComponent/icons/DollarOutlineIcon.ts +18 -0
  164. package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
  165. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
  166. package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
  167. package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
  168. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
  169. package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
  170. package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
  171. package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
  172. package/src/WebComponent/index.ts +2 -0
  173. package/src/WebComponent/launcher/Launcher.ts +1282 -0
  174. package/src/WebComponent/launcher/launcherStyles.ts +500 -0
  175. package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
  176. package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
  177. package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
  178. package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
  179. package/src/WebComponent/leasing-chat-styles.ts +114 -0
  180. package/src/WebComponent/me-chat.ts +1262 -0
  181. package/src/WebComponent/me-select.ts +322 -0
  182. package/src/WebComponent/mega-loader.ts +36 -0
  183. package/src/WebComponent/mini-loader.ts +28 -0
  184. package/src/WebComponent/pubnub-chat-styles.ts +204 -0
  185. package/src/WebComponent/pubnub-chat.ts +928 -0
  186. package/src/WebComponent/pubnub-media.ts +208 -0
  187. package/src/WebComponent/pubnub-message-styles.ts +54 -0
  188. package/src/WebComponent/pubnub-message.ts +431 -0
  189. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
  190. package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
  191. package/src/WebComponent/utilities-chat.ts +270 -0
  192. package/src/WebComponent/utilities-styles.ts +110 -0
  193. package/src/WebComponent/utils.ts +82 -0
  194. package/src/analytics.ts +217 -0
  195. package/src/assetUrls.ts +6 -0
  196. package/src/disclaimers.ts +58 -0
  197. package/src/fetchBuildingABTestType.ts +21 -0
  198. package/src/fetchBuildingInfo.ts +87 -0
  199. package/src/fetchBuildingWebchatView.ts +156 -0
  200. package/src/fetchFeatureFlag.ts +250 -0
  201. package/src/fetchLeadSources.ts +98 -0
  202. package/src/fetchPhoneNumberFromSource.ts +31 -0
  203. package/src/fetchWebchatPreferences.ts +54 -0
  204. package/src/getAvailabilities.ts +179 -0
  205. package/src/getBuildingPhoneNumber.ts +26 -0
  206. package/src/getShouldAllowScheduling.ts +16 -0
  207. package/src/getShouldShowWebchat.ts +114 -0
  208. package/src/getTimezoneString.ts +39 -0
  209. package/src/globals.ts +1 -0
  210. package/src/gtm.ts +17 -0
  211. package/src/handleChatId.ts +101 -0
  212. package/src/insertDNIIntoWebsite.ts +146 -0
  213. package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
  214. package/src/main/MEChat.test.ts +110 -0
  215. package/src/main/MEChat.ts +404 -0
  216. package/src/main/utils.ts +70 -0
  217. package/src/postLeadSources.ts +44 -0
  218. package/src/rentgrata.ts +74 -0
  219. package/src/replaceSelectButtonsWithNewLink.ts +69 -0
  220. package/src/services/fees/calculateQuote.ts +136 -0
  221. package/src/services/fees/fetchBuildingFees.ts +63 -0
  222. package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
  223. package/src/services/fees/utils.ts +4 -0
  224. package/src/svgIcons.ts +14 -0
  225. package/src/themes.ts +65 -0
  226. package/src/types/rest-sdk.types.ts +13 -0
  227. package/src/types/webchat-no-show-reason.ts +6 -0
  228. package/src/utils.ts +121 -0
@@ -0,0 +1,1282 @@
1
+ import { html, LitElement, TemplateResult, css } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { createRef, ref, Ref } from "lit/directives/ref.js";
4
+ import { launcherStyles } from "./launcherStyles";
5
+ import { typeEmojiStyles } from "./typeEmojiStyles";
6
+ import { typeMiniStyles } from "./typeMiniStyles";
7
+ import {
8
+ EmailUsWindow,
9
+ installEmailUsWindow,
10
+ } from "../actions/email-us-window";
11
+ import { StyleInfo, styleMap } from "lit/directives/style-map.js";
12
+ import { installCallUsWindow } from "../actions/call-us-window";
13
+ import { TourScheduler } from "../Scheduler/tour-scheduler";
14
+ import { FeeCalculator } from "../FeeCalculator/fee-calculator";
15
+ import { installFeeCalculator } from "../FeeCalculator";
16
+ import { LabeledOption } from "../../fetchBuildingInfo";
17
+ import {
18
+ defaultBackgroundColor,
19
+ defaultPrimaryColor,
20
+ hexToAlmostWhite,
21
+ } from "../../themes";
22
+ import "./mobile-launcher";
23
+ import "../actions/collapse-expand-button";
24
+ import { DesignConcepts } from "../../fetchBuildingWebchatView";
25
+ import { isMobile } from "../../utils";
26
+ import classNames from "classnames";
27
+ import LeadSourceClient from "../LeadSourceClient";
28
+
29
+ import {
30
+ closeRengrataWidget,
31
+ hasRentgrata,
32
+ openRengrataWidget,
33
+ } from "../../rentgrata";
34
+ import noop from "lodash/noop";
35
+ import { ChatOutlineIcon } from "../icons/ChatOutlineIcon";
36
+ import { ChevronRightIcon } from "../icons/ChevronRightIcon";
37
+ import { BookTourOutlineIcon } from "../icons/BookTourOutlineIcon";
38
+ import { EmailOutlineIcon } from "../icons/EmailOutlineIcon";
39
+ import { PhoneOutlineIcon } from "../icons/PhoneOutlineIcon";
40
+ import { HeyThereEmoji } from "../icons/HeyThereEmojiIcon";
41
+ import { ContactResidentIcon } from "../icons/ContactResidentIcon";
42
+ import { ApplyOutlineIcon } from "../icons/ApplyOutlineIcon";
43
+ import { CalculatorOutlineIcon } from "../icons/CalculatorOutlineIcon";
44
+
45
+ @customElement("meetelise-launcher")
46
+ export class Launcher extends LitElement {
47
+ static styles = css`
48
+ ${launcherStyles}
49
+ ${typeEmojiStyles}
50
+ ${typeMiniStyles}
51
+ `;
52
+
53
+ @property({ attribute: true })
54
+ isMinimized = false;
55
+
56
+ @property()
57
+ mobileStyles: StyleInfo = {};
58
+
59
+ @property({ type: Boolean })
60
+ isFirstMount = false;
61
+
62
+ @property({ attribute: false })
63
+ autoOpenChatWidget = false;
64
+
65
+ @property()
66
+ phoneNumber = "";
67
+ @property({ attribute: true })
68
+ buildingName = "";
69
+ @property({ attribute: true })
70
+ chatId = "";
71
+ @property({ attribute: true })
72
+ orgLegalName = "";
73
+ @property({ attribute: true })
74
+ chatCallUsHeader = "";
75
+ @property({ attribute: false })
76
+ buildingId = 0;
77
+ @property({ attribute: true })
78
+ buildingSlug = "";
79
+ @property({ attribute: true })
80
+ orgSlug = "";
81
+ @property({ attribute: true })
82
+ sgtUrl = "";
83
+ @property({ attribute: true })
84
+ selfGuidedTourEnabled = false;
85
+ @property({ attribute: true })
86
+ selfGuidedToursTypeOffered = "";
87
+ @property({ attribute: true })
88
+ designConcept = "";
89
+ @property({ attribute: true })
90
+ featureFlagShowDropdown = "";
91
+ @property({ attribute: false })
92
+ leadSources: string[] = [];
93
+ @property({ attribute: true })
94
+ currentLeadSource = "";
95
+ @property({ attribute: true })
96
+ escortedToursLink = "";
97
+ @property({ attribute: true })
98
+ virtualToursLink = "";
99
+
100
+ @property({ type: Boolean })
101
+ hasChatEnabledDesktop = false;
102
+ @property({ type: Boolean })
103
+ hasChatEnabledMobile = false;
104
+
105
+ @property({ type: Boolean })
106
+ hasEmailEnabledDesktop = false;
107
+ @property({ type: Boolean })
108
+ hasEmailEnabledMobile = false;
109
+
110
+ @property({ attribute: true })
111
+ hasApplyNowEnabledDesktop = false;
112
+ @property({ attribute: true })
113
+ hasApplyNowEnabledMobile = false;
114
+ @property({ attribute: true })
115
+ applicationLink = "";
116
+
117
+ @property({ type: Boolean })
118
+ hasCallUsEnabledDesktop = false;
119
+ @property({ type: Boolean })
120
+ hasCallUsEnabledMobile = false;
121
+
122
+ @property({ type: Boolean })
123
+ hasTextUsEnabledDesktop = false;
124
+ @property({ type: Boolean })
125
+ hasTextUsEnabledMobile = false;
126
+
127
+ @property({ type: Boolean })
128
+ hasSSTEnabledDesktop = false;
129
+ @property({ type: Boolean })
130
+ hasSSTEnabledMobile = false;
131
+
132
+ @property({ attribute: false })
133
+ tourTypeOptions: LabeledOption[] = [];
134
+ @property({ attribute: true })
135
+ hasDynamicSchedulingEnabled = false;
136
+
137
+ @property({ attribute: true })
138
+ hasPricingCalculatorEnabledDesktop = false;
139
+ @property({ attribute: true })
140
+ hasPricingCalculatorEnabledMobile = false;
141
+
142
+ onExitChat: () => void = () => {
143
+ return;
144
+ };
145
+
146
+ @property({ attribute: false })
147
+ hasHideMobileFeatures = false;
148
+
149
+ @property({ type: Number })
150
+ private right = undefined;
151
+
152
+ @property({ type: Number })
153
+ private bottom = undefined;
154
+
155
+ @property({ type: Number })
156
+ private top = undefined;
157
+
158
+ @property({ type: Number })
159
+ private left = undefined;
160
+
161
+ @property({ attribute: true })
162
+ showTourNextToChat = false;
163
+
164
+ @property({ attribute: false })
165
+ onChatTapped: () => void = () => {
166
+ return;
167
+ };
168
+
169
+ @property({ attribute: true })
170
+ onClickMinimize: (e: MouseEvent) => void = () => {
171
+ return;
172
+ };
173
+
174
+ @property({ attribute: true })
175
+ onSstClose: () => void = noop;
176
+
177
+ @property({ attribute: true })
178
+ overrideRentgrata = false;
179
+
180
+ @property({ attribute: false })
181
+ launcherStyles: StyleInfo = {};
182
+
183
+ @property({ attribute: true })
184
+ primaryColor: string = defaultPrimaryColor;
185
+
186
+ @property({ attribute: true })
187
+ backgroundColor: string = defaultBackgroundColor;
188
+
189
+ @property({ attribute: true })
190
+ foregroundColorOnPrimaryBackgroundColor = "white";
191
+ @property({ attribute: true })
192
+ foregroundColorOnSecondaryBackgroundColor = "black";
193
+
194
+ @property({ attribute: true })
195
+ private leadSourceClient: LeadSourceClient | null = null;
196
+
197
+ @state()
198
+ isEmailWindowOpen = false;
199
+ @state()
200
+ isCallUsWindowOpen = false;
201
+ @state()
202
+ isSSTWindowOpen = false;
203
+ @state()
204
+ isTextUsWindowOpen = false;
205
+ @state()
206
+ isCalculatorWindowOpen = false;
207
+
208
+ @state()
209
+ private isMobileFeaturesExpanded = false;
210
+
211
+ getNumCallToActions = (): number => {
212
+ const isEmailEnabled =
213
+ this.hasEmailEnabledDesktop || this.hasEmailEnabledMobile;
214
+ const isPhoneNumberEnabled =
215
+ !!this.phoneNumber &&
216
+ (this.hasCallUsEnabledDesktop || this.hasCallUsEnabledMobile);
217
+ const isSSTEnabled = this.hasSSTEnabledDesktop || this.hasSSTEnabledMobile;
218
+ const isTextUsEnabled =
219
+ this.hasTextUsEnabledDesktop || this.hasTextUsEnabledMobile;
220
+ const isApplyNowEnabled =
221
+ this.hasApplyNowEnabledDesktop || this.hasApplyNowEnabledMobile;
222
+ const isPricingCalculatorEnabled =
223
+ this.hasPricingCalculatorEnabledDesktop ||
224
+ this.hasPricingCalculatorEnabledMobile;
225
+
226
+ return [
227
+ isEmailEnabled,
228
+ isPhoneNumberEnabled,
229
+ isSSTEnabled,
230
+ isTextUsEnabled,
231
+ isApplyNowEnabled,
232
+ isPricingCalculatorEnabled,
233
+ ].filter((v) => v).length;
234
+ };
235
+
236
+ emailUsWindowRef: Ref<EmailUsWindow> = createRef();
237
+ tourSchedulerRef: Ref<TourScheduler> = createRef();
238
+ calculatorWindowRef: Ref<FeeCalculator> = createRef();
239
+
240
+ updated = async (): Promise<void> => {
241
+ this.attachOnClickToEmailUsWindow();
242
+ this.attachOnClickToSSTWindow();
243
+ this.attachOnClickToCalculatorWindow();
244
+
245
+ // If we have the SST tour popup open next to the chat widget, we want to close it
246
+ if (
247
+ (this.isEmailWindowOpen || this.isCallUsWindowOpen) &&
248
+ this.isSSTWindowOpen
249
+ ) {
250
+ this.onCloseSSTWindow();
251
+ }
252
+ };
253
+
254
+ attachOnClickToEmailUsWindow = (): void => {
255
+ const emailUsWindowRef = this.emailUsWindowRef.value;
256
+ if (!emailUsWindowRef) {
257
+ return;
258
+ }
259
+ emailUsWindowRef.onCloseClicked = this.onCloseEmailWindow;
260
+ };
261
+
262
+ attachOnClickToSSTWindow = (): void => {
263
+ const sstWindowRef = this.tourSchedulerRef.value;
264
+ if (!sstWindowRef) {
265
+ return;
266
+ }
267
+ sstWindowRef.onCloseClicked = this.onCloseSSTWindow;
268
+ };
269
+
270
+ attachOnClickToCalculatorWindow = (): void => {
271
+ const calculatorWindowRef = this.calculatorWindowRef.value;
272
+ if (!calculatorWindowRef) return;
273
+
274
+ calculatorWindowRef.onCloseClicked = this.onCloseCalculatorWindow;
275
+ calculatorWindowRef.onClickEmailOption = this.onClickEmailOption;
276
+ calculatorWindowRef.onClickPhoneOption = this.onClickPhoneOption;
277
+ calculatorWindowRef.onClickSSTOption = this.onClickSSTOption;
278
+ calculatorWindowRef.onClickTextUsOption = this.onClickTextUsOption;
279
+ };
280
+
281
+ onClickEmailOption = (e: MouseEvent): void => {
282
+ e.preventDefault();
283
+ e.stopPropagation();
284
+ closeRengrataWidget();
285
+
286
+ this.isEmailWindowOpen = true;
287
+ };
288
+
289
+ onCloseEmailWindow = (): void => {
290
+ this.isEmailWindowOpen = false;
291
+ };
292
+
293
+ onClickPhoneOption = (e: MouseEvent): void => {
294
+ e.preventDefault();
295
+ e.stopPropagation();
296
+ closeRengrataWidget();
297
+ this.isCallUsWindowOpen = true;
298
+ };
299
+
300
+ onClickApplyNowOption = (e: MouseEvent): void => {
301
+ e.preventDefault();
302
+ e.stopPropagation();
303
+ closeRengrataWidget();
304
+ window.open(this.applicationLink, "_blank");
305
+ };
306
+
307
+ onClickPriceCalculatorOption = (e: MouseEvent): void => {
308
+ e.preventDefault();
309
+ e.stopPropagation();
310
+ closeRengrataWidget();
311
+ this.isCalculatorWindowOpen = true;
312
+ };
313
+
314
+ onClosePhoneWindow = (): void => {
315
+ this.isCallUsWindowOpen = false;
316
+ };
317
+
318
+ onClickSSTOption = (e: MouseEvent): void => {
319
+ e.preventDefault();
320
+ e.stopPropagation();
321
+ closeRengrataWidget();
322
+ this.isSSTWindowOpen = true;
323
+ };
324
+
325
+ onCloseSSTWindow = (): void => {
326
+ this.onSstClose();
327
+ this.isSSTWindowOpen = false;
328
+ if (this.showTourNextToChat) {
329
+ this.dispatchEvent(
330
+ new CustomEvent("closeShowTourNextToChat", {
331
+ bubbles: true,
332
+ })
333
+ );
334
+ }
335
+ };
336
+
337
+ onCloseCalculatorWindow = (): void => {
338
+ this.isCalculatorWindowOpen = false;
339
+ };
340
+
341
+ onClickTextUsOption = (e: MouseEvent): void => {
342
+ e.preventDefault();
343
+ e.stopPropagation();
344
+ this.isTextUsWindowOpen = true;
345
+ };
346
+
347
+ isCallToActionWindowOpen = (): boolean => {
348
+ return (
349
+ [
350
+ this.isEmailWindowOpen,
351
+ this.isCallUsWindowOpen,
352
+ this.isSSTWindowOpen,
353
+ this.isTextUsWindowOpen,
354
+ this.isCalculatorWindowOpen,
355
+ ].filter((v) => v).length === 1
356
+ );
357
+ };
358
+
359
+ toggleMobileFeatures = (): void => {
360
+ this.isMobileFeaturesExpanded = !this.isMobileFeaturesExpanded;
361
+ };
362
+
363
+ renderActionPills = (): TemplateResult => {
364
+ if (
365
+ isMobile() ||
366
+ this.isMinimized ||
367
+ this.designConcept === DesignConcepts.MINIMIZED
368
+ ) {
369
+ return html` ${this.hasHideMobileFeatures && isMobile()
370
+ ? html`<collapse-expand-button
371
+ .toExpand=${this.isMobileFeaturesExpanded}
372
+ .primaryColor=${this.primaryColor}
373
+ .onClick=${this.toggleMobileFeatures}
374
+ ></collapse-expand-button>`
375
+ : ""}
376
+ <mobile-launcher
377
+ .onClickMinimize=${this.onClickMinimize}
378
+ .onClickEmailOption=${this.onClickEmailOption}
379
+ .onClickPhoneOption=${this.onClickPhoneOption}
380
+ .onClickSSTOption=${this.onClickSSTOption}
381
+ .onChatTapped=${this.onChatTapped}
382
+ .onClickApplyNowOption=${this.onClickApplyNowOption}
383
+ .onClickPriceCalculatorOption=${this.onClickPriceCalculatorOption}
384
+ .overrideRentgrata=${this.overrideRentgrata}
385
+ .isMobileDesign=${isMobile() ||
386
+ this.designConcept === DesignConcepts.MINIMIZED}
387
+ .primaryColor=${this.primaryColor}
388
+ .backgroundColor=${this.backgroundColor}
389
+ .hasChatEnabled=${!isMobile()
390
+ ? this.hasChatEnabledDesktop
391
+ : this.hasChatEnabledMobile}
392
+ .hasEmailEnabled=${!isMobile()
393
+ ? this.hasEmailEnabledDesktop
394
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
395
+ ? false
396
+ : this.hasEmailEnabledMobile}
397
+ .hasCallUsEnabled=${!isMobile()
398
+ ? this.phoneNumber && this.hasCallUsEnabledDesktop
399
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
400
+ ? false
401
+ : this.hasCallUsEnabledMobile}
402
+ .hasTextUsEnabled=${!isMobile()
403
+ ? this.hasTextUsEnabledDesktop
404
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
405
+ ? false
406
+ : this.hasTextUsEnabledMobile}
407
+ .hasSSTEnabled=${!isMobile()
408
+ ? this.hasSSTEnabledDesktop
409
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
410
+ ? false
411
+ : this.hasSSTEnabledMobile}
412
+ .hasApplyNowEnabled=${!isMobile()
413
+ ? this.hasApplyNowEnabledDesktop
414
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
415
+ ? false
416
+ : this.hasApplyNowEnabledMobile}
417
+ .applicationLink=${this.applicationLink}
418
+ .hasPricingCalculatorEnabled=${!isMobile()
419
+ ? this.hasPricingCalculatorEnabledDesktop
420
+ : this.hasHideMobileFeatures && !this.isMobileFeaturesExpanded
421
+ ? false
422
+ : this.hasPricingCalculatorEnabledMobile}
423
+ .foregroundColorOnSecondaryBackgroundColor=${this
424
+ .foregroundColorOnSecondaryBackgroundColor}
425
+ ></mobile-launcher>`;
426
+ }
427
+
428
+ if (this.designConcept === DesignConcepts.EMOJI) {
429
+ return this.emojiPillList();
430
+ }
431
+ return this.verticalPillList();
432
+ };
433
+
434
+ private emojiPillList = (): TemplateResult => {
435
+ const emojiPillListItems: {
436
+ pillKey: string;
437
+ pill: TemplateResult | null;
438
+ }[] = [
439
+ {
440
+ pillKey: "Email",
441
+ pill: this.hasEmailEnabledDesktop
442
+ ? html` <div
443
+ class="type-hey__pill"
444
+ @click=${this.onClickEmailOption}
445
+ style=${styleMap({
446
+ background: this.backgroundColor,
447
+ })}
448
+ >
449
+ <div class="type-hey__pill-left">
450
+ <div class="type-hey__icon">${EmailOutlineIcon(
451
+ this.foregroundColorOnSecondaryBackgroundColor
452
+ )}</div>
453
+ <div style=${styleMap({
454
+ color: this.foregroundColorOnSecondaryBackgroundColor,
455
+ })}><span class="title-bold">Email</span> an agent</div>
456
+ </div>
457
+ <div class="type-gradient__icon">${ChevronRightIcon(
458
+ this.foregroundColorOnSecondaryBackgroundColor
459
+ )}</div>
460
+ </div>
461
+ </div>`
462
+ : null,
463
+ },
464
+ {
465
+ pillKey: "SST",
466
+ pill: this.hasSSTEnabledDesktop
467
+ ? html`
468
+ <div
469
+ class="type-hey__pill"
470
+ @click=${this.onClickSSTOption}
471
+ style=${styleMap({
472
+ background: this.backgroundColor,
473
+ })}>
474
+ <div class="type-hey__pill-left">
475
+ <div class="type-hey__icon">${BookTourOutlineIcon(
476
+ this.foregroundColorOnSecondaryBackgroundColor
477
+ )}</div>
478
+ <div style=${styleMap({
479
+ color: this.foregroundColorOnSecondaryBackgroundColor,
480
+ })}>
481
+ <span class="title-bold">Book</span> a tour
482
+ </div>
483
+ </div>
484
+ <div class="type-gradient__icon">${ChevronRightIcon(
485
+ this.foregroundColorOnSecondaryBackgroundColor
486
+ )}</div>
487
+ </div>
488
+ </div>
489
+ `
490
+ : null,
491
+ },
492
+ {
493
+ pillKey: "Phone",
494
+ pill:
495
+ this.phoneNumber &&
496
+ (this.hasCallUsEnabledDesktop || this.hasTextUsEnabledDesktop)
497
+ ? html`
498
+ <div
499
+ class="type-hey__pill"
500
+ @click=${this.onClickPhoneOption}
501
+ style=${styleMap({
502
+ background: this.backgroundColor,
503
+ })}
504
+ >
505
+ <div class="type-hey__pill-left">
506
+ <div class="type-hey__icon">${PhoneOutlineIcon(
507
+ this.foregroundColorOnSecondaryBackgroundColor
508
+ )}</div>
509
+ <div style=${styleMap({
510
+ color: this.foregroundColorOnSecondaryBackgroundColor,
511
+ })}>
512
+ ${
513
+ this.hasCallUsEnabledDesktop &&
514
+ this.hasTextUsEnabledDesktop
515
+ ? html` <span class="title-bold">Call</span> or
516
+ <span class="title-bold">text</span> us`
517
+ : ""
518
+ }
519
+ ${
520
+ this.hasCallUsEnabledDesktop &&
521
+ !this.hasTextUsEnabledDesktop
522
+ ? html` <span class="title-bold">Call</span> us`
523
+ : ""
524
+ }
525
+ ${
526
+ !this.hasCallUsEnabledDesktop &&
527
+ this.hasTextUsEnabledDesktop
528
+ ? html` <span class="title-bold">Text</span> us`
529
+ : ""
530
+ }
531
+
532
+ </div>
533
+ </div>
534
+ <div class="type-gradient__icon">${ChevronRightIcon(
535
+ this.foregroundColorOnSecondaryBackgroundColor
536
+ )}</div>
537
+ </div>
538
+ </div>
539
+ `
540
+ : null,
541
+ },
542
+ {
543
+ pillKey: "Apply",
544
+ pill:
545
+ this.applicationLink && this.hasApplyNowEnabledDesktop
546
+ ? html`
547
+ <div
548
+ @click=${this.onClickApplyNowOption}
549
+ class="type-hey__pill"
550
+ style=${styleMap({
551
+ background: this.backgroundColor,
552
+ })}
553
+ >
554
+ <div class="type-hey__pill-left">
555
+ <div class="type-hey__icon">
556
+ ${ApplyOutlineIcon(
557
+ this.foregroundColorOnSecondaryBackgroundColor
558
+ )}
559
+ </div>
560
+ <div
561
+ class="vertical-pill-title"
562
+ style=${styleMap({
563
+ color: this.foregroundColorOnSecondaryBackgroundColor,
564
+ })}
565
+ >
566
+ <span class="title-bold">Apply</span>
567
+ now
568
+ </div>
569
+ </div>
570
+ <div class="type-gradient__icon">
571
+ ${ChevronRightIcon(
572
+ this.foregroundColorOnSecondaryBackgroundColor
573
+ )}
574
+ </div>
575
+ </div>
576
+ `
577
+ : null,
578
+ },
579
+ {
580
+ pillKey: "Price Calculator",
581
+ pill: this.hasPricingCalculatorEnabledDesktop
582
+ ? html`
583
+ <div
584
+ class="type-hey__pill"
585
+ @click=${this.onClickPriceCalculatorOption}
586
+ style=${styleMap({
587
+ background: this.backgroundColor,
588
+ })}
589
+ >
590
+ <div class="type-hey__pill-left">
591
+ <div class="type-hey__icon">
592
+ ${CalculatorOutlineIcon(
593
+ this.foregroundColorOnSecondaryBackgroundColor
594
+ )}
595
+ </div>
596
+ <div
597
+ style=${styleMap({
598
+ color: this.foregroundColorOnSecondaryBackgroundColor,
599
+ })}
600
+ >
601
+ <span class="title-bold">Calculate</span> cost
602
+ </div>
603
+ </div>
604
+ <div class="type-gradient__icon">
605
+ ${ChevronRightIcon(
606
+ this.foregroundColorOnSecondaryBackgroundColor
607
+ )}
608
+ </div>
609
+ </div>
610
+ `
611
+ : null,
612
+ },
613
+ ];
614
+ const pills = emojiPillListItems.filter((v) => !!v.pill);
615
+
616
+ return html`
617
+ <div
618
+ class="type-hey__list"
619
+ style=${styleMap({
620
+ background: this.primaryColor,
621
+ height: 300 + Math.max(36 * pills.length - 108, 0) + "px", // 36 for the pill + gap, 108 for the "expected" height of the pills section, after which point it needs to grow
622
+ })}
623
+ >
624
+ <div class="type-hey__chat-container">
625
+ ${this.hasChatEnabledDesktop
626
+ ? html`<minimize-expand-button
627
+ .primaryColor=${this.primaryColor}
628
+ .onClick=${this.onClickMinimize}
629
+ ></minimize-expand-button>`
630
+ : ""}
631
+ </div>
632
+
633
+ <div class="type-hey__top-section">
634
+ <div class="type-hey__ai-topic">
635
+ <p>AI Assistant</p>
636
+ <div class="type-hey__ai-topic-notch"></div>
637
+ </div>
638
+ <div class="type-hey__greeting">
639
+ <h1>Hey there!</h1>
640
+ <div>${HeyThereEmoji()}</div>
641
+ </div>
642
+ ${this.hasChatEnabledDesktop
643
+ ? html`
644
+ <div
645
+ id="type-hey__ask-prompt"
646
+ class="type-hey__pill"
647
+ @click=${this.onChatTapped}
648
+ style=${styleMap({
649
+ background: hexToAlmostWhite(this.primaryColor, 0.2),
650
+ })}
651
+ >
652
+ <div class="type-hey__pill-left">
653
+ <div class="type-hey__icon">
654
+ ${ChatOutlineIcon(
655
+ this.foregroundColorOnPrimaryBackgroundColor
656
+ )}
657
+ </div>
658
+ <div
659
+ style=${styleMap({
660
+ color: this.foregroundColorOnPrimaryBackgroundColor,
661
+ })}
662
+ >
663
+ <span class="title-bold">Chat</span> with us
664
+ </div>
665
+ </div>
666
+ <div class="type-gradient__icon">
667
+ ${ChevronRightIcon(
668
+ this.foregroundColorOnPrimaryBackgroundColor
669
+ )}
670
+ </div>
671
+ </div>
672
+ `
673
+ : ""}
674
+ </div>
675
+
676
+ <div
677
+ class="type-hey__bottom-section"
678
+ style=${styleMap({
679
+ height: 120 + Math.max(0, 36 * pills.length - 108) + "px", // 36 for the pill + gap, 108 for the "expected" height of the pills section, after which point it needs to grow
680
+ })}
681
+ >
682
+ <div class="type-hey__botton-section-pills">
683
+ ${pills.map((p) => p.pill)}
684
+ ${this.overrideRentgrata && hasRentgrata()
685
+ ? html`
686
+ <div
687
+ class="type-hey__pill"
688
+ @click=${() => {
689
+ openRengrataWidget();
690
+ }}
691
+ style=${styleMap({
692
+ background: this.backgroundColor,
693
+ })}>
694
+ <div class="type-hey__pill-left">
695
+ <div class="type-hey__icon">${ContactResidentIcon(
696
+ "black"
697
+ )}</div>
698
+ <div>
699
+ <span class="title-bold">Contact</span> a resident
700
+ </div>
701
+ </div>
702
+ <div class="type-gradient__icon">${ChevronRightIcon(
703
+ this.foregroundColorOnSecondaryBackgroundColor
704
+ )}</div>
705
+ </div>
706
+ </div>`
707
+ : ""}
708
+ </div>
709
+
710
+ <div class="type-hey__bottom-info">
711
+ <div class="type-hey__bottom-info-inner">
712
+ Online <span class="title-bold">24 hours</span> a day,
713
+ <span class="title-bold">7</span> days a week
714
+ </div>
715
+ </div>
716
+ </div>
717
+ </div>
718
+ `;
719
+ };
720
+
721
+ private verticalPillList = (): TemplateResult => {
722
+ // Some clients are insisting on the tour pill being at the top
723
+ const showTourAtTop =
724
+ this.orgSlug === "Pacific Urban Residential" ||
725
+ this.orgSlug === "cbc11aba-21c4-4571-bc43-ff9d86a029e3";
726
+
727
+ const verticalPillListItems: {
728
+ pillKey: string;
729
+ pill: TemplateResult | null;
730
+ }[] = [
731
+ {
732
+ pillKey: "Chat",
733
+ pill: this.hasChatEnabledDesktop
734
+ ? html`
735
+ <div class="inner-pill-wrapper"
736
+ style=${styleMap({
737
+ background: showTourAtTop
738
+ ? this.backgroundColor
739
+ : this.primaryColor,
740
+ })}
741
+ @click=${this.onChatTapped}>
742
+ <div class="vertical-pill-left">
743
+ <div class="vertical-pill-icon">${ChatOutlineIcon(
744
+ showTourAtTop
745
+ ? this.foregroundColorOnSecondaryBackgroundColor
746
+ : this.foregroundColorOnPrimaryBackgroundColor
747
+ )}</div>
748
+ <div class="vertical-pill-title" style=${styleMap({
749
+ color: showTourAtTop
750
+ ? this.foregroundColorOnSecondaryBackgroundColor
751
+ : this.foregroundColorOnPrimaryBackgroundColor,
752
+ })}>
753
+ <span class="vertical-pill-bold">Chat</span> with us
754
+ </div>
755
+ </div>
756
+ <div class="chevron-right">${ChevronRightIcon(
757
+ showTourAtTop
758
+ ? this.foregroundColorOnSecondaryBackgroundColor
759
+ : this.foregroundColorOnPrimaryBackgroundColor
760
+ )}</div>
761
+ </div>
762
+ </div>
763
+ `
764
+ : null,
765
+ },
766
+ {
767
+ pillKey: "Price Calculator",
768
+ pill: this.hasPricingCalculatorEnabledDesktop
769
+ ? html`
770
+ <div
771
+ @click=${this.onClickPriceCalculatorOption}
772
+ class="inner-pill-wrapper"
773
+ style=${styleMap({
774
+ background: this.backgroundColor,
775
+ })}
776
+ >
777
+ <div class="vertical-pill-left">
778
+ <div class="vertical-pill-icon">
779
+ ${CalculatorOutlineIcon(
780
+ this.foregroundColorOnSecondaryBackgroundColor
781
+ )}
782
+ </div>
783
+ <div class="vertical-pill-title">
784
+ <span class="vertical-pill-bold">Calculate</span> Cost
785
+ </div>
786
+ </div>
787
+ <div class="chevron-right">
788
+ ${ChevronRightIcon(
789
+ this.foregroundColorOnSecondaryBackgroundColor
790
+ )}
791
+ </div>
792
+ </div>
793
+ `
794
+ : null,
795
+ },
796
+ {
797
+ pillKey: "SST",
798
+ pill: this.hasSSTEnabledDesktop
799
+ ? html`
800
+ <div
801
+ @click=${this.onClickSSTOption}
802
+ id="overlay-inner-pill"
803
+ class="inner-pill-wrapper"
804
+ style=${styleMap({
805
+ background: showTourAtTop
806
+ ? this.primaryColor
807
+ : this.backgroundColor,
808
+ })}
809
+ >
810
+ <div class="vertical-pill-left">
811
+ <div class="vertical-pill-icon">
812
+ ${BookTourOutlineIcon(
813
+ showTourAtTop
814
+ ? this.foregroundColorOnPrimaryBackgroundColor
815
+ : this.foregroundColorOnSecondaryBackgroundColor
816
+ )}
817
+ </div>
818
+ <div
819
+ class="vertical-pill-title"
820
+ style=${styleMap({
821
+ color: showTourAtTop
822
+ ? this.foregroundColorOnPrimaryBackgroundColor
823
+ : this.foregroundColorOnSecondaryBackgroundColor,
824
+ })}
825
+ >
826
+ <span class="vertical-pill-bold">Book</span>
827
+ a tour
828
+ </div>
829
+ </div>
830
+ <div class="chevron-right">
831
+ ${ChevronRightIcon(
832
+ showTourAtTop
833
+ ? this.foregroundColorOnPrimaryBackgroundColor
834
+ : this.foregroundColorOnSecondaryBackgroundColor
835
+ )}
836
+ </div>
837
+ </div>
838
+ `
839
+ : null,
840
+ },
841
+ {
842
+ pillKey: "Email",
843
+ pill: this.hasEmailEnabledDesktop
844
+ ? html`
845
+ <div
846
+ @click=${this.onClickEmailOption}
847
+ class="inner-pill-wrapper"
848
+ style=${styleMap({
849
+ background: this.backgroundColor,
850
+ })}
851
+ >
852
+ <div class="vertical-pill-left">
853
+ <div class="vertical-pill-icon">
854
+ ${EmailOutlineIcon(
855
+ this.foregroundColorOnSecondaryBackgroundColor
856
+ )}
857
+ </div>
858
+ <div
859
+ class="vertical-pill-title"
860
+ style=${styleMap({
861
+ color: this.foregroundColorOnSecondaryBackgroundColor,
862
+ })}
863
+ >
864
+ <span class="vertical-pill-bold">Email</span>
865
+ an agent
866
+ </div>
867
+ </div>
868
+ <div class="chevron-right">
869
+ ${ChevronRightIcon(
870
+ this.foregroundColorOnSecondaryBackgroundColor
871
+ )}
872
+ </div>
873
+ </div>
874
+ `
875
+ : null,
876
+ },
877
+ {
878
+ pillKey: "Phone",
879
+ pill:
880
+ this.phoneNumber &&
881
+ (this.hasCallUsEnabledDesktop || this.hasTextUsEnabledDesktop)
882
+ ? html`
883
+ <div
884
+ @click=${this.onClickPhoneOption}
885
+ class="inner-pill-wrapper"
886
+ style=${styleMap({
887
+ background: this.backgroundColor,
888
+ })}
889
+ >
890
+ <div class="vertical-pill-left">
891
+ <div class="vertical-pill-icon">
892
+ ${PhoneOutlineIcon(
893
+ this.foregroundColorOnSecondaryBackgroundColor
894
+ )}
895
+ </div>
896
+ ${this.hasCallUsEnabledDesktop &&
897
+ this.hasTextUsEnabledDesktop
898
+ ? html`
899
+ <div
900
+ class="vertical-pill-title"
901
+ style=${styleMap({
902
+ color:
903
+ this.foregroundColorOnSecondaryBackgroundColor,
904
+ })}
905
+ >
906
+ <span class="vertical-pill-bold">Call</span> or
907
+ <span class="vertical-pill-bold">text</span> us
908
+ </div>
909
+ `
910
+ : ""}
911
+ ${this.hasCallUsEnabledDesktop &&
912
+ !this.hasTextUsEnabledDesktop
913
+ ? html`
914
+ <div
915
+ class="vertical-pill-title"
916
+ style=${styleMap({
917
+ color:
918
+ this.foregroundColorOnSecondaryBackgroundColor,
919
+ })}
920
+ >
921
+ <span class="vertical-pill-bold">Call</span> us
922
+ </div>
923
+ `
924
+ : ""}
925
+ ${!this.hasCallUsEnabledDesktop &&
926
+ this.hasTextUsEnabledDesktop
927
+ ? html`
928
+ <div
929
+ class="vertical-pill-title"
930
+ style=${styleMap({
931
+ color:
932
+ this.foregroundColorOnSecondaryBackgroundColor,
933
+ })}
934
+ >
935
+ <span class="vertical-pill-bold">Text</span> us
936
+ </div>
937
+ `
938
+ : ""}
939
+ </div>
940
+ <div class="chevron-right">
941
+ ${ChevronRightIcon(
942
+ this.foregroundColorOnSecondaryBackgroundColor
943
+ )}
944
+ </div>
945
+ </div>
946
+ `
947
+ : null,
948
+ },
949
+ {
950
+ pillKey: "Apply",
951
+ pill:
952
+ this.applicationLink && this.hasApplyNowEnabledDesktop
953
+ ? html`
954
+ <div
955
+ @click=${this.onClickApplyNowOption}
956
+ class="inner-pill-wrapper"
957
+ style=${styleMap({
958
+ background: this.backgroundColor,
959
+ })}
960
+ >
961
+ <div class="vertical-pill-left">
962
+ <div class="vertical-pill-icon">
963
+ ${ApplyOutlineIcon(
964
+ this.foregroundColorOnSecondaryBackgroundColor
965
+ )}
966
+ </div>
967
+ <div
968
+ class="vertical-pill-title"
969
+ style=${styleMap({
970
+ color: this.foregroundColorOnSecondaryBackgroundColor,
971
+ })}
972
+ >
973
+ <span class="vertical-pill-bold">Apply</span>
974
+ now
975
+ </div>
976
+ </div>
977
+ <div class="chevron-right">
978
+ ${ChevronRightIcon(
979
+ this.foregroundColorOnSecondaryBackgroundColor
980
+ )}
981
+ </div>
982
+ </div>
983
+ `
984
+ : null,
985
+ },
986
+ ];
987
+ const pills = verticalPillListItems.filter((v) => !!v.pill);
988
+ if (showTourAtTop) {
989
+ const sstIndex = pills.findIndex((p) => p.pillKey === "SST");
990
+ if (sstIndex !== -1) {
991
+ const [sstPill] = pills.splice(sstIndex, 1);
992
+ pills.unshift(sstPill);
993
+ }
994
+ }
995
+ return html`
996
+ <div class="vertical-pill-list">
997
+ <div class="vertical-pill-list">
998
+ ${this.hasChatEnabledDesktop
999
+ ? html`<button
1000
+ @click=${this.onClickMinimize}
1001
+ class="minimize-button"
1002
+ aria-label="Minimize"
1003
+ >
1004
+ <div class="chevron-down">${ChevronRightIcon("black")}</div>
1005
+ </button>`
1006
+ : ""}
1007
+ ${pills.map((p) => p.pill)}
1008
+ ${this.overrideRentgrata && hasRentgrata()
1009
+ ? html`<div
1010
+ @click=${() => {
1011
+ openRengrataWidget();
1012
+ }}
1013
+ class="inner-pill-wrapper"
1014
+ style=${styleMap({
1015
+ background: this.backgroundColor,
1016
+ })}
1017
+ >
1018
+ <div class="vertical-pill-left">
1019
+ <div class="vertical-pill-icon">
1020
+ ${ContactResidentIcon(
1021
+ this.foregroundColorOnSecondaryBackgroundColor
1022
+ )}
1023
+ </div>
1024
+ <div class="vertical-pill-title">
1025
+ <span class="vertical-pill-bold">Contact</span> a resident
1026
+ </div>
1027
+ </div>
1028
+ <div class="chevron-right">${ChevronRightIcon("black")}</div>
1029
+ </div>`
1030
+ : ""}
1031
+ </div>
1032
+ </div>
1033
+ `;
1034
+ };
1035
+
1036
+ render(): TemplateResult {
1037
+ installEmailUsWindow();
1038
+ installCallUsWindow();
1039
+ installFeeCalculator();
1040
+
1041
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1042
+ (window as any).eliseAi.onOpenSST = (callBack?: () => void) => {
1043
+ this.isSSTWindowOpen = true;
1044
+ this.isCallUsWindowOpen = false;
1045
+ this.isEmailWindowOpen = false;
1046
+ this.onExitChat();
1047
+ if (callBack) {
1048
+ callBack();
1049
+ }
1050
+ };
1051
+
1052
+ if (this.hasChatEnabledDesktop || this.hasChatEnabledMobile) {
1053
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1054
+ (window as any).eliseAi.onOpenChat = (callBack?: () => void) => {
1055
+ this.onChatTapped();
1056
+ this.isSSTWindowOpen = false;
1057
+ this.isCallUsWindowOpen = false;
1058
+ this.isEmailWindowOpen = false;
1059
+ if (callBack) {
1060
+ callBack();
1061
+ }
1062
+ };
1063
+ }
1064
+ if (this.hasCallUsEnabledDesktop || this.hasCallUsEnabledMobile) {
1065
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1066
+ (window as any).eliseAi.onOpenCallUsWindow = (callBack?: () => void) => {
1067
+ this.isCallUsWindowOpen = true;
1068
+ this.isSSTWindowOpen = false;
1069
+ this.isEmailWindowOpen = false;
1070
+ this.onExitChat();
1071
+ if (callBack) {
1072
+ callBack();
1073
+ }
1074
+ };
1075
+ }
1076
+ if (this.hasEmailEnabledDesktop || this.hasEmailEnabledMobile) {
1077
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1078
+ (window as any).eliseAi.onOpenEmailUsWindow = (callBack?: () => void) => {
1079
+ this.isEmailWindowOpen = true;
1080
+ this.isSSTWindowOpen = false;
1081
+ this.isCallUsWindowOpen = false;
1082
+ this.onExitChat();
1083
+ if (callBack) {
1084
+ callBack();
1085
+ }
1086
+ };
1087
+ }
1088
+ if (
1089
+ this.hasPricingCalculatorEnabledDesktop ||
1090
+ this.hasPricingCalculatorEnabledMobile
1091
+ ) {
1092
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1093
+ (window as any).eliseAi.onOpenPriceCalculatorWindow = (
1094
+ callBack?: () => void
1095
+ ) => {
1096
+ this.isCalculatorWindowOpen = true;
1097
+ if (callBack) {
1098
+ callBack();
1099
+ }
1100
+ };
1101
+ }
1102
+ const overrideStyleWindows = {
1103
+ top:
1104
+ !isMobile() && this.top !== undefined && !isNaN(this.top)
1105
+ ? `${this.top}px`
1106
+ : undefined,
1107
+ bottom:
1108
+ !isMobile() && this.bottom !== undefined && !isNaN(this.bottom)
1109
+ ? `${this.bottom}px`
1110
+ : undefined,
1111
+ left:
1112
+ !isMobile() && this.left !== undefined && !isNaN(this.left)
1113
+ ? `${this.left}px`
1114
+ : undefined,
1115
+ right:
1116
+ !isMobile() && this.right !== undefined && !isNaN(this.right)
1117
+ ? `${this.right}px`
1118
+ : undefined,
1119
+ };
1120
+
1121
+ return html`
1122
+ <div
1123
+ class=${classNames({
1124
+ ["launcher__mobile-launcher-wrapper"]: isMobile() || this.isMinimized,
1125
+ ["launcher__mini-launcher-wrapper"]: !isMobile() && !this.isMinimized,
1126
+ ["launcher__mini-elevated"]:
1127
+ this.orgSlug.toLowerCase() === "livcor" &&
1128
+ (isMobile() || this.isMinimized),
1129
+ })}
1130
+ style=${styleMap({
1131
+ ...this.launcherStyles,
1132
+ ...this.mobileStyles,
1133
+ top:
1134
+ !isMobile() && this.top !== undefined && !isNaN(this.top)
1135
+ ? `${this.top - 700}px`
1136
+ : this.mobileStyles.top !== undefined
1137
+ ? `${this.mobileStyles.top}px`
1138
+ : undefined,
1139
+ bottom:
1140
+ !isMobile() && this.bottom !== undefined && !isNaN(this.bottom)
1141
+ ? `${this.bottom}px`
1142
+ : this.mobileStyles.bottom !== undefined
1143
+ ? `${this.mobileStyles.bottom}px`
1144
+ : "72px",
1145
+ left:
1146
+ !isMobile() && this.left !== undefined && !isNaN(this.left)
1147
+ ? `${this.left}px`
1148
+ : this.mobileStyles.left !== undefined
1149
+ ? `${this.mobileStyles.left}px`
1150
+ : undefined,
1151
+ right:
1152
+ !isMobile() && this.right !== undefined && !isNaN(this.right)
1153
+ ? `${this.right}px`
1154
+ : this.mobileStyles.right !== undefined
1155
+ ? `${this.mobileStyles.right}px`
1156
+ : "18px",
1157
+ })}
1158
+ >
1159
+ ${this.isEmailWindowOpen
1160
+ ? html`<div
1161
+ class="launcher__window-wrapper"
1162
+ style=${styleMap(overrideStyleWindows)}
1163
+ >
1164
+ <email-us-window
1165
+ id="email-us-window"
1166
+ chatId="${this.chatId}"
1167
+ .leadSources="${this.leadSources}"
1168
+ currentLeadSource="${this.currentLeadSource}"
1169
+ orgSlug="${this.orgSlug}"
1170
+ buildingSlug="${this.buildingSlug}"
1171
+ featureFlagShowDropdown="${this.featureFlagShowDropdown}"
1172
+ ${ref(this.emailUsWindowRef)}
1173
+ .buildingId=${this.buildingId}
1174
+ .buildingName=${this.buildingName}
1175
+ .leadSourceClient=${this.leadSourceClient}
1176
+ .orgLegalName=${this.orgLegalName}
1177
+ >
1178
+ </email-us-window>
1179
+ </div>`
1180
+ : ""}
1181
+ ${this.isSSTWindowOpen
1182
+ ? html`<div
1183
+ class="launcher__window-wrapper"
1184
+ style=${styleMap(overrideStyleWindows)}
1185
+ >
1186
+ <tour-scheduler
1187
+ id="tour-scheduler-window"
1188
+ chatId="${this.chatId}"
1189
+ orgSlug="${this.orgSlug}"
1190
+ buildingSlug="${this.buildingSlug}"
1191
+ sgtUrl="${this.sgtUrl}"
1192
+ selfGuidedTourEnabled="${this.selfGuidedTourEnabled}"
1193
+ selfGuidedToursTypeOffered="${this.selfGuidedToursTypeOffered}"
1194
+ escortedToursLink="${this.escortedToursLink}"
1195
+ virtualToursLink="${this.virtualToursLink}"
1196
+ currentLeadSource="${this.currentLeadSource}"
1197
+ .hasDynamicSchedulingEnabled=${this.hasDynamicSchedulingEnabled}
1198
+ .leadSources="${this.leadSources}"
1199
+ .tourTypeOptions=${this.tourTypeOptions}
1200
+ .orgLegalName=${this.orgLegalName}
1201
+ buildingId=${this.buildingId}
1202
+ featureFlagShowDropdown="${this.featureFlagShowDropdown}"
1203
+ .buildingName=${this.buildingName}
1204
+ .primaryColor=${this.primaryColor}
1205
+ .foregroundColorOnPrimaryBackgroundColor=${this
1206
+ .foregroundColorOnPrimaryBackgroundColor}
1207
+ .foregroundColorOnSecondaryBackgroundColor=${this
1208
+ .foregroundColorOnSecondaryBackgroundColor}
1209
+ .compactDesign=${this.showTourNextToChat
1210
+ ? this.showTourNextToChat
1211
+ : ""}
1212
+ .leadSourceClient=${this.leadSourceClient}
1213
+ ${ref(this.tourSchedulerRef)}
1214
+ ></tour-scheduler>
1215
+ </div>`
1216
+ : ""}
1217
+ ${this.isCallUsWindowOpen
1218
+ ? html`
1219
+ <div
1220
+ class="launcher__window-wrapper"
1221
+ style=${styleMap(overrideStyleWindows)}
1222
+ >
1223
+ <call-us-window
1224
+ id="call-us-window"
1225
+ .onCloseClicked=${this.onClosePhoneWindow}
1226
+ phoneNumberToCall="${this.phoneNumber}"
1227
+ .buildingId=${this.buildingId}
1228
+ chatCallUsHeader="${this.chatCallUsHeader}"
1229
+ hasTextUsEnabled=${this.hasTextUsEnabledDesktop ||
1230
+ this.hasTextUsEnabledMobile
1231
+ ? true
1232
+ : ""}
1233
+ hasCallUsEnabled=${this.hasCallUsEnabledDesktop ||
1234
+ this.hasCallUsEnabledMobile
1235
+ ? true
1236
+ : ""}
1237
+ currentLeadSource="${this.currentLeadSource}"
1238
+ buildingSlug="${this.buildingSlug}"
1239
+ buildingName="${this.buildingName}"
1240
+ orgSlug="${this.orgSlug}"
1241
+ .leadSourceClient=${this.leadSourceClient}
1242
+ .orgLegalName=${this.orgLegalName}
1243
+ ></call-us-window>
1244
+ </div>
1245
+ `
1246
+ : ""}
1247
+ ${this.isCalculatorWindowOpen
1248
+ ? html`
1249
+ <div
1250
+ class="launcher__window-wrapper"
1251
+ style=${styleMap(overrideStyleWindows)}
1252
+ >
1253
+ <fee-calculator
1254
+ id="fee-calculator-window"
1255
+ ${ref(this.calculatorWindowRef)}
1256
+ buildingSlug=${this.buildingSlug}
1257
+ orgSlug="${this.orgSlug}"
1258
+ primaryColor="${this.primaryColor}"
1259
+ backgroundColor="${this.backgroundColor}"
1260
+ .compactDesign=${this.showTourNextToChat}
1261
+ .onCloseClicked=${this.onCloseCalculatorWindow}
1262
+ .onClickEmailOption=${this.onClickEmailOption}
1263
+ .onClickPhoneOption=${this.onClickPhoneOption}
1264
+ .onClickSSTOption=${this.onClickSSTOption}
1265
+ .onClickTextUsOption=${this.onClickTextUsOption}
1266
+ ></fee-calculator>
1267
+ </div>
1268
+ `
1269
+ : ""}
1270
+ ${!this.isCallToActionWindowOpen() && !this.showTourNextToChat
1271
+ ? this.renderActionPills()
1272
+ : ""}
1273
+ </div>
1274
+ `;
1275
+ }
1276
+ }
1277
+
1278
+ export const installLauncher = (): void => {
1279
+ if (!window.customElements.get("meetelise-launcher")) {
1280
+ window.customElements.define("meetelise-launcher", Launcher);
1281
+ }
1282
+ };