@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,44 @@
1
+ import { css } from "lit";
2
+
3
+ const feeItemStyles = css`
4
+ :host {
5
+ display: block;
6
+ width: 100%;
7
+ }
8
+
9
+ .fee-item {
10
+ display: flex;
11
+ justify-content: space-between;
12
+ margin: 8px 20px;
13
+ }
14
+
15
+ .fee-info {
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: flex-start;
19
+ flex: 1;
20
+ }
21
+
22
+ .required-label {
23
+ color: #868e96;
24
+ font-size: 0.8rem;
25
+ margin-bottom: 8px;
26
+ }
27
+
28
+ .fee-name {
29
+ font-size: 1rem;
30
+ }
31
+
32
+ .fee-description {
33
+ color: #868e96;
34
+ font-size: 0.8rem;
35
+ margin-top: 4px;
36
+ }
37
+
38
+ .fee-amount {
39
+ font-size: 1rem;
40
+ align-self: center;
41
+ }
42
+ `;
43
+
44
+ export default feeItemStyles;
@@ -0,0 +1,38 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { FeeEstimate } from "../../../../services/fees/calculateQuote";
4
+
5
+ import "../addon-item/addon-item";
6
+
7
+ import feeItemStyles from "./fee-item-styles";
8
+
9
+ @customElement("fee-item")
10
+ export class FeeItemComponent extends LitElement {
11
+ static styles = feeItemStyles;
12
+
13
+ @property({ type: Object })
14
+ feeItem: FeeEstimate | null = null;
15
+
16
+ render(): TemplateResult {
17
+ if (!this.feeItem) return html``;
18
+
19
+ return html`
20
+ <div class="fee-item">
21
+ <div class="fee-info">
22
+ ${this.feeItem.required
23
+ ? html`<div class="required-label">Required</div>`
24
+ : ""}
25
+ <div class="fee-name">${this.feeItem.displayName}</div>
26
+ <div class="fee-description">${this.feeItem.description}</div>
27
+ </div>
28
+ <div class="fee-amount">${this.feeItem.displayAmount}</div>
29
+ </div>
30
+ `;
31
+ }
32
+ }
33
+
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ "fee-item": FeeItemComponent;
37
+ }
38
+ }
@@ -0,0 +1,144 @@
1
+ import { css } from "lit";
2
+
3
+ const floorPlanSelectorStyles = css`
4
+ :host {
5
+ display: block;
6
+ margin-bottom: 16px;
7
+ }
8
+
9
+ .floor-plan-selector {
10
+ flex-wrap: wrap;
11
+ gap: 8px;
12
+ }
13
+
14
+ .floor-plan-selector-label {
15
+ font-size: 1rem;
16
+ font-weight: normal;
17
+ margin-bottom: 8px;
18
+ }
19
+
20
+ .floor-plan-selector-badges {
21
+ display: flex;
22
+ flex-wrap: wrap;
23
+ gap: 8px;
24
+ margin-bottom: 12px;
25
+ }
26
+
27
+ .floor-plan-badge {
28
+ padding: 6px 12px;
29
+ border-radius: 16px;
30
+ font-size: 0.9rem;
31
+ cursor: pointer;
32
+ background-color: #f0f0f0;
33
+ border: 1px solid #ddd;
34
+ transition: all 0.15s ease;
35
+ }
36
+
37
+ .floor-plan-badge:hover {
38
+ background-color: #e6e6e6;
39
+ }
40
+
41
+ .floor-plan-badge.selected {
42
+ background-color: var(--primary-color, #646987);
43
+ border-color: var(--primary-color, #646987);
44
+ color: white;
45
+ }
46
+
47
+ .advanced-section {
48
+ max-height: 0;
49
+ overflow: hidden;
50
+ transition: max-height 0.15s ease-out;
51
+ }
52
+
53
+ .advanced-section.open {
54
+ max-height: 800px;
55
+ transition: max-height 0.2s ease-in;
56
+ }
57
+
58
+ .date-fields {
59
+ display: flex;
60
+ flex-direction: row;
61
+ gap: 16px;
62
+ margin-bottom: 16px;
63
+ transition: gap 0.15s ease;
64
+ }
65
+
66
+ .date-field {
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 4px;
70
+ flex: 1;
71
+ }
72
+
73
+ .date-field label {
74
+ font-size: 0.9rem;
75
+ }
76
+
77
+ .date-field input {
78
+ padding: 8px;
79
+ border-radius: 4px;
80
+ border: 1px solid #ddd;
81
+ }
82
+
83
+ .date-field-label {
84
+ font-size: #3a3a3b;
85
+ }
86
+
87
+ .image-carousel {
88
+ display: flex;
89
+ flex-direction: column;
90
+ max-height: 50%;
91
+ gap: 16px;
92
+ padding: 12px 0;
93
+ scroll-behavior: smooth;
94
+ transition: flex-direction 0.15s ease, max-height 0.15s ease,
95
+ width 0.15s ease, overflow-x 0.15s ease;
96
+ }
97
+
98
+ .unit-selection {
99
+ margin-top: 16px;
100
+ max-height: 16rem;
101
+ overflow-y: auto;
102
+ transition: max-height 0.15s ease, overflow-y 0.15s ease,
103
+ overflow-x 0.15s ease;
104
+ }
105
+
106
+ .unit-label {
107
+ font-size: 1rem;
108
+ }
109
+
110
+ .loading-container,
111
+ .no-floorplans-container {
112
+ display: flex;
113
+ justify-content: center;
114
+ align-items: center;
115
+ }
116
+
117
+ @media (max-width: 768px) {
118
+ .date-fields {
119
+ gap: 10px;
120
+ }
121
+
122
+ .image-carousel {
123
+ flex-direction: row;
124
+ max-height: none;
125
+ overflow-x: auto;
126
+ width: 100%;
127
+ padding: 12px 0;
128
+ -webkit-overflow-scrolling: touch;
129
+ scrollbar-width: none; /* Firefox */
130
+ }
131
+
132
+ .image-carousel::-webkit-scrollbar {
133
+ display: none; /* Chrome, Safari, Opera */
134
+ }
135
+
136
+ .unit-selection {
137
+ max-height: none;
138
+ overflow-y: visible;
139
+ overflow-x: auto;
140
+ }
141
+ }
142
+ `;
143
+
144
+ export default floorPlanSelectorStyles;
@@ -0,0 +1,241 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { LayoutOption } from "../../../../fetchBuildingWebchatView";
4
+ import { ALL_LAYOUTS_OPTION } from "../../constants";
5
+
6
+ import fetchBuildingFloorplans, {
7
+ Floorplan,
8
+ } from "../../../../services/fees/fetchBuildingFloorplans";
9
+ import { layoutToBedrooms } from "../../../../services/fees/utils";
10
+ import floorPlanSelectorStyles from "./floor-plan-selector-styles";
11
+ import { addMonths, startOfMonth } from "date-fns";
12
+
13
+ import "../floorplan-image-card/floorplan-image-card";
14
+ import "../../../mega-loader";
15
+
16
+ const FIRST_OF_NEXT_MONTH = startOfMonth(addMonths(new Date(), 1));
17
+
18
+ @customElement("floor-plan-selector")
19
+ export class FloorPlanSelector extends LitElement {
20
+ static styles = floorPlanSelectorStyles;
21
+
22
+ @property({ type: String })
23
+ buildingSlug = "";
24
+
25
+ @property({ type: Array })
26
+ layoutOptions: LayoutOption[] = [];
27
+
28
+ @property({ type: Array })
29
+ selectedLayoutIds: number[] = [ALL_LAYOUTS_OPTION];
30
+
31
+ @property()
32
+ onSelectLayout: ((layoutIds: number[]) => void) | null = null;
33
+
34
+ @property()
35
+ onUnitSelect: ((unitId: number) => void) | null = null;
36
+
37
+ @property()
38
+ onMoveInDateChange: ((moveInDate: Date) => void) | null = null;
39
+
40
+ @property()
41
+ onLeaseTermChange: ((leaseTerm: number) => void) | null = null;
42
+
43
+ @state()
44
+ moveInDate: Date | null = null;
45
+
46
+ @state()
47
+ leaseTerm = "12";
48
+
49
+ @state()
50
+ floorPlans: Floorplan[] = [];
51
+
52
+ @state()
53
+ selectedUnitId: number | null = null;
54
+
55
+ @state()
56
+ isLoading = false;
57
+
58
+ private get displayOptions(): LayoutOption[] {
59
+ const allOption: LayoutOption = {
60
+ value: ALL_LAYOUTS_OPTION,
61
+ label: "All",
62
+ };
63
+
64
+ const convertNumberWordsToNumeric = (text: string): string => {
65
+ const numberMap: Record<string, string> = {
66
+ zero: "0",
67
+ one: "1",
68
+ two: "2",
69
+ three: "3",
70
+ four: "4",
71
+ five: "5",
72
+ six: "6",
73
+ seven: "7",
74
+ eight: "8",
75
+ nine: "9",
76
+ ten: "10",
77
+ eleven: "11",
78
+ twelve: "12",
79
+ };
80
+
81
+ let result = text;
82
+ Object.entries(numberMap).forEach(([word, number]) => {
83
+ const regex = new RegExp(`\\b${word}\\b`, "gi");
84
+ result = result.replace(regex, number);
85
+ });
86
+
87
+ return result;
88
+ };
89
+
90
+ return [allOption, ...this.layoutOptions]
91
+ .map((opt: LayoutOption) => ({
92
+ ...opt,
93
+ label: convertNumberWordsToNumeric(
94
+ opt.label.replace(/bedroom/gi, "bd")
95
+ ),
96
+ }))
97
+ .sort((a, b) => a.value - b.value);
98
+ }
99
+
100
+ private fetchFloorplans = async (): Promise<Floorplan[]> => {
101
+ this.isLoading = true;
102
+
103
+ const numBedrooms =
104
+ this.selectedLayoutIds.length === 1
105
+ ? layoutToBedrooms(this.selectedLayoutIds[0])
106
+ : undefined;
107
+
108
+ try {
109
+ const floorplans = await fetchBuildingFloorplans({
110
+ buildingSlug: this.buildingSlug,
111
+ moveInDateEarliest: this.moveInDate ? this.moveInDate : undefined,
112
+ ...(this.selectedLayoutIds.includes(ALL_LAYOUTS_OPTION)
113
+ ? {}
114
+ : { numBedrooms }),
115
+ });
116
+ return floorplans.filter((floorplan) => !!floorplan.url);
117
+ } finally {
118
+ this.isLoading = false;
119
+ }
120
+ };
121
+
122
+ firstUpdated = async (): Promise<void> => {
123
+ this.floorPlans = await this.fetchFloorplans();
124
+
125
+ // Default move-in is 1st of next month
126
+ this.moveInDate = FIRST_OF_NEXT_MONTH;
127
+ this.onMoveInDateChange?.(FIRST_OF_NEXT_MONTH);
128
+ };
129
+
130
+ handleUnitSelect = (unitId: number): void => {
131
+ this.selectedUnitId = unitId;
132
+ this.onUnitSelect?.(unitId);
133
+ };
134
+
135
+ handleLayoutChange = async (ids: number[]): Promise<void> => {
136
+ this.selectedLayoutIds = ids;
137
+ this.onSelectLayout?.(this.selectedLayoutIds);
138
+ this.floorPlans = await this.fetchFloorplans();
139
+ };
140
+
141
+ handleMoveInDateChange = async (e: Event): Promise<void> => {
142
+ const inputValue = (e.target as HTMLInputElement).value;
143
+ let newMoveIn;
144
+
145
+ if (!inputValue) {
146
+ newMoveIn = FIRST_OF_NEXT_MONTH;
147
+ } else {
148
+ newMoveIn = new Date(inputValue);
149
+ }
150
+
151
+ this.moveInDate = newMoveIn;
152
+ this.onMoveInDateChange?.(newMoveIn);
153
+ this.floorPlans = await this.fetchFloorplans();
154
+ };
155
+
156
+ handleLeaseTermChange = (e: Event): void => {
157
+ this.leaseTerm = (e.target as HTMLInputElement).value;
158
+ this.onLeaseTermChange?.(parseInt(this.leaseTerm));
159
+ };
160
+
161
+ render(): TemplateResult {
162
+ return html`
163
+ <div class="floor-plan-selector">
164
+ <div class="floor-plan-selector-label">Select Floor Plan</div>
165
+ <div class="floor-plan-selector-badges">
166
+ ${this.displayOptions.map(
167
+ (opt) => html`
168
+ <div
169
+ class="floor-plan-badge ${this.selectedLayoutIds.includes(
170
+ opt.value
171
+ )
172
+ ? "selected"
173
+ : ""}"
174
+ @click=${() => this.handleLayoutChange([opt.value])}
175
+ >
176
+ ${opt.label}
177
+ </div>
178
+ `
179
+ )}
180
+ </div>
181
+
182
+ <div>
183
+ <div class="date-fields">
184
+ <div class="date-field">
185
+ <label class="date-field-label">Move in date</label>
186
+ <input
187
+ type="date"
188
+ placeholder="Select move in date"
189
+ .value=${this.moveInDate?.toISOString().split("T")[0] ?? ""}
190
+ @input=${this.handleMoveInDateChange}
191
+ />
192
+ </div>
193
+ <div class="date-field">
194
+ <label class="date-field-label">Lease Term</label>
195
+ <input
196
+ type="number"
197
+ placeholder="Lease term (months)"
198
+ .value=${this.leaseTerm}
199
+ @input=${this.handleLeaseTermChange}
200
+ />
201
+ </div>
202
+ </div>
203
+ <div class="unit-selection">
204
+ <div class="unit-label">Select Unit</div>
205
+ <div class="image-carousel">
206
+ ${this.isLoading
207
+ ? html`
208
+ <div class="loading-container">
209
+ <mega-loader size="32"></mega-loader>
210
+ </div>
211
+ `
212
+ : ""}
213
+ ${this.floorPlans?.length === 0
214
+ ? html`
215
+ <div class="no-floorplans-container">
216
+ <p>No floorplans found</p>
217
+ </div>
218
+ `
219
+ : ""}
220
+ ${this.floorPlans?.map(
221
+ (floorplan) => html`
222
+ <floorplan-image-card
223
+ .floorplan=${floorplan}
224
+ .onUnitSelect=${this.handleUnitSelect}
225
+ .selected=${this.selectedUnitId === floorplan.unitId}
226
+ ></floorplan-image-card>
227
+ `
228
+ )}
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ `;
234
+ }
235
+ }
236
+
237
+ declare global {
238
+ interface HTMLElementTagNameMap {
239
+ "floor-plan-selector": FloorPlanSelector;
240
+ }
241
+ }
@@ -0,0 +1,74 @@
1
+ import { css } from "lit";
2
+
3
+ const floorplanImageCardStyles = css`
4
+ :host {
5
+ display: block;
6
+ }
7
+
8
+ p {
9
+ margin: 0;
10
+ }
11
+
12
+ .floorplan-image-card {
13
+ display: flex;
14
+ flex-direction: row;
15
+ background-color: #f8f9fa;
16
+ width: 18rem;
17
+ padding: 12px;
18
+ gap: 8px;
19
+ border-radius: 4px;
20
+ border: 2px solid transparent;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ .section-left {
25
+ flex: 0 0 auto;
26
+ }
27
+
28
+ .floorplan-image-card.selected {
29
+ border-color: var(--primary-color, #646987);
30
+ box-shadow: 0 0 8px
31
+ color-mix(in srgb, var(--primary-color, #646987) 50%, transparent);
32
+ transition: box-shadow 0.1s ease-in-out, background-color 0.1s ease-in-out,
33
+ border-color 0.1s ease-in-out;
34
+ background-color: #f0f7ff;
35
+ }
36
+
37
+ .section-right {
38
+ flex: 1 1 auto;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 4px;
42
+ cursor: pointer;
43
+ }
44
+
45
+ .image-card-title {
46
+ font-size: 1rem;
47
+ }
48
+
49
+ .image-card-subtitle {
50
+ font-size: 0.8rem;
51
+ color: #868e96;
52
+ }
53
+
54
+ img {
55
+ border-radius: 8px;
56
+ flex: 0 0 auto;
57
+ height: 4rem;
58
+ width: 4rem;
59
+ object-fit: cover;
60
+ border: 1px solid #ddd;
61
+ cursor: pointer;
62
+ }
63
+
64
+ @media (max-width: 768px) {
65
+ .floorplan-image-card {
66
+ width: 100%;
67
+ min-width: 18rem;
68
+ flex-shrink: 0;
69
+ margin-right: 8px;
70
+ }
71
+ }
72
+ `;
73
+
74
+ export default floorplanImageCardStyles;
@@ -0,0 +1,72 @@
1
+ import { LitElement, TemplateResult } from "lit";
2
+ import { html } from "lit";
3
+ import { customElement, property } from "lit/decorators.js";
4
+ import { Floorplan } from "../../../../services/fees/fetchBuildingFloorplans";
5
+
6
+ import floorplanImageCardStyles from "./floorplan-image-card-styles";
7
+
8
+ @customElement("floorplan-image-card")
9
+ export class FloorplanImageCard extends LitElement {
10
+ static styles = floorplanImageCardStyles;
11
+
12
+ @property({ type: Object })
13
+ floorplan: Floorplan = {} as Floorplan;
14
+
15
+ @property()
16
+ onUnitSelect: ((unitId: number) => void) | null = null;
17
+
18
+ @property({ type: Boolean })
19
+ selected = false;
20
+
21
+ get bedAndBathText(): string {
22
+ return `${this.floorplan.bedrooms}bd | ${this.floorplan.bathrooms}ba`;
23
+ }
24
+
25
+ get priceRange(): string {
26
+ if (this.floorplan.startingPrice === this.floorplan.maxPrice) {
27
+ return `$${this.floorplan.startingPrice}`;
28
+ }
29
+
30
+ return `$${this.floorplan.startingPrice} - $${this.floorplan.maxPrice}`;
31
+ }
32
+
33
+ handleOnUnitSelect(): void {
34
+ if (this.selected) return;
35
+ this.selected = !this.selected;
36
+ this.onUnitSelect?.(this.floorplan.unitId);
37
+ }
38
+
39
+ handleOnImgClick(event: Event): void {
40
+ const img = event.target as HTMLImageElement;
41
+ window.open(img.src, "_blank");
42
+ }
43
+
44
+ render(): TemplateResult {
45
+ return html`
46
+ <div class="floorplan-image-card ${this.selected ? "selected" : ""}">
47
+ <div class="section-left">
48
+ <img
49
+ @click=${this.handleOnImgClick}
50
+ src="${this.floorplan.url ?? ""}"
51
+ alt="${this.floorplan.name}"
52
+ />
53
+ </div>
54
+ <div class="section-right" @click=${this.handleOnUnitSelect}>
55
+ <p class="image-card-title">
56
+ ${this.floorplan.name} | ${this.priceRange}
57
+ </p>
58
+ <p class="image-card-subtitle">
59
+ ${this.bedAndBathText} | ${this.floorplan.squareFeet} ft |
60
+ ${this.floorplan.earliestAvailable}
61
+ </p>
62
+ </div>
63
+ </div>
64
+ `;
65
+ }
66
+ }
67
+
68
+ declare global {
69
+ interface HTMLElementTagNameMap {
70
+ "floorplan-image-card": FloorplanImageCard;
71
+ }
72
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./promo-card/promo-card";
2
+ export * from "./floor-plan-selector/floor-plan-selector";
3
+ export * from "./fee-card/fee-card";
4
+ export * from "./addon-item/addon-item";
5
+ export * from "./fee-calculator-layout/fee-calculator-layout";
@@ -0,0 +1,39 @@
1
+ import { css } from "lit";
2
+
3
+ const promoCardStyles = css`
4
+ :host {
5
+ display: block;
6
+ margin-bottom: 20px;
7
+ }
8
+
9
+ .promo-card {
10
+ background-color: #e6f2ff;
11
+ border-radius: 8px;
12
+ padding: 16px;
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .icon-container {
18
+ display: flex;
19
+ justify-content: center;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .content-container {
24
+ flex: 1;
25
+ }
26
+
27
+ .promo-heading {
28
+ font-size: 1.2rem;
29
+ font-weight: normal;
30
+ margin: 0 0 4px 0;
31
+ }
32
+
33
+ .promo-subtitle {
34
+ color: #868e96;
35
+ font-size: 0.8rem;
36
+ }
37
+ `;
38
+
39
+ export default promoCardStyles;
@@ -0,0 +1,39 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import DollarOutlineIcon from "../../../icons/DollarOutlineIcon";
4
+
5
+ import promoCardStyles from "./promo-card-styles";
6
+
7
+ @customElement("promo-card")
8
+ export class PromoCard extends LitElement {
9
+ static styles = promoCardStyles;
10
+
11
+ @property({ type: String })
12
+ promoAmount = "0";
13
+
14
+ @property({ type: String })
15
+ promoDescription = "";
16
+
17
+ @property({ type: String })
18
+ promoValidity = "";
19
+
20
+ render(): TemplateResult {
21
+ return html`
22
+ <div class="promo-card">
23
+ <div class="icon-container">${DollarOutlineIcon()}</div>
24
+ <div class="content-container">
25
+ <h2 class="promo-heading">
26
+ ${this.promoAmount} ${this.promoDescription}
27
+ </h2>
28
+ <div class="promo-subtitle">${this.promoValidity}</div>
29
+ </div>
30
+ </div>
31
+ `;
32
+ }
33
+ }
34
+
35
+ declare global {
36
+ interface HTMLElementTagNameMap {
37
+ "promo-card": PromoCard;
38
+ }
39
+ }
@@ -0,0 +1,3 @@
1
+ export const ALL_LAYOUTS_OPTION = -1;
2
+
3
+ export const CALCULATE_DEBOUNCE_MS = 1000;