@meetelise/chat 1.35.0 → 1.35.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 (282) hide show
  1. package/dist/src/MyPubnub.d.ts +116 -0
  2. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +2 -0
  3. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +28 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +2 -0
  5. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +18 -0
  6. package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +2 -0
  7. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +2 -0
  8. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +22 -0
  9. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
  10. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +46 -0
  11. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
  12. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
  13. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
  14. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
  15. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
  16. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +34 -0
  17. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
  18. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
  19. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
  20. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
  21. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
  22. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
  23. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
  24. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
  25. package/dist/src/WebComponent/FeeCalculator/constants.d.ts +3 -0
  26. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
  27. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +55 -0
  28. package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
  29. package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +41 -0
  30. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +82 -0
  31. package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +5 -0
  32. package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +4 -0
  33. package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +13 -0
  34. package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +6 -0
  35. package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +4 -0
  36. package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +18 -0
  37. package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +8 -0
  38. package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +1 -0
  39. package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +13 -0
  40. package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +10 -0
  41. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
  42. package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +31 -0
  43. package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
  44. package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
  45. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
  46. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +16 -0
  47. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +102 -0
  48. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
  49. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
  50. package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
  51. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
  52. package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
  53. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
  54. package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
  55. package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
  56. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
  57. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
  58. package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
  59. package/dist/src/WebComponent/health-chat.d.ts +47 -0
  60. package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
  61. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
  62. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
  63. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
  64. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
  65. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
  66. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
  67. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
  68. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +7 -0
  69. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
  70. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
  71. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
  72. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
  73. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
  74. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
  75. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
  76. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
  77. package/dist/src/WebComponent/index.d.ts +2 -0
  78. package/dist/src/WebComponent/launcher/Launcher.d.ts +99 -0
  79. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
  80. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
  81. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
  82. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
  83. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
  84. package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
  85. package/dist/src/WebComponent/loaders/index.d.ts +4 -0
  86. package/dist/src/WebComponent/loaders/mega-loader.d.ts +7 -0
  87. package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
  88. package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
  89. package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
  90. package/dist/src/WebComponent/me-chat.d.ts +91 -0
  91. package/dist/src/WebComponent/me-select.d.ts +24 -0
  92. package/dist/src/WebComponent/mini-loader.d.ts +5 -0
  93. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
  94. package/dist/src/WebComponent/pubnub-chat.d.ts +48 -0
  95. package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
  96. package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
  97. package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
  98. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
  99. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
  100. package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
  101. package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
  102. package/dist/src/WebComponent/utils.d.ts +31 -0
  103. package/dist/src/analytics.d.ts +64 -0
  104. package/dist/src/disclaimers.d.ts +16 -0
  105. package/dist/src/fetchBuildingABTestType.d.ts +8 -0
  106. package/dist/src/fetchBuildingInfo.d.ts +58 -0
  107. package/dist/src/fetchBuildingWebchatView.d.ts +124 -0
  108. package/dist/src/fetchFeatureFlag.d.ts +14 -0
  109. package/dist/src/fetchLeadSources.d.ts +4 -0
  110. package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
  111. package/dist/src/getAvailabilities.d.ts +46 -0
  112. package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
  113. package/dist/src/getShouldAllowScheduling.d.ts +1 -0
  114. package/dist/src/getShouldShowWebchat.d.ts +3 -0
  115. package/dist/src/getTimezoneString.d.ts +1 -0
  116. package/dist/src/globals.d.ts +2 -0
  117. package/dist/src/gtm.d.ts +6 -0
  118. package/dist/src/handleChatId.d.ts +11 -0
  119. package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
  120. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
  121. package/dist/src/main/MEChat.d.ts +74 -0
  122. package/dist/src/main/utils.d.ts +2 -0
  123. package/dist/src/postLeadSources.d.ts +3 -0
  124. package/dist/src/rentgrata.d.ts +4 -0
  125. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
  126. package/dist/src/services/fees/calculateQuote.d.ts +14 -0
  127. package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +10 -0
  128. package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
  129. package/dist/src/services/fees/utils.d.ts +1 -0
  130. package/dist/src/svgIcons.d.ts +5 -0
  131. package/dist/src/themes.d.ts +5 -0
  132. package/dist/src/types/incentive-v2.d.ts +23 -0
  133. package/dist/src/types/rest-sdk.types.d.ts +11 -0
  134. package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
  135. package/dist/src/utils/getWidgetOverrides.d.ts +39 -0
  136. package/dist/src/utils/queryParamBuilder.d.ts +8 -0
  137. package/dist/src/utils.d.ts +13 -0
  138. package/package.json +1 -1
  139. package/public/dist/index.js +250 -164
  140. package/src/MyPubnub.ts +792 -0
  141. package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +39 -0
  142. package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +206 -0
  143. package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +6 -0
  144. package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +101 -0
  145. package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +98 -0
  146. package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +9 -0
  147. package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +136 -0
  148. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +151 -0
  149. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +261 -0
  150. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
  151. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
  152. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
  153. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
  154. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +149 -0
  155. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +247 -0
  156. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +82 -0
  157. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +76 -0
  158. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
  159. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
  160. package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
  161. package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
  162. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
  163. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
  164. package/src/WebComponent/FeeCalculator/constants.ts +5 -0
  165. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +310 -0
  166. package/src/WebComponent/FeeCalculator/fee-calculator.ts +341 -0
  167. package/src/WebComponent/FeeCalculator/index.ts +4 -0
  168. package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +84 -0
  169. package/src/WebComponent/FeeCalculator/model/building-fee.ts +126 -0
  170. package/src/WebComponent/FeeCalculator/model/desired-addon.ts +6 -0
  171. package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +4 -0
  172. package/src/WebComponent/FeeCalculator/model/index.ts +13 -0
  173. package/src/WebComponent/FeeCalculator/model/item-combination.ts +16 -0
  174. package/src/WebComponent/FeeCalculator/model/item-quantity.ts +4 -0
  175. package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +45 -0
  176. package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +9 -0
  177. package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +1 -0
  178. package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +34 -0
  179. package/src/WebComponent/FeeCalculator/model/rentable-item.ts +21 -0
  180. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
  181. package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +54 -0
  182. package/src/WebComponent/LeadSourceClient.ts +332 -0
  183. package/src/WebComponent/MEChat.css +5 -0
  184. package/src/WebComponent/OfficeHours.ts +73 -0
  185. package/src/WebComponent/Scheduler/date-picker.ts +405 -0
  186. package/src/WebComponent/Scheduler/time-picker.ts +195 -0
  187. package/src/WebComponent/Scheduler/tour-scheduler.ts +1430 -0
  188. package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
  189. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
  190. package/src/WebComponent/actions/InputStyles.ts +57 -0
  191. package/src/WebComponent/actions/action-confirm-button.ts +125 -0
  192. package/src/WebComponent/actions/call-us-window.ts +467 -0
  193. package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
  194. package/src/WebComponent/actions/details-window.ts +150 -0
  195. package/src/WebComponent/actions/email-us-window.ts +556 -0
  196. package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
  197. package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
  198. package/src/WebComponent/chat-additional-actions.ts +135 -0
  199. package/src/WebComponent/health-chat.ts +270 -0
  200. package/src/WebComponent/healthchat-styles.ts +119 -0
  201. package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
  202. package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
  203. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +80 -0
  204. package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
  205. package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
  206. package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
  207. package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
  208. package/src/WebComponent/icons/DollarOutlineIcon.ts +26 -0
  209. package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
  210. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
  211. package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
  212. package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
  213. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
  214. package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
  215. package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
  216. package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
  217. package/src/WebComponent/index.ts +2 -0
  218. package/src/WebComponent/launcher/Launcher.ts +1284 -0
  219. package/src/WebComponent/launcher/launcherStyles.ts +500 -0
  220. package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
  221. package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
  222. package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
  223. package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
  224. package/src/WebComponent/leasing-chat-styles.ts +114 -0
  225. package/src/WebComponent/loaders/index.ts +7 -0
  226. package/src/WebComponent/loaders/mega-loader.ts +36 -0
  227. package/src/WebComponent/loaders/skeleton-card.ts +31 -0
  228. package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
  229. package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
  230. package/src/WebComponent/me-chat.ts +1264 -0
  231. package/src/WebComponent/me-select.ts +322 -0
  232. package/src/WebComponent/mini-loader.ts +28 -0
  233. package/src/WebComponent/pubnub-chat-styles.ts +204 -0
  234. package/src/WebComponent/pubnub-chat.ts +771 -0
  235. package/src/WebComponent/pubnub-media.ts +208 -0
  236. package/src/WebComponent/pubnub-message-styles.ts +54 -0
  237. package/src/WebComponent/pubnub-message.ts +431 -0
  238. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
  239. package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
  240. package/src/WebComponent/utilities-chat.ts +270 -0
  241. package/src/WebComponent/utilities-styles.ts +110 -0
  242. package/src/WebComponent/utils.ts +82 -0
  243. package/src/analytics.ts +217 -0
  244. package/src/assetUrls.ts +6 -0
  245. package/src/disclaimers.ts +301 -0
  246. package/src/fetchBuildingABTestType.ts +21 -0
  247. package/src/fetchBuildingInfo.ts +88 -0
  248. package/src/fetchBuildingWebchatView.ts +176 -0
  249. package/src/fetchFeatureFlag.ts +250 -0
  250. package/src/fetchLeadSources.ts +98 -0
  251. package/src/fetchPhoneNumberFromSource.ts +31 -0
  252. package/src/fetchWebchatPreferences.ts +54 -0
  253. package/src/getAvailabilities.ts +189 -0
  254. package/src/getBuildingPhoneNumber.ts +26 -0
  255. package/src/getShouldAllowScheduling.ts +16 -0
  256. package/src/getShouldShowWebchat.ts +114 -0
  257. package/src/getTimezoneString.ts +40 -0
  258. package/src/globals.ts +3 -0
  259. package/src/gtm.ts +17 -0
  260. package/src/handleChatId.ts +101 -0
  261. package/src/insertDNIIntoWebsite.ts +146 -0
  262. package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
  263. package/src/main/MEChat.test.ts +110 -0
  264. package/src/main/MEChat.ts +404 -0
  265. package/src/main/utils.ts +70 -0
  266. package/src/postLeadSources.ts +44 -0
  267. package/src/rentgrata.ts +74 -0
  268. package/src/replaceSelectButtonsWithNewLink.ts +91 -0
  269. package/src/services/fees/calculateQuote.ts +74 -0
  270. package/src/services/fees/fetchBuildingFees.ts +50 -0
  271. package/src/services/fees/fetchBuildingFeesV2.ts +59 -0
  272. package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
  273. package/src/services/fees/fetchBuildingUnits.ts +86 -0
  274. package/src/services/fees/utils.ts +4 -0
  275. package/src/svgIcons.ts +14 -0
  276. package/src/themes.ts +65 -0
  277. package/src/types/incentive-v2.ts +24 -0
  278. package/src/types/rest-sdk.types.ts +13 -0
  279. package/src/types/webchat-no-show-reason.ts +6 -0
  280. package/src/utils/getWidgetOverrides.ts +91 -0
  281. package/src/utils/queryParamBuilder.ts +28 -0
  282. package/src/utils.ts +121 -0
@@ -0,0 +1,467 @@
1
+ import axios from "axios";
2
+ import { css, html, LitElement, TemplateResult } from "lit";
3
+ import { customElement, property, state } from "lit/decorators.js";
4
+ import { classMap } from "lit/directives/class-map.js";
5
+ import { createRef, ref, Ref } from "lit/directives/ref.js";
6
+ import { pushGtmEvent } from "../../gtm";
7
+ import { isMobile } from "../../utils";
8
+ import { PhoneOutlineIcon } from "../icons/PhoneOutlineIcon";
9
+ import LeadSourceClient, {
10
+ getDefaultLeadSourceAttribution,
11
+ } from "../LeadSourceClient";
12
+
13
+ import { getOfficeHourText } from "../OfficeHours";
14
+ import {
15
+ formatToPhoneInput,
16
+ isModifierKey,
17
+ isNumericInput,
18
+ } from "./formatPhoneNumber";
19
+ import { InputStyles } from "./InputStyles";
20
+
21
+ @customElement("call-us-window")
22
+ export class CallUsWindow extends LitElement {
23
+ static styles = [
24
+ InputStyles,
25
+ css`
26
+ #call-us-window__content-wrapper {
27
+ font-family: "Helvetica Neue", Arial;
28
+ font-style: normal;
29
+ color: 11ee1e;
30
+ font-size: 14px;
31
+ }
32
+ .call-us-window__header {
33
+ font-family: "Helvetica Neue", Arial;
34
+ font-style: normal;
35
+ font-weight: 700;
36
+ line-height: 140%;
37
+ font-size: 14px;
38
+ margin: 0;
39
+ }
40
+
41
+ .call-us-window__call-us-text {
42
+ margin: 0 0 10px;
43
+ }
44
+
45
+ .call-us-window__phone-redirect {
46
+ display: flex;
47
+ justify-content: flex-start;
48
+ align-items: center;
49
+ margin-bottom: 28px;
50
+ gap: 8px;
51
+
52
+ color: #202020;
53
+ font-size: 18px;
54
+ line-height: 24px;
55
+ }
56
+ .call-us-window__phone-redirect > a {
57
+ color: unset;
58
+ text-decoration: underline;
59
+ }
60
+
61
+ .call-us-window__office-hours-wrapper {
62
+ margin: 0 0 16px;
63
+ }
64
+
65
+ .call-us-window__oh-header {
66
+ line-height: 32px;
67
+ font-weight: 400;
68
+ }
69
+ .call-us-window__day-of-week-wrapper {
70
+ font-weight: 400;
71
+ line-height: 22px;
72
+ color: #202020;
73
+ }
74
+
75
+ .call-us-window__day-of-week {
76
+ width: 100px;
77
+ text-transform: Capitalize;
78
+ }
79
+
80
+ .call-us-window__day-of-week-wrapper {
81
+ display: flex;
82
+ align-items: center;
83
+ margin-bottom: 5px;
84
+ }
85
+
86
+ .call-us-window__open-times {
87
+ width: 123px;
88
+ text-transform: lowercase;
89
+ text-align: right;
90
+ }
91
+
92
+ .text-us-wrapper {
93
+ color: #202020;
94
+ }
95
+ .text-us-window__header {
96
+ font-family: "Helvetica Neue", Arial;
97
+ font-style: normal;
98
+ font-weight: 700;
99
+ line-height: 140%;
100
+ font-size: 14px;
101
+ margin: 0;
102
+ }
103
+
104
+ .text-us-window__input-container {
105
+ margin-top: 8px;
106
+ margin-bottom: 8px;
107
+ width: -webkit-fill-available;
108
+ position: relative;
109
+ }
110
+ .text-us-window__submit-text {
111
+ position: absolute;
112
+ top: 14px;
113
+ right: 6px;
114
+ }
115
+ .text-us-window__vertical-spacer {
116
+ height: 20px;
117
+ }
118
+ .text-us-window__description,
119
+ .text-us-window__error {
120
+ font-family: "Helvetica Neue", Arial;
121
+ font-style: normal;
122
+ font-weight: 400;
123
+ font-size: 10px;
124
+ line-height: 14px;
125
+ }
126
+
127
+ .text-us-window__error {
128
+ color: rgb(255, 49, 3);
129
+ }
130
+ `,
131
+ ];
132
+
133
+ @property({ attribute: true })
134
+ buildingSlug = "";
135
+ @property({ attribute: true })
136
+ orgSlug = "";
137
+
138
+ @property({ attribute: false })
139
+ onCloseClicked?: (e: MouseEvent) => void;
140
+
141
+ @property()
142
+ phoneNumberToCall = "";
143
+
144
+ @property()
145
+ phoneNumberToText = "";
146
+
147
+ @property({ attribute: false })
148
+ buildingId = 0;
149
+ @property({ attribute: false })
150
+ buildingName = "";
151
+ @property({ attribute: true })
152
+ chatCallUsHeader = "";
153
+
154
+ @property({ attribute: true })
155
+ hasCallUsEnabled = "";
156
+
157
+ @property({ attribute: true })
158
+ hasTextUsEnabled = "";
159
+
160
+ @property({ attribute: true })
161
+ currentLeadSource = "";
162
+
163
+ @property({ attribute: true })
164
+ orgLegalName = "";
165
+
166
+ @property({ attribute: true })
167
+ private leadSourceClient: LeadSourceClient | null = null;
168
+
169
+ phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
170
+
171
+ @state()
172
+ hasSubmittedForm = false;
173
+ @state()
174
+ hasPhoneNumberError = false;
175
+ @state()
176
+ hasSubmissionError = false;
177
+
178
+ @state()
179
+ submittingTextUsOption = false;
180
+
181
+ @property({ attribute: false })
182
+ officeHoursTextInfo: (
183
+ | string
184
+ | { dayOfWeek: string; startTime: string; endTime: string }
185
+ )[] = [];
186
+
187
+ firstUpdated = async (): Promise<void> => {
188
+ if (!this.buildingId || !this.hasCallUsEnabled) return;
189
+ this.officeHoursTextInfo = await getOfficeHourText(this.buildingId);
190
+ };
191
+
192
+ getCallLink = (phoneNumber: string): TemplateResult => {
193
+ const rawNumber = (phoneNumber.match(/\d+/g) || []).join("");
194
+ const rawInternationalNumber =
195
+ rawNumber.length < 11 ? `1${rawNumber}` : rawNumber;
196
+ const formattedInternationalNumber = `+${
197
+ rawInternationalNumber[0]
198
+ }-${rawInternationalNumber.slice(1, 4)}-${rawInternationalNumber.slice(
199
+ 4,
200
+ 7
201
+ )}-${rawInternationalNumber.slice(7)}`;
202
+ return html`<a href="tel:${formattedInternationalNumber}"
203
+ >${phoneNumber}</a
204
+ >`;
205
+ };
206
+
207
+ enforcePhoneFormat = (e: KeyboardEvent): void => {
208
+ if (!isNumericInput(e) && !isModifierKey(e)) {
209
+ e.preventDefault();
210
+ }
211
+ };
212
+ onSubmitTextUs = async (): Promise<void> => {
213
+ this.hasPhoneNumberError = false;
214
+ this.hasSubmissionError = false;
215
+ if (!this.phoneNumberToText || this.phoneNumberToText.length !== 14) {
216
+ this.hasPhoneNumberError = true;
217
+ }
218
+ if (this.hasPhoneNumberError) {
219
+ return;
220
+ }
221
+ try {
222
+ this.submittingTextUsOption = true;
223
+ await createTextWithUs(
224
+ this.phoneNumberToText,
225
+ this.buildingId,
226
+ this.orgSlug,
227
+ this.buildingSlug,
228
+ [
229
+ ...new Set(
230
+ this.currentLeadSource
231
+ ? [
232
+ this.currentLeadSource,
233
+ getDefaultLeadSourceAttribution(this.orgSlug),
234
+ ]
235
+ : [getDefaultLeadSourceAttribution(this.orgSlug)]
236
+ ),
237
+ ],
238
+ this.leadSourceClient?.chatId
239
+ );
240
+ this.leadSourceClient?.checkAndHandleForLogLeadSource({
241
+ webchatAction: "text-us",
242
+ stateId: null,
243
+ });
244
+ this.hasSubmittedForm = true;
245
+ this.submittingTextUsOption = false;
246
+ } catch (e) {
247
+ this.submittingTextUsOption = false;
248
+ this.hasSubmissionError = true;
249
+ }
250
+ };
251
+
252
+ onChangePhoneNumber = (e: Event): void => {
253
+ if (!e.target || !this.phoneNumberInputRef.value) {
254
+ return;
255
+ }
256
+ if (isModifierKey(e as KeyboardEvent)) {
257
+ return;
258
+ }
259
+ const inputElement = e.target as HTMLInputElement;
260
+
261
+ this.phoneNumberToText = formatToPhoneInput(inputElement.value);
262
+
263
+ this.phoneNumberInputRef.value.value = this.phoneNumberToText;
264
+ };
265
+
266
+ private renderFormTextUsOption = (): TemplateResult => {
267
+ return html` <div class="text-us-wrapper">
268
+ <h1 class="text-us-window__header">Send Us a Text</h1>
269
+ <div class="text-us-window__input-container">
270
+ <input
271
+ ${ref(this.phoneNumberInputRef)}
272
+ maxlength="14"
273
+ type="text"
274
+ placeholder="Enter phone"
275
+ inputmode="tel"
276
+ class=${classMap({
277
+ ["webchat-input"]: true,
278
+ ["text-us-window__input-container"]: true,
279
+ ["webchat-font__desktop"]: !isMobile(),
280
+ ["webchat-font__mobile"]: isMobile(),
281
+ })}
282
+ .value=${this.phoneNumberToText}
283
+ @keydown=${this.enforcePhoneFormat}
284
+ @keyup=${this.onChangePhoneNumber}
285
+ />
286
+ <div class="text-us-window__submit-text">
287
+ <action-confirm-button
288
+ .onClick=${this.onSubmitTextUs}
289
+ .isLoading=${this.submittingTextUsOption}
290
+ text="SEND"
291
+ ></action-confirm-button>
292
+ </div>
293
+ ${this.hasPhoneNumberError
294
+ ? html`
295
+ <div class="text-us-window__error">
296
+ Enter a valid phone number
297
+ </div>
298
+ `
299
+ : ""}
300
+ </div>
301
+
302
+ <div class="text-us-window__description">
303
+ ${this.orgSlug === "greystar"
304
+ ? html`By providing your phone number and clicking send, you consent
305
+ to receive recurring marketing calls and voice and text messages
306
+ from Greystar or on its behalf at this number using artificial
307
+ voice and/or an autodialer. Messages may be AI or human-generated.
308
+ Your phone number and communications are shared with and recorded
309
+ and used by EliseAI. You are not required to provide your phone
310
+ number or consent to these terms to lease at this property. Msg &
311
+ Data rates may apply. You consent to
312
+ <a
313
+ href="https://www.greystar.com/privacy"
314
+ target="_blank"
315
+ rel="noopener noreferrer"
316
+ >Greystar's Global Privacy Policy</a
317
+ >
318
+ and
319
+ <a
320
+ href="http://bit.ly/me_privacy_policy"
321
+ target="_blank"
322
+ rel="noopener noreferrer"
323
+ >EliseAI's Privacy Policy</a
324
+ >.`
325
+ : html`By providing your number and clicking send, you consent to
326
+ receive recurring marketing calls and voice and text messages from
327
+ or on behalf of ${this.orgLegalName} at this number using
328
+ artificial voice or an autodialer system. Messages may be AI or
329
+ human generated. This consent is not required to lease at this
330
+ property. Msg & Data rates may apply. You consent to this
331
+ <a target="_blank" href="http://bit.ly/me_privacy_policy"
332
+ >privacy policy</a
333
+ >, including having your number and communications recorded and
334
+ used by a third party.`}
335
+ </div>
336
+ </div>`;
337
+ };
338
+
339
+ private renderSubmittedTextUsOption = (): TemplateResult => {
340
+ return html`
341
+ <div id="text-us-container-focus" class="text-us-wrapper">
342
+ <div class="text-us-window__vertical-spacer"></div>
343
+ <svg
344
+ width="20"
345
+ height="20"
346
+ viewBox="0 0 20 20"
347
+ fill="none"
348
+ xmlns="http://www.w3.org/2000/svg"
349
+ >
350
+ <path
351
+ d="M4.455 16L0 19.5V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H19C19.2652 0 19.5196 0.105357 19.7071 0.292893C19.8946 0.48043 20 0.734784 20 1V15C20 15.2652 19.8946 15.5196 19.7071 15.7071C19.5196 15.8946 19.2652 16 19 16H4.455ZM2 15.385L3.763 14H18V2H2V15.385ZM10 7V4L14 8L10 12V9H6V7H10Z"
352
+ fill="#202020"
353
+ />
354
+ </svg>
355
+ <div class="text-us-window__description">
356
+ Thank you!<br />Look for a text message from our team. We can answer
357
+ questions and help you book a tour through text.
358
+ </div>
359
+ <div class="text-us-window__description">
360
+ Opt out at anytime by texting “Stop”
361
+ </div>
362
+ </div>
363
+ `;
364
+ };
365
+
366
+ render = (): TemplateResult => {
367
+ return html`
368
+ <details-window
369
+ id="details-window"
370
+ height=${this.hasTextUsEnabled ? "600px" : "443px"}
371
+ .onCloseClick=${this.onCloseClicked}
372
+ >
373
+ ${this.hasCallUsEnabled
374
+ ? html` <div id="call-us-window__content-wrapper">
375
+ <h1 class="call-us-window__call-us-text call-us-window__header">
376
+ Contact Our Leasing Team
377
+ </h1>
378
+ <div class="call-us-window__phone-redirect">
379
+ ${PhoneOutlineIcon("black")}
380
+ ${this.getCallLink(this.phoneNumberToCall)}
381
+ </div>
382
+ <div class="call-us-window__office-hours-wrapper">
383
+ <h1 class="call-us-window__oh-header call-us-window__header">
384
+ Office Hours
385
+ </h1>
386
+ ${this.officeHoursTextInfo.map((oh) => {
387
+ if (typeof oh === "string") {
388
+ return html`
389
+ <div class="call-us-window__day-of-week-wrapper">
390
+ <div class="call-us-window__day-of-week">${oh}</div>
391
+ <div class="call-us-window__closed">Closed</div>
392
+ </div>
393
+ `;
394
+ }
395
+ return html`
396
+ <div class="call-us-window__day-of-week-wrapper">
397
+ <div class="call-us-window__day-of-week">
398
+ ${oh.dayOfWeek}
399
+ </div>
400
+ <div class="call-us-window__open-times">
401
+ ${oh.startTime}&nbsp;&ndash;&nbsp;${oh.endTime}
402
+ </div>
403
+ </div>
404
+ `;
405
+ })}
406
+ </div>
407
+ </div>`
408
+ : ""}
409
+ ${this.hasTextUsEnabled
410
+ ? this.hasSubmittedForm
411
+ ? this.renderSubmittedTextUsOption()
412
+ : this.renderFormTextUsOption()
413
+ : ""}
414
+ </details-window>
415
+ `;
416
+ };
417
+ }
418
+
419
+ export const installCallUsWindow = (): void => {
420
+ if (!window.customElements.get("call-us-window")) {
421
+ window.customElements.define("call-us-window", CallUsWindow);
422
+ }
423
+ };
424
+
425
+ const createTextWithUs = async (
426
+ rawPhoneNumber: string,
427
+ buildingId: number,
428
+ orgSlug: string,
429
+ buildingSlug: string,
430
+ leadSources: string[],
431
+ chatId?: string | null
432
+ ) => {
433
+ const formattedPhoneNumber =
434
+ "+1" +
435
+ rawPhoneNumber
436
+ .replace("(", "")
437
+ .replace(")", "")
438
+ .replace(" ", "")
439
+ .replace("-", "");
440
+ const queryParams = new URLSearchParams(window.location.search);
441
+ const requestBody = {
442
+ building_id: buildingId,
443
+ lead_sources: leadSources,
444
+ phone_number: formattedPhoneNumber,
445
+ referrer: document.referrer,
446
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
447
+ // @ts-ignore
448
+ query_params: Object.fromEntries(queryParams.entries()),
449
+ conversation_tracking_id: chatId,
450
+ };
451
+ pushGtmEvent("textUsSubmitted", {
452
+ phone: formattedPhoneNumber,
453
+ originatingSource:
454
+ leadSources.find((i) => i !== "property-website") || null,
455
+ });
456
+ await axios.post(
457
+ "https://app.meetelise.com/platformApi/state/create/textMe",
458
+ requestBody,
459
+ {
460
+ headers: {
461
+ ["building-slug"]: buildingSlug,
462
+ ["org-slug"]: orgSlug,
463
+ ["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
464
+ },
465
+ }
466
+ );
467
+ };
@@ -0,0 +1,65 @@
1
+ import { css, html, LitElement, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { styleMap } from "lit/directives/style-map.js";
4
+ import { defaultPrimaryColor } from "../../themes";
5
+ import { ChevronLeftIcon } from "../icons/ChevronLeftIcon";
6
+ import { ChevronRightIcon } from "../icons/ChevronRightIcon";
7
+
8
+ @customElement("collapse-expand-button")
9
+ export class CollapseExpandButton extends LitElement {
10
+ static styles = [
11
+ css`
12
+ .button-container {
13
+ width: 36px;
14
+ height: 36px;
15
+ background: #ffffff;
16
+ border: 1px solid rgba(95, 95, 95, 0.2);
17
+ border-radius: 1000px;
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ cursor: pointer;
22
+ }
23
+ .inner-container {
24
+ width: 30px;
25
+ height: 30px;
26
+ border-radius: 1000px;
27
+ border: 1px solid rgba(255, 255, 255, 0.7);
28
+ display: flex;
29
+ justify-content: center;
30
+ align-items: center;
31
+ }
32
+ .button-container:hover {
33
+ filter: brightness(90%);
34
+ }
35
+ `,
36
+ ];
37
+
38
+ @property({ attribute: true })
39
+ onClick: () => void = () => {
40
+ return;
41
+ };
42
+
43
+ @property({ attribute: true })
44
+ primaryColor: string = defaultPrimaryColor;
45
+
46
+ @property({ attribute: true })
47
+ toExpand = false;
48
+
49
+ render(): TemplateResult {
50
+ return html`
51
+ <div class=${"button-container"} @click=${this.onClick}>
52
+ <div
53
+ class="inner-container"
54
+ style=${styleMap({
55
+ background: this.primaryColor,
56
+ })}
57
+ >
58
+ ${this.toExpand
59
+ ? ChevronRightIcon("black")
60
+ : ChevronLeftIcon("black")}
61
+ </div>
62
+ </div>
63
+ `;
64
+ }
65
+ }
@@ -0,0 +1,150 @@
1
+ import { css, html, LitElement, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { styleMap } from "lit/directives/style-map.js";
4
+ import { isMobile } from "../../utils";
5
+
6
+ @customElement("details-window")
7
+ export class DetailsWindow extends LitElement {
8
+ static styles = css`
9
+ .details-window-wrapper {
10
+ background: rgba(255, 255, 255, 0.9);
11
+ box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
12
+ backdrop-filter: blur(5px);
13
+ /* Note: backdrop-filter has minimal browser support */
14
+
15
+ border-radius: 10px 0px 0px 10px;
16
+ padding: 49px 18px 24px;
17
+ }
18
+
19
+ .close-window-button {
20
+ position: absolute;
21
+ top: 22px;
22
+ right: 20px;
23
+ cursor: pointer;
24
+ width: 20px;
25
+ height: 20px;
26
+ }
27
+ .close-window-button:hover {
28
+ filter: brightness(90%);
29
+ }
30
+
31
+ .gradient-window-wrapper {
32
+ background: rgba(0, 0, 0 0.75);
33
+ border-width: 3px 0px 3px 3px;
34
+ border-style: solid;
35
+ border-color: #ffffff;
36
+ box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
37
+ border-radius: 10px 0px 0px 10px;
38
+ padding: 16px;
39
+ display: block;
40
+ background: linear-gradient(
41
+ 154.34deg,
42
+ rgba(255, 255, 255, 1) 0.55%,
43
+ rgba(0, 0, 0, 1) 160.1%
44
+ );
45
+ }
46
+ .details-window-header {
47
+ display: flex;
48
+ justify-content: space-between;
49
+ }
50
+ .header-text {
51
+ font-weight: 700;
52
+ font-size: 14px;
53
+ line-height: 22px;
54
+
55
+ font-family: "Helvetica", Arial;
56
+ font-style: normal;
57
+ font-weight: 700;
58
+ font-size: 14px;
59
+ line-height: 140%;
60
+
61
+ color: #202020;
62
+ margin-bottom: 14px;
63
+ }
64
+
65
+ @media screen and (max-width: 767px) {
66
+ .details-window-wrapper {
67
+ border-radius: 0px 0px 0px 0px;
68
+ }
69
+ }
70
+ `;
71
+ @property({ type: String })
72
+ height = "425px";
73
+
74
+ @property({ type: String })
75
+ width = "326px";
76
+
77
+ @property({ type: Boolean })
78
+ useRoundedBorders = true;
79
+
80
+ @property({ type: String })
81
+ headerText = "";
82
+
83
+ @property({ attribute: false })
84
+ onCloseClick?: (e: MouseEvent) => void;
85
+
86
+ @state()
87
+ isMobileSized = false;
88
+
89
+ @property({ attribute: true })
90
+ useGradientDesign = false;
91
+
92
+ async firstUpdated(): Promise<void> {
93
+ // Give the browser a chance to paint
94
+ await new Promise((resolve) => setTimeout(resolve, 0));
95
+ this.isMobileSized = isMobile();
96
+ window.addEventListener("resize", () => {
97
+ this.isMobileSized = isMobile();
98
+ });
99
+ }
100
+
101
+ render(): TemplateResult {
102
+ return html`
103
+ <div
104
+ id="details-window-inner"
105
+ class="details-window-wrapper"
106
+ style=${styleMap({
107
+ width: this.isMobileSized ? "-webkit-fill-available" : this.width,
108
+ })}
109
+ >
110
+ <div class="details-window-header">
111
+ ${this.headerText
112
+ ? html` <div class="header-text">${this.headerText}</div>`
113
+ : ""}
114
+ ${this.onCloseClick
115
+ ? html`<div @click=${this.onCloseClick} class="close-window-button">
116
+ <svg
117
+ width="19"
118
+ height="19"
119
+ viewBox="0 0 19 19"
120
+ fill="none"
121
+ xmlns="http://www.w3.org/2000/svg"
122
+ >
123
+ <line
124
+ x1="0.986863"
125
+ y1="18.2746"
126
+ x2="18.2929"
127
+ y2="0.968589"
128
+ stroke="#202020"
129
+ stroke-width="2"
130
+ />
131
+ <path
132
+ d="M1.01394 0.999974L18.0103 18.0242"
133
+ stroke="#202020"
134
+ stroke-width="2"
135
+ />
136
+ </svg>
137
+ </div>`
138
+ : ""}
139
+ </div>
140
+ <slot class="details-window__slot-content"></slot>
141
+ </div>
142
+ `;
143
+ }
144
+ }
145
+
146
+ export const installDetailsWindow = (): void => {
147
+ if (!window.customElements.get("details-window")) {
148
+ window.customElements.define("details-window", DetailsWindow);
149
+ }
150
+ };