@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.
- package/dist/src/MyPubnub.d.ts +116 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +28 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +22 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +46 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +34 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/constants.d.ts +3 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +55 -0
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +41 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +82 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +6 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +10 -0
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
- package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +31 -0
- package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
- package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
- package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +16 -0
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +102 -0
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
- package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
- package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
- package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
- package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
- package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
- package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
- package/dist/src/WebComponent/health-chat.d.ts +47 -0
- package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
- package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +7 -0
- package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
- package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/index.d.ts +2 -0
- package/dist/src/WebComponent/launcher/Launcher.d.ts +99 -0
- package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
- package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
- package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/loaders/index.d.ts +4 -0
- package/dist/src/WebComponent/loaders/mega-loader.d.ts +7 -0
- package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
- package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
- package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
- package/dist/src/WebComponent/me-chat.d.ts +91 -0
- package/dist/src/WebComponent/me-select.d.ts +24 -0
- package/dist/src/WebComponent/mini-loader.d.ts +5 -0
- package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-chat.d.ts +48 -0
- package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
- package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
- package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
- package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
- package/dist/src/WebComponent/utils.d.ts +31 -0
- package/dist/src/analytics.d.ts +64 -0
- package/dist/src/disclaimers.d.ts +16 -0
- package/dist/src/fetchBuildingABTestType.d.ts +8 -0
- package/dist/src/fetchBuildingInfo.d.ts +58 -0
- package/dist/src/fetchBuildingWebchatView.d.ts +124 -0
- package/dist/src/fetchFeatureFlag.d.ts +14 -0
- package/dist/src/fetchLeadSources.d.ts +4 -0
- package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
- package/dist/src/getAvailabilities.d.ts +46 -0
- package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
- package/dist/src/getShouldAllowScheduling.d.ts +1 -0
- package/dist/src/getShouldShowWebchat.d.ts +3 -0
- package/dist/src/getTimezoneString.d.ts +1 -0
- package/dist/src/globals.d.ts +2 -0
- package/dist/src/gtm.d.ts +6 -0
- package/dist/src/handleChatId.d.ts +11 -0
- package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
- package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
- package/dist/src/main/MEChat.d.ts +74 -0
- package/dist/src/main/utils.d.ts +2 -0
- package/dist/src/postLeadSources.d.ts +3 -0
- package/dist/src/rentgrata.d.ts +4 -0
- package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
- package/dist/src/services/fees/calculateQuote.d.ts +14 -0
- package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +10 -0
- package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
- package/dist/src/services/fees/utils.d.ts +1 -0
- package/dist/src/svgIcons.d.ts +5 -0
- package/dist/src/themes.d.ts +5 -0
- package/dist/src/types/incentive-v2.d.ts +23 -0
- package/dist/src/types/rest-sdk.types.d.ts +11 -0
- package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
- package/dist/src/utils/getWidgetOverrides.d.ts +39 -0
- package/dist/src/utils/queryParamBuilder.d.ts +8 -0
- package/dist/src/utils.d.ts +13 -0
- package/package.json +1 -1
- package/public/dist/index.js +250 -164
- package/src/MyPubnub.ts +792 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +206 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +6 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +101 -0
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +98 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +9 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +136 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +151 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +261 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +149 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +247 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +82 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +76 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
- package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
- package/src/WebComponent/FeeCalculator/constants.ts +5 -0
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +310 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +341 -0
- package/src/WebComponent/FeeCalculator/index.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +84 -0
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +126 -0
- package/src/WebComponent/FeeCalculator/model/desired-addon.ts +6 -0
- package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/index.ts +13 -0
- package/src/WebComponent/FeeCalculator/model/item-combination.ts +16 -0
- package/src/WebComponent/FeeCalculator/model/item-quantity.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +45 -0
- package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +9 -0
- package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +1 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +34 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item.ts +21 -0
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
- package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +54 -0
- package/src/WebComponent/LeadSourceClient.ts +332 -0
- package/src/WebComponent/MEChat.css +5 -0
- package/src/WebComponent/OfficeHours.ts +73 -0
- package/src/WebComponent/Scheduler/date-picker.ts +405 -0
- package/src/WebComponent/Scheduler/time-picker.ts +195 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +1430 -0
- package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
- package/src/WebComponent/actions/InputStyles.ts +57 -0
- package/src/WebComponent/actions/action-confirm-button.ts +125 -0
- package/src/WebComponent/actions/call-us-window.ts +467 -0
- package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
- package/src/WebComponent/actions/details-window.ts +150 -0
- package/src/WebComponent/actions/email-us-window.ts +556 -0
- package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
- package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
- package/src/WebComponent/chat-additional-actions.ts +135 -0
- package/src/WebComponent/health-chat.ts +270 -0
- package/src/WebComponent/healthchat-styles.ts +119 -0
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +80 -0
- package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
- package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
- package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
- package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
- package/src/WebComponent/icons/DollarOutlineIcon.ts +26 -0
- package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
- package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
- package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
- package/src/WebComponent/index.ts +2 -0
- package/src/WebComponent/launcher/Launcher.ts +1284 -0
- package/src/WebComponent/launcher/launcherStyles.ts +500 -0
- package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
- package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
- package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
- package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
- package/src/WebComponent/leasing-chat-styles.ts +114 -0
- package/src/WebComponent/loaders/index.ts +7 -0
- package/src/WebComponent/loaders/mega-loader.ts +36 -0
- package/src/WebComponent/loaders/skeleton-card.ts +31 -0
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
- package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
- package/src/WebComponent/me-chat.ts +1264 -0
- package/src/WebComponent/me-select.ts +322 -0
- package/src/WebComponent/mini-loader.ts +28 -0
- package/src/WebComponent/pubnub-chat-styles.ts +204 -0
- package/src/WebComponent/pubnub-chat.ts +771 -0
- package/src/WebComponent/pubnub-media.ts +208 -0
- package/src/WebComponent/pubnub-message-styles.ts +54 -0
- package/src/WebComponent/pubnub-message.ts +431 -0
- package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
- package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
- package/src/WebComponent/utilities-chat.ts +270 -0
- package/src/WebComponent/utilities-styles.ts +110 -0
- package/src/WebComponent/utils.ts +82 -0
- package/src/analytics.ts +217 -0
- package/src/assetUrls.ts +6 -0
- package/src/disclaimers.ts +301 -0
- package/src/fetchBuildingABTestType.ts +21 -0
- package/src/fetchBuildingInfo.ts +88 -0
- package/src/fetchBuildingWebchatView.ts +176 -0
- package/src/fetchFeatureFlag.ts +250 -0
- package/src/fetchLeadSources.ts +98 -0
- package/src/fetchPhoneNumberFromSource.ts +31 -0
- package/src/fetchWebchatPreferences.ts +54 -0
- package/src/getAvailabilities.ts +189 -0
- package/src/getBuildingPhoneNumber.ts +26 -0
- package/src/getShouldAllowScheduling.ts +16 -0
- package/src/getShouldShowWebchat.ts +114 -0
- package/src/getTimezoneString.ts +40 -0
- package/src/globals.ts +3 -0
- package/src/gtm.ts +17 -0
- package/src/handleChatId.ts +101 -0
- package/src/insertDNIIntoWebsite.ts +146 -0
- package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
- package/src/main/MEChat.test.ts +110 -0
- package/src/main/MEChat.ts +404 -0
- package/src/main/utils.ts +70 -0
- package/src/postLeadSources.ts +44 -0
- package/src/rentgrata.ts +74 -0
- package/src/replaceSelectButtonsWithNewLink.ts +91 -0
- package/src/services/fees/calculateQuote.ts +74 -0
- package/src/services/fees/fetchBuildingFees.ts +50 -0
- package/src/services/fees/fetchBuildingFeesV2.ts +59 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
- package/src/services/fees/fetchBuildingUnits.ts +86 -0
- package/src/services/fees/utils.ts +4 -0
- package/src/svgIcons.ts +14 -0
- package/src/themes.ts +65 -0
- package/src/types/incentive-v2.ts +24 -0
- package/src/types/rest-sdk.types.ts +13 -0
- package/src/types/webchat-no-show-reason.ts +6 -0
- package/src/utils/getWidgetOverrides.ts +91 -0
- package/src/utils/queryParamBuilder.ts +28 -0
- package/src/utils.ts +121 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
export enum DesignConcepts {
|
|
4
|
+
EMOJI = "emoji",
|
|
5
|
+
PILLS = "pills",
|
|
6
|
+
MINIMIZED = "minimized", // this is also mobile
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
enum TourType {
|
|
10
|
+
UNKNOWN = "UNKNOWN",
|
|
11
|
+
SELF_GUIDED = "SELF_GUIDED",
|
|
12
|
+
VIRTUAL_SHOWING = "VIRTUAL_SHOWING",
|
|
13
|
+
WITH_AGENT = "WITH_AGENT",
|
|
14
|
+
MEDIA_TOUR = "MEDIA_TOUR",
|
|
15
|
+
OPEN_HOUSE_STUDIO = "OPEN_HOUSE_STUDIO",
|
|
16
|
+
OPEN_HOUSE_1BR = "OPEN_HOUSE_1BR",
|
|
17
|
+
OPEN_HOUSE_2BR = "OPEN_HOUSE_2BR",
|
|
18
|
+
OPEN_HOUSE_3BR = "OPEN_HOUSE_3BR",
|
|
19
|
+
OPEN_HOUSE_4BR = "OPEN_HOUSE_4BR",
|
|
20
|
+
OPEN_HOUSE_5BR = "OPEN_HOUSE_5BR",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
enum TourAccessType {
|
|
24
|
+
LINK = "link",
|
|
25
|
+
CLIENT_SCHEDULED = "client_scheduled",
|
|
26
|
+
SCHEDULED_BY_ME_MANAGED_BY_ME = "scheduled_by_ME_managed_by_ME",
|
|
27
|
+
SCHEDULED_BY_ME_MANAGED_BY_CLIENT = "scheduled_by_ME_managed_by_client",
|
|
28
|
+
SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE = "scheduled_by_ME_managed_by_concierge",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const shouldOpenTourLink = (
|
|
32
|
+
tourType: string,
|
|
33
|
+
tourTypeOffered: string
|
|
34
|
+
): boolean => {
|
|
35
|
+
if (tourType === "self") {
|
|
36
|
+
const shouldntOpenTourTypesOffered = [
|
|
37
|
+
"SCHEDULED_BY_ME_MANAGED_BY_ME",
|
|
38
|
+
"SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE",
|
|
39
|
+
];
|
|
40
|
+
return !shouldntOpenTourTypesOffered.includes(tourTypeOffered);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (tourType === "virtual") {
|
|
44
|
+
const shouldntOpenTourTypesOffered = ["SCHEDULED_BY_ME_MANAGED_BY_CLIENT"];
|
|
45
|
+
return !shouldntOpenTourTypesOffered.includes(tourTypeOffered);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export interface LayoutOption {
|
|
52
|
+
value: number;
|
|
53
|
+
label: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface TourTypeOption {
|
|
57
|
+
value: TourType;
|
|
58
|
+
label: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface BuildingWebchatView {
|
|
62
|
+
id: number;
|
|
63
|
+
orgId: number;
|
|
64
|
+
name: string;
|
|
65
|
+
userId: number | null;
|
|
66
|
+
active: number | null;
|
|
67
|
+
userFirstName: string;
|
|
68
|
+
userLastName: string | null;
|
|
69
|
+
primaryColor: string | null;
|
|
70
|
+
backgroundColor: string | null;
|
|
71
|
+
logoSrc: string | null;
|
|
72
|
+
welcomeMessage: string | null;
|
|
73
|
+
systemWelcomeMessage: string | null;
|
|
74
|
+
chatTitle: string | null;
|
|
75
|
+
chatSubtitle: string | null;
|
|
76
|
+
bannerColor: string | null;
|
|
77
|
+
bannerTextColor: string | null;
|
|
78
|
+
messageColor: string | null;
|
|
79
|
+
messageTextColor: string | null;
|
|
80
|
+
launchButtonColor: string | null;
|
|
81
|
+
launchButtonIconColor: string | null;
|
|
82
|
+
launchButtonSize: string | null;
|
|
83
|
+
avatarType: "image" | "initials" | null;
|
|
84
|
+
avatarSrc: string | null;
|
|
85
|
+
avatarInitials: string | null;
|
|
86
|
+
themeId: string;
|
|
87
|
+
chatCallUsHeader?: string;
|
|
88
|
+
googleMapsUrl: string | null;
|
|
89
|
+
chatWidgets?: string[] | null;
|
|
90
|
+
streetAddress: string | null;
|
|
91
|
+
postalCode: string | null;
|
|
92
|
+
state: string | null;
|
|
93
|
+
phoneNumber: string;
|
|
94
|
+
textWithUsPhoneNumber: string | null;
|
|
95
|
+
layoutOptions: LayoutOption[];
|
|
96
|
+
tourTypeOptions: TourTypeOption[];
|
|
97
|
+
conversationMaintenanceMode: boolean;
|
|
98
|
+
sgtUrl: string;
|
|
99
|
+
escortedToursLink: string;
|
|
100
|
+
virtualToursLink: string;
|
|
101
|
+
isVirtualTourEnabled: boolean;
|
|
102
|
+
isEscortedTourEnabled: boolean;
|
|
103
|
+
isSelfGuidedTourEnabled: boolean;
|
|
104
|
+
escortedToursTypeOffered: TourAccessType;
|
|
105
|
+
virtualToursTypeOffered: TourAccessType;
|
|
106
|
+
selfGuidedToursTypeOffered: TourAccessType;
|
|
107
|
+
usesDynamicScheduling: boolean;
|
|
108
|
+
numAvailableUnits: number;
|
|
109
|
+
isSchedulingDisabled: boolean;
|
|
110
|
+
shouldBuildingScheduleTours: boolean;
|
|
111
|
+
orgLegalName: string;
|
|
112
|
+
launchedDateTime: Date | null;
|
|
113
|
+
webchatScopeConfigured: boolean;
|
|
114
|
+
displayStyle: DesignConcepts;
|
|
115
|
+
secondaryColor: string | null;
|
|
116
|
+
foregroundColorOnPrimaryBackgroundColor: string | null;
|
|
117
|
+
foregroundColorOnSecondaryBackgroundColor: string | null;
|
|
118
|
+
shouldShowChatDesktop: boolean | null;
|
|
119
|
+
shouldShowChatMobile: boolean | null;
|
|
120
|
+
shouldShowTextDesktop: boolean | null;
|
|
121
|
+
shouldShowTextMobile: boolean | null;
|
|
122
|
+
shouldShowPhoneDesktop: boolean | null;
|
|
123
|
+
shouldShowPhoneMobile: boolean | null;
|
|
124
|
+
shouldShowEmailDesktop: boolean | null;
|
|
125
|
+
shouldShowEmailMobile: boolean | null;
|
|
126
|
+
shouldShowSstDesktop: boolean | null;
|
|
127
|
+
shouldShowSstMobile: boolean | null;
|
|
128
|
+
shouldShowApplyNowDesktop: boolean | null;
|
|
129
|
+
shouldShowApplyNowMobile: boolean | null;
|
|
130
|
+
shouldShowPricingCalculatorDesktop: boolean | null;
|
|
131
|
+
shouldShowPricingCalculatorMobile: boolean | null;
|
|
132
|
+
applicationLink: string | null;
|
|
133
|
+
isLiveOnCollect: boolean | null;
|
|
134
|
+
isLiveOnApplications: boolean | null;
|
|
135
|
+
requiresConsentForChat: boolean | null;
|
|
136
|
+
privacyPolicyUrlForChat: string | null;
|
|
137
|
+
collapseMobileFeatures: boolean | null;
|
|
138
|
+
autoOpenChat: boolean | null;
|
|
139
|
+
isInheritingFromOrg: boolean | null;
|
|
140
|
+
isGlobalDefault: boolean | null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Load the publicly-available info for a building.
|
|
145
|
+
*
|
|
146
|
+
* @param orgSlug - The org slug, e.g. "big-prop-co"
|
|
147
|
+
* @param buildingSlug - The buidling slug, e.g. "gravity-falls"
|
|
148
|
+
* @returns The building's ID, name, theme, and agent.
|
|
149
|
+
*/
|
|
150
|
+
export default async function fetchBuildingWebchatView(
|
|
151
|
+
orgSlug: string,
|
|
152
|
+
buildingSlug: string
|
|
153
|
+
): Promise<BuildingWebchatView> {
|
|
154
|
+
const host = "https://app.meetelise.com";
|
|
155
|
+
const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}/v2`;
|
|
156
|
+
|
|
157
|
+
const buildingResponse = await axios.get(buildingUrl);
|
|
158
|
+
|
|
159
|
+
const buildingWebchatView: BuildingWebchatView = buildingResponse.data;
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
buildingWebchatView.welcomeMessage = replaceName(
|
|
163
|
+
buildingWebchatView.welcomeMessage ?? "",
|
|
164
|
+
buildingWebchatView.userFirstName
|
|
165
|
+
);
|
|
166
|
+
} catch (e) {
|
|
167
|
+
// eslint-disable-next-line no-console
|
|
168
|
+
console.error(e);
|
|
169
|
+
}
|
|
170
|
+
return buildingWebchatView;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const replaceName = (originalText: string, newName: string) => {
|
|
174
|
+
const regex = /elise/gi;
|
|
175
|
+
return originalText.replace(regex, newName);
|
|
176
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
// V1 reads from the launch darkly flag
|
|
4
|
+
// Note, in launch darkly we can define the building_id as the user filter and just need to pass
|
|
5
|
+
// the building_slug to the endpoint - we map in the backend
|
|
6
|
+
const featureFlagEndpointV1 = (buildingSlug: string): string => {
|
|
7
|
+
const host = "https://app.meetelise.com";
|
|
8
|
+
return `${host}/platformApi/webchat/${buildingSlug}/chat-ui-feature-flag`;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// V2 reads from conversation flag table (preferred)
|
|
12
|
+
const featureFlagEndpointV2 = (buildingSlug: string): string => {
|
|
13
|
+
const host = "https://app.meetelise.com";
|
|
14
|
+
return `${host}/platformApi/webchat/${buildingSlug}/v2/chat-ui-feature-flag`;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export enum FeatureFlagsShowDropdown {
|
|
18
|
+
onAttributionFailure = "on-attribution-failure",
|
|
19
|
+
never = "never", // note, the dropdown will NOT show up if there are also no lead sources (list)!
|
|
20
|
+
always = "always",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function fetchFeatureFlagMaintenanceMode(
|
|
24
|
+
buildingSlug: string
|
|
25
|
+
): Promise<boolean> {
|
|
26
|
+
if (!buildingSlug) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const featureFlagResponse = await axios.get(
|
|
31
|
+
featureFlagEndpointV1(buildingSlug),
|
|
32
|
+
{
|
|
33
|
+
params: {
|
|
34
|
+
building_slug: buildingSlug,
|
|
35
|
+
flag_type: "bool",
|
|
36
|
+
feature_flag: "webchat-leasing-in-maintenance-mode",
|
|
37
|
+
default_str: null,
|
|
38
|
+
default_bool: false,
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
return featureFlagResponse.data;
|
|
43
|
+
} catch (_) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function fetchFeatureFlagShowMarketingSourceDropdown(
|
|
49
|
+
buildingSlug: string
|
|
50
|
+
): Promise<FeatureFlagsShowDropdown> {
|
|
51
|
+
if (!buildingSlug) {
|
|
52
|
+
return FeatureFlagsShowDropdown.always;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const featureFlagResponse = await axios.get(
|
|
56
|
+
featureFlagEndpointV1(buildingSlug),
|
|
57
|
+
{
|
|
58
|
+
params: {
|
|
59
|
+
building_slug: buildingSlug,
|
|
60
|
+
flag_type: "string",
|
|
61
|
+
feature_flag: "webchat-marketing-source-dropdown-configuration",
|
|
62
|
+
default_str: "always",
|
|
63
|
+
default_bool: true,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
if (featureFlagResponse.data === "on-attribution-failure") {
|
|
68
|
+
return FeatureFlagsShowDropdown.onAttributionFailure;
|
|
69
|
+
}
|
|
70
|
+
if (featureFlagResponse.data === "never") {
|
|
71
|
+
return FeatureFlagsShowDropdown.never;
|
|
72
|
+
}
|
|
73
|
+
return FeatureFlagsShowDropdown.always;
|
|
74
|
+
} catch (_) {
|
|
75
|
+
return FeatureFlagsShowDropdown.always;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function fetchFeatureFlagUsePhoneNumberBySource(
|
|
80
|
+
buildingSlug: string
|
|
81
|
+
): Promise<boolean> {
|
|
82
|
+
if (!buildingSlug) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const featureFlagResponse = await axios.get(
|
|
87
|
+
featureFlagEndpointV1(buildingSlug),
|
|
88
|
+
{
|
|
89
|
+
params: {
|
|
90
|
+
building_slug: buildingSlug,
|
|
91
|
+
flag_type: "bool",
|
|
92
|
+
feature_flag: "webchat-use-dni-phone-number-by-source",
|
|
93
|
+
default_str: null,
|
|
94
|
+
default_bool: false,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
return featureFlagResponse.data;
|
|
99
|
+
} catch (_) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export async function fetchFeatureFlagUseOverrideContactUsForm(
|
|
105
|
+
buildingSlug: string
|
|
106
|
+
): Promise<boolean> {
|
|
107
|
+
if (!buildingSlug) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const featureFlagResponse = await axios.get(
|
|
112
|
+
featureFlagEndpointV1(buildingSlug),
|
|
113
|
+
{
|
|
114
|
+
params: {
|
|
115
|
+
building_slug: buildingSlug,
|
|
116
|
+
flag_type: "bool",
|
|
117
|
+
feature_flag: "webchat-use-override-contact-us-form",
|
|
118
|
+
default_str: null,
|
|
119
|
+
default_bool: false,
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
return featureFlagResponse.data;
|
|
124
|
+
} catch (_) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export async function fetchFeatureFlagUsePubnub(
|
|
129
|
+
buildingSlug?: string
|
|
130
|
+
): Promise<boolean> {
|
|
131
|
+
if (!buildingSlug) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const featureFlagResponse = await axios.get(
|
|
136
|
+
featureFlagEndpointV1(buildingSlug),
|
|
137
|
+
{
|
|
138
|
+
params: {
|
|
139
|
+
building_slug: buildingSlug,
|
|
140
|
+
flag_type: "bool",
|
|
141
|
+
feature_flag: "use-pubnub-chat-provider",
|
|
142
|
+
default_str: null,
|
|
143
|
+
default_bool: false,
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
return featureFlagResponse.data;
|
|
148
|
+
} catch (_) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export async function fetchFeatureFlagInsertDNIWebsite(
|
|
154
|
+
buildingSlug?: string
|
|
155
|
+
): Promise<boolean> {
|
|
156
|
+
if (!buildingSlug) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
const featureFlagResponse = await axios.get(
|
|
161
|
+
featureFlagEndpointV2(buildingSlug),
|
|
162
|
+
{
|
|
163
|
+
params: {
|
|
164
|
+
building_slug: buildingSlug,
|
|
165
|
+
feature_flag_name: "insert_dni_into_website",
|
|
166
|
+
default_value: false,
|
|
167
|
+
},
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
return featureFlagResponse.data;
|
|
171
|
+
} catch (_) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export async function fetchFeatureFlagShowUtilities(
|
|
177
|
+
orgSlug: string
|
|
178
|
+
): Promise<boolean> {
|
|
179
|
+
if (!orgSlug) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
const buildingSlug = "e2e-test-yardi-building";
|
|
183
|
+
try {
|
|
184
|
+
const featureFlagResponse = await axios.get(
|
|
185
|
+
featureFlagEndpointV1(buildingSlug),
|
|
186
|
+
{
|
|
187
|
+
params: {
|
|
188
|
+
building_slug: buildingSlug,
|
|
189
|
+
flag_type: "bool",
|
|
190
|
+
feature_flag: "enable-show-utilities-webchat",
|
|
191
|
+
default_str: null,
|
|
192
|
+
default_bool: false,
|
|
193
|
+
},
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
return featureFlagResponse.data;
|
|
197
|
+
} catch (_) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export async function fetchFeatureFlagReplaceScheduleTourCtaWebsite(
|
|
203
|
+
buildingSlug: string
|
|
204
|
+
): Promise<boolean> {
|
|
205
|
+
if (!buildingSlug) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
const featureFlagResponse = await axios.get(
|
|
210
|
+
featureFlagEndpointV1(buildingSlug),
|
|
211
|
+
{
|
|
212
|
+
params: {
|
|
213
|
+
building_slug: buildingSlug,
|
|
214
|
+
flag_type: "bool",
|
|
215
|
+
feature_flag: "webchat-replace-any-schedule-tour-cta-website",
|
|
216
|
+
default_str: null,
|
|
217
|
+
default_bool: false,
|
|
218
|
+
},
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
return featureFlagResponse.data;
|
|
222
|
+
} catch (_) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export async function fetchFeatureFlagUseApplicationsLinkReplacement(
|
|
228
|
+
buildingSlug: string
|
|
229
|
+
): Promise<boolean> {
|
|
230
|
+
if (!buildingSlug) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const featureFlagResponse = await axios.get(
|
|
235
|
+
featureFlagEndpointV1(buildingSlug),
|
|
236
|
+
{
|
|
237
|
+
params: {
|
|
238
|
+
building_slug: buildingSlug,
|
|
239
|
+
flag_type: "bool",
|
|
240
|
+
feature_flag: "webchat-use-applications-link-replacement",
|
|
241
|
+
default_str: null,
|
|
242
|
+
default_bool: false,
|
|
243
|
+
},
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
return featureFlagResponse.data;
|
|
247
|
+
} catch (_) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
export interface BuildingABType {
|
|
3
|
+
abTestType: string;
|
|
4
|
+
}
|
|
5
|
+
export default async function fetchLeadSources(
|
|
6
|
+
orgSlug: string,
|
|
7
|
+
buildingSlug: string
|
|
8
|
+
): Promise<string[]> {
|
|
9
|
+
const host = "https://app.meetelise.com";
|
|
10
|
+
try {
|
|
11
|
+
const leadSourcesResponse = await axios.get(
|
|
12
|
+
`${host}/platformApi/webchat/${buildingSlug}/lead-sources`
|
|
13
|
+
);
|
|
14
|
+
if (leadSourcesResponse.data) {
|
|
15
|
+
if (orgSlug === "7e352741-1120-4ccf-9929-5dc99193a908") {
|
|
16
|
+
const onlyIncludeSources = [
|
|
17
|
+
"Zillow",
|
|
18
|
+
"Apartments.com",
|
|
19
|
+
"Google PPC",
|
|
20
|
+
"Google Maps",
|
|
21
|
+
"Apple Maps",
|
|
22
|
+
"Social Media",
|
|
23
|
+
"Print Marketing",
|
|
24
|
+
];
|
|
25
|
+
return leadSourcesResponse.data.filter((source: string) =>
|
|
26
|
+
onlyIncludeSources.includes(source)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return filterOutBuildingSpecificLeadSources(
|
|
30
|
+
leadSourcesResponse.data,
|
|
31
|
+
buildingSlug
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return [];
|
|
35
|
+
} catch (_) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const filterOutBuildingSpecificLeadSources = (
|
|
41
|
+
leadSources: string[],
|
|
42
|
+
buildingSlug: string
|
|
43
|
+
): string[] => {
|
|
44
|
+
// Dinerstien asked to filter out some sources based on their buildings
|
|
45
|
+
let removeLeadSources: string[] = [];
|
|
46
|
+
switch (buildingSlug) {
|
|
47
|
+
case "d41619ec-0f79-11ee-8439-93855926ad58": // Infinity Lofts in the Gulch
|
|
48
|
+
removeLeadSources = [
|
|
49
|
+
"Forthea - PPC",
|
|
50
|
+
"HotPads",
|
|
51
|
+
"Forthea",
|
|
52
|
+
"Locator",
|
|
53
|
+
"Website-apartmentguide.com",
|
|
54
|
+
"Forthea - organic search",
|
|
55
|
+
"Tdc employee",
|
|
56
|
+
"University newspaper",
|
|
57
|
+
"Nashville apartment locators",
|
|
58
|
+
"Forthea - paid social",
|
|
59
|
+
"Apartment list",
|
|
60
|
+
"Off campus partners",
|
|
61
|
+
"Waze ads",
|
|
62
|
+
"Athletic event",
|
|
63
|
+
"Website-apartment guide",
|
|
64
|
+
];
|
|
65
|
+
break;
|
|
66
|
+
case "d4160560-0f79-11ee-8438-fba837bf3a46": // Sawyer on Lincoln
|
|
67
|
+
removeLeadSources = [
|
|
68
|
+
"Forthea - PPC",
|
|
69
|
+
"Rentgrata",
|
|
70
|
+
"Website-ApartmentFinder.com",
|
|
71
|
+
"Word of Mouth",
|
|
72
|
+
"Texas A&M A-Frame on Campus",
|
|
73
|
+
"Rent.com",
|
|
74
|
+
"Website-craigslist",
|
|
75
|
+
"Apartment List",
|
|
76
|
+
"Website-apartments.com",
|
|
77
|
+
"Forthea - paid social",
|
|
78
|
+
"Forthea - organic search",
|
|
79
|
+
"Website-apartmentguide.com",
|
|
80
|
+
"Forthea",
|
|
81
|
+
"Uhomes",
|
|
82
|
+
"Phone book",
|
|
83
|
+
"Property - website",
|
|
84
|
+
];
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
removeLeadSources = [];
|
|
88
|
+
}
|
|
89
|
+
leadSources.sort();
|
|
90
|
+
return leadSources.filter((leadSource) => {
|
|
91
|
+
const lowerCaseLeadSource = leadSource.toLowerCase();
|
|
92
|
+
const lowerCaseRemoveLeadSources = removeLeadSources.map((source) =>
|
|
93
|
+
source.toLowerCase()
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
return !lowerCaseRemoveLeadSources.includes(lowerCaseLeadSource);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { formatPhoneNumber } from "./WebComponent/actions/formatPhoneNumber";
|
|
3
|
+
|
|
4
|
+
export interface NumberForSelectedSource {
|
|
5
|
+
number: string;
|
|
6
|
+
isMatch: boolean;
|
|
7
|
+
isPropertyWebsiteCatchall: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default async function fetchPhoneNumberFromSource(
|
|
11
|
+
buildingSlug: string,
|
|
12
|
+
source: string | null
|
|
13
|
+
): Promise<NumberForSelectedSource | null> {
|
|
14
|
+
const host = "https://app.meetelise.com";
|
|
15
|
+
try {
|
|
16
|
+
const phoneNumberResponse = await axios.get(
|
|
17
|
+
`${host}/platformApi/webchat/${buildingSlug}/phone-number-by-source?source=${source}`
|
|
18
|
+
);
|
|
19
|
+
if (phoneNumberResponse.data) {
|
|
20
|
+
return {
|
|
21
|
+
number: formatPhoneNumber(phoneNumberResponse.data.number),
|
|
22
|
+
isMatch: phoneNumberResponse.data.match,
|
|
23
|
+
isPropertyWebsiteCatchall:
|
|
24
|
+
phoneNumberResponse.data.isPropertyWebsiteCatchall,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
} catch (_) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { camelize } from "./utils";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use BuildingWebchatView instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface WebchatSettings {
|
|
8
|
+
config: WebchatConfigurationPreferences;
|
|
9
|
+
isInheriting: boolean;
|
|
10
|
+
isGlobalDefault: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use BuildingWebchatView instead.
|
|
14
|
+
*/
|
|
15
|
+
export interface WebchatConfigurationPreferences {
|
|
16
|
+
autoOpenChat: boolean;
|
|
17
|
+
shouldShowChat: boolean;
|
|
18
|
+
shouldShowChatDesktop: boolean;
|
|
19
|
+
shouldShowChatMobile: boolean;
|
|
20
|
+
shouldShowTextDesktop: boolean;
|
|
21
|
+
shouldShowTextMobile: boolean;
|
|
22
|
+
shouldShowPhoneDesktop: boolean;
|
|
23
|
+
shouldShowPhoneMobile: boolean;
|
|
24
|
+
shouldShowEmailDesktop: boolean;
|
|
25
|
+
shouldShowEmailMobile: boolean;
|
|
26
|
+
shouldShowSstDesktop: boolean;
|
|
27
|
+
shouldShowSstMobile: boolean;
|
|
28
|
+
requiresConsentForChat: boolean;
|
|
29
|
+
privacyPolicyUrlForChat: string | null;
|
|
30
|
+
collapseMobileFeatures: boolean;
|
|
31
|
+
isInheritingFromOrg: boolean;
|
|
32
|
+
isGlobalDefault: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use BuildingWebchatView instead.
|
|
37
|
+
*/
|
|
38
|
+
export default async function fetchWebchatPreferences(
|
|
39
|
+
buildingId: number
|
|
40
|
+
): Promise<WebchatSettings | null> {
|
|
41
|
+
const host = "https://app.meetelise.com";
|
|
42
|
+
try {
|
|
43
|
+
const webchatPreferencesResponse = await axios.get(
|
|
44
|
+
`${host}/eliseCrmApi/webchat/config/v2/building/${buildingId}`
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (webchatPreferencesResponse.data) {
|
|
48
|
+
return camelize<WebchatSettings>(webchatPreferencesResponse.data);
|
|
49
|
+
}
|
|
50
|
+
} catch (_) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|