@adminide-stack/yantra-mobile 12.0.96-alpha.0 → 12.0.96
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/lib/compute.js +113 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +38 -29
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +20 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +19 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +45 -0
- package/lib/features/apps/nativeAppHandoff.js.map +1 -0
- package/lib/features/apps/nativeAppNavigation.js +66 -0
- package/lib/features/apps/nativeAppNavigation.js.map +1 -0
- package/lib/features/canvas/useCanvasSession.js +4 -3
- package/lib/features/canvas/useCanvasSession.js.map +1 -1
- package/lib/features/job-search/JobSearchExperience.js +46 -17
- package/lib/features/job-search/JobSearchExperience.js.map +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js +146 -0
- package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -0
- package/lib/features/local-services/LocalServicesExperience.js +740 -0
- package/lib/features/local-services/LocalServicesExperience.js.map +1 -0
- package/lib/features/local-services/categories.js +290 -0
- package/lib/features/local-services/categories.js.map +1 -0
- package/lib/features/local-services/chat/widgetOpening.js +139 -0
- package/lib/features/local-services/chat/widgetOpening.js.map +1 -0
- package/lib/features/local-services/components/BusinessCard.js +269 -0
- package/lib/features/local-services/components/BusinessCard.js.map +1 -0
- package/lib/features/local-services/components/BusinessDetail.js +441 -0
- package/lib/features/local-services/components/BusinessDetail.js.map +1 -0
- package/lib/features/local-services/components/CategoryGrid.js +101 -0
- package/lib/features/local-services/components/CategoryGrid.js.map +1 -0
- package/lib/features/local-services/components/FiltersSheet.js +162 -0
- package/lib/features/local-services/components/FiltersSheet.js.map +1 -0
- package/lib/features/local-services/components/ProAvatar.js +38 -0
- package/lib/features/local-services/components/ProAvatar.js.map +1 -0
- package/lib/features/local-services/components/ResultsMap.js +139 -0
- package/lib/features/local-services/components/ResultsMap.js.map +1 -0
- package/lib/features/local-services/components/SearchForm.js +230 -0
- package/lib/features/local-services/components/SearchForm.js.map +1 -0
- package/lib/features/local-services/components/Sheet.js +65 -0
- package/lib/features/local-services/components/Sheet.js.map +1 -0
- package/lib/features/local-services/components/States.js +147 -0
- package/lib/features/local-services/components/States.js.map +1 -0
- package/lib/features/local-services/deviceLocation.js +50 -0
- package/lib/features/local-services/deviceLocation.js.map +1 -0
- package/lib/features/local-services/filters.js +75 -0
- package/lib/features/local-services/filters.js.map +1 -0
- package/lib/features/local-services/format.js +125 -0
- package/lib/features/local-services/format.js.map +1 -0
- package/lib/features/local-services/localServicesClient.js +178 -0
- package/lib/features/local-services/localServicesClient.js.map +1 -0
- package/lib/features/local-services/localServicesContext.js +48 -0
- package/lib/features/local-services/localServicesContext.js.map +1 -0
- package/lib/features/local-services/localServicesMemory.js +202 -0
- package/lib/features/local-services/localServicesMemory.js.map +1 -0
- package/lib/features/local-services/localServicesNormalize.js +204 -0
- package/lib/features/local-services/localServicesNormalize.js.map +1 -0
- package/lib/features/local-services/localServicesTheme.js +50 -0
- package/lib/features/local-services/localServicesTheme.js.map +1 -0
- package/lib/features/local-services/nativeLocalServicesRegistry.js +15 -0
- package/lib/features/local-services/nativeLocalServicesRegistry.js.map +1 -0
- package/lib/features/local-services/openingHours.js +153 -0
- package/lib/features/local-services/openingHours.js.map +1 -0
- package/lib/features/local-services/searchDraft.js +80 -0
- package/lib/features/local-services/searchDraft.js.map +1 -0
- package/lib/features/local-services/useLocalServicesSearch.js +181 -0
- package/lib/features/local-services/useLocalServicesSearch.js.map +1 -0
- package/lib/features/movies/MoviesAgentChatPane.js +49 -0
- package/lib/features/movies/MoviesAgentChatPane.js.map +1 -0
- package/lib/features/movies/MoviesExperience.js +316 -0
- package/lib/features/movies/MoviesExperience.js.map +1 -0
- package/lib/features/movies/components/DiscoverHero.js +256 -0
- package/lib/features/movies/components/DiscoverHero.js.map +1 -0
- package/lib/features/movies/components/LocationSheet.js +259 -0
- package/lib/features/movies/components/LocationSheet.js.map +1 -0
- package/lib/features/movies/components/MovieDetail.js +527 -0
- package/lib/features/movies/components/MovieDetail.js.map +1 -0
- package/lib/features/movies/components/MovieRail.js +188 -0
- package/lib/features/movies/components/MovieRail.js.map +1 -0
- package/lib/features/movies/components/MovieRow.js +119 -0
- package/lib/features/movies/components/MovieRow.js.map +1 -0
- package/lib/features/movies/components/MoviesStates.js +191 -0
- package/lib/features/movies/components/MoviesStates.js.map +1 -0
- package/lib/features/movies/components/MoviesTabBar.js +82 -0
- package/lib/features/movies/components/MoviesTabBar.js.map +1 -0
- package/lib/features/movies/components/PosterImage.js +40 -0
- package/lib/features/movies/components/PosterImage.js.map +1 -0
- package/lib/features/movies/components/Scrim.js +14 -0
- package/lib/features/movies/components/Scrim.js.map +1 -0
- package/lib/features/movies/components/SearchPanel.js +208 -0
- package/lib/features/movies/components/SearchPanel.js.map +1 -0
- package/lib/features/movies/components/ShowtimesPanel.js +279 -0
- package/lib/features/movies/components/ShowtimesPanel.js.map +1 -0
- package/lib/features/movies/components/TrailerPlayer.js +89 -0
- package/lib/features/movies/components/TrailerPlayer.js.map +1 -0
- package/lib/features/movies/components/TrailerStill.js +12 -0
- package/lib/features/movies/components/TrailerStill.js.map +1 -0
- package/lib/features/movies/components/WatchPanel.js +206 -0
- package/lib/features/movies/components/WatchPanel.js.map +1 -0
- package/lib/features/movies/components/WatchlistPanel.js +45 -0
- package/lib/features/movies/components/WatchlistPanel.js.map +1 -0
- package/lib/features/movies/deviceLocation.js +35 -0
- package/lib/features/movies/deviceLocation.js.map +1 -0
- package/lib/features/movies/movieFormats.js +52 -0
- package/lib/features/movies/movieFormats.js.map +1 -0
- package/lib/features/movies/movieMeta.js +38 -0
- package/lib/features/movies/movieMeta.js.map +1 -0
- package/lib/features/movies/moviesClient.js +245 -0
- package/lib/features/movies/moviesClient.js.map +1 -0
- package/lib/features/movies/moviesContext.js +30 -0
- package/lib/features/movies/moviesContext.js.map +1 -0
- package/lib/features/movies/moviesNormalize.js +427 -0
- package/lib/features/movies/moviesNormalize.js.map +1 -0
- package/lib/features/movies/moviesPrompts.js +38 -0
- package/lib/features/movies/moviesPrompts.js.map +1 -0
- package/lib/features/movies/moviesStorage.js +101 -0
- package/lib/features/movies/moviesStorage.js.map +1 -0
- package/lib/features/movies/moviesTheme.js +54 -0
- package/lib/features/movies/moviesTheme.js.map +1 -0
- package/lib/features/movies/nativeMoviesRegistry.js +15 -0
- package/lib/features/movies/nativeMoviesRegistry.js.map +1 -0
- package/lib/features/movies/showtimeDates.js +114 -0
- package/lib/features/movies/showtimeDates.js.map +1 -0
- package/lib/features/movies/useDiscoverRails.js +77 -0
- package/lib/features/movies/useDiscoverRails.js.map +1 -0
- package/lib/features/movies/useMoviesPrefs.js +40 -0
- package/lib/features/movies/useMoviesPrefs.js.map +1 -0
- package/lib/features/resume/ResumeExperience.js +54 -17
- package/lib/features/resume/ResumeExperience.js.map +1 -1
- package/lib/features/shopping/chat/homeShoppingIntent.js +8 -6
- package/lib/features/shopping/chat/homeShoppingIntent.js.map +1 -1
- package/lib/hooks/mintScope.js +28 -0
- package/lib/hooks/mintScope.js.map +1 -0
- package/lib/hooks/mintSurfaceSystemToken.js +27 -53
- package/lib/hooks/mintSurfaceSystemToken.js.map +1 -1
- package/lib/hooks/useCdecliAutoConnect.js +1 -0
- package/lib/hooks/useCdecliAutoConnect.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +108 -0
- package/lib/screens/Chat/index.js +113 -46
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +15 -2
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/CanvasPrewarm.js +2 -1
- package/lib/screens/Home/components/CanvasPrewarm.js.map +1 -1
- package/lib/screens/JobSearchNative/index.js +7 -4
- package/lib/screens/JobSearchNative/index.js.map +1 -1
- package/lib/screens/LocalServicesNative/index.js +99 -0
- package/lib/screens/LocalServicesNative/index.js.map +1 -0
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +65 -0
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -0
- package/lib/screens/MoviesNative/index.js +82 -0
- package/lib/screens/MoviesNative/index.js.map +1 -0
- package/lib/screens/MoviesNative/useMoviesHostChat.js +63 -0
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -0
- package/lib/screens/ResumeNative/index.js +7 -4
- package/lib/screens/ResumeNative/index.js.map +1 -1
- package/lib/screens/WebBuilder/index.js +21 -11
- package/lib/screens/WebBuilder/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useMemo,useState,useRef,useCallback,useEffect}from'react';import {StyleSheet,Keyboard,BackHandler,ScrollView,Text,View,ActivityIndicator,FlatList,Linking}from'react-native';import {GestureHandlerRootView}from'react-native-gesture-handler';import {MaterialCommunityIcons}from'@expo/vector-icons';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {createRemoteConnectorExec}from'../canvas/videoEditor/remoteMediaClient.js';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {Tap,DIM}from'../inbox/components/Tap.js';import {isDeviceLocationAvailable}from'./deviceLocation.js';import {filterCapabilities,radiusOf,activeFilterCount,sortLabel,MAX_RADIUS_MILES,withFilters}from'./filters.js';import {queryKey,directionsUrl,telUrl,recentLabel,whatTitle,whereLabel,wherePillLabel,noResultsLine,countLine}from'./format.js';import {LocalServicesAgentChatPane}from'./LocalServicesAgentChatPane.js';import {createLocalServicesClient}from'./localServicesClient.js';import {DEFAULT_RADIUS_MILES}from'./localServicesNormalize.js';import {useLocalServicesMemory}from'./localServicesMemory.js';import {localServicesTheme}from'./localServicesTheme.js';import {EMPTY_DRAFT,draftFromQuery,queryFromDraft,draftWithCategory}from'./searchDraft.js';import {useLocalServicesSearch,useBusinessDetails}from'./useLocalServicesSearch.js';import {BusinessCardSkeleton,BusinessCard}from'./components/BusinessCard.js';import {BusinessDetail}from'./components/BusinessDetail.js';import {PopularGrid,AllServices}from'./components/CategoryGrid.js';import {FiltersSheet}from'./components/FiltersSheet.js';import {ProAvatar}from'./components/ProAvatar.js';import {mapPins,ResultsMap}from'./components/ResultsMap.js';import {SearchForm}from'./components/SearchForm.js';import {CenteredState,Toast}from'./components/States.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const TOAST_MS = 2200;
|
|
21
|
+
function openExternal(url) {
|
|
22
|
+
if (!url) return;
|
|
23
|
+
Linking.openURL(url).catch((err) => console.warn("[LocalServices] could not open a link:", err));
|
|
24
|
+
}
|
|
25
|
+
function SectionTitle({
|
|
26
|
+
title,
|
|
27
|
+
theme,
|
|
28
|
+
action
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.sectionHead, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.sectionTitle, {
|
|
32
|
+
color: theme.ink
|
|
33
|
+
}], accessibilityRole: "header", children: title }),
|
|
34
|
+
action ? /* @__PURE__ */ jsx(Tap, { onPress: action.onPress, hitSlop: 8, accessibilityRole: "button", accessibilityLabel: action.label, pressedStyle: DIM, children: /* @__PURE__ */ jsx(Text, { style: [styles.sectionAction, {
|
|
35
|
+
color: theme.muted
|
|
36
|
+
}], children: action.label }) }) : null
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
function Chip({
|
|
40
|
+
label,
|
|
41
|
+
icon,
|
|
42
|
+
on = false,
|
|
43
|
+
badge,
|
|
44
|
+
onPress,
|
|
45
|
+
theme,
|
|
46
|
+
testID
|
|
47
|
+
}) {
|
|
48
|
+
return /* @__PURE__ */ jsxs(Tap, { onPress, accessibilityRole: "button", accessibilityLabel: label, accessibilityState: {
|
|
49
|
+
selected: on
|
|
50
|
+
}, style: [styles.chip, on ? {
|
|
51
|
+
backgroundColor: theme.selected,
|
|
52
|
+
borderColor: theme.selected
|
|
53
|
+
} : {
|
|
54
|
+
backgroundColor: theme.card,
|
|
55
|
+
borderColor: theme.border
|
|
56
|
+
}], pressedStyle: DIM, testID, children: [
|
|
57
|
+
icon ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 16, color: on ? theme.selectedInk : theme.ink }) : null,
|
|
58
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.chipLabel, {
|
|
59
|
+
color: on ? theme.selectedInk : theme.ink
|
|
60
|
+
}], children: label }),
|
|
61
|
+
badge ? /* @__PURE__ */ jsx(View, { style: [styles.badge, {
|
|
62
|
+
backgroundColor: theme.accent
|
|
63
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.badgeText, {
|
|
64
|
+
color: theme.accentInk
|
|
65
|
+
}], children: badge }) }) : null
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
function LocalServicesExperience({
|
|
69
|
+
isDark: hostIsDark,
|
|
70
|
+
token,
|
|
71
|
+
indexUrl,
|
|
72
|
+
sessionError,
|
|
73
|
+
onRetrySession,
|
|
74
|
+
orgName,
|
|
75
|
+
onExit,
|
|
76
|
+
hostChat,
|
|
77
|
+
initialAgentSeed = null
|
|
78
|
+
}) {
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
80
|
+
const appTheme = useAppTheme();
|
|
81
|
+
const isDark = hostIsDark != null ? hostIsDark : appTheme.isDark;
|
|
82
|
+
const theme = useMemo(() => localServicesTheme(isDark), [isDark]);
|
|
83
|
+
const insets = useSafeInsets();
|
|
84
|
+
const scope = orgName != null ? orgName : "";
|
|
85
|
+
const client = useMemo(() => token ? createLocalServicesClient(createRemoteConnectorExec(token, indexUrl)) : null, [token, indexUrl]);
|
|
86
|
+
const memory = useLocalServicesMemory(scope);
|
|
87
|
+
const search = useLocalServicesSearch(client);
|
|
88
|
+
const details = useBusinessDetails(client);
|
|
89
|
+
const {
|
|
90
|
+
state
|
|
91
|
+
} = search;
|
|
92
|
+
const locationAvailable = useMemo(() => isDeviceLocationAvailable(), []);
|
|
93
|
+
const [view, setView] = useState("home");
|
|
94
|
+
const [savedFrom, setSavedFrom] = useState("home");
|
|
95
|
+
const [draft, setDraft] = useState(EMPTY_DRAFT);
|
|
96
|
+
const [missing, setMissing] = useState(null);
|
|
97
|
+
const [focusWhereKey, setFocusWhereKey] = useState(0);
|
|
98
|
+
const [focusWhatKey, setFocusWhatKey] = useState(0);
|
|
99
|
+
const [mode, setMode] = useState("list");
|
|
100
|
+
const [mapSelected, setMapSelected] = useState(null);
|
|
101
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
102
|
+
const [detail, setDetail] = useState(null);
|
|
103
|
+
const [agentOpen, setAgentOpen] = useState(Boolean(initialAgentSeed));
|
|
104
|
+
const [agentSeed, setAgentSeed] = useState(initialAgentSeed ? __spreadValues({
|
|
105
|
+
id: "initial"
|
|
106
|
+
}, initialAgentSeed) : null);
|
|
107
|
+
const [toast, setToast] = useState(null);
|
|
108
|
+
const toastTimer = useRef(null);
|
|
109
|
+
const homeScroll = useRef(null);
|
|
110
|
+
const showToast = useCallback((message) => {
|
|
111
|
+
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
112
|
+
setToast(message);
|
|
113
|
+
toastTimer.current = setTimeout(() => setToast(null), TOAST_MS);
|
|
114
|
+
}, []);
|
|
115
|
+
useEffect(() => () => {
|
|
116
|
+
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
117
|
+
}, []);
|
|
118
|
+
const prefilled = useRef(false);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!memory.loaded || prefilled.current) return;
|
|
121
|
+
prefilled.current = true;
|
|
122
|
+
if (memory.lastLocation) setDraft((prev) => prev.where || prev.near ? prev : __spreadProps(__spreadValues({}, prev), {
|
|
123
|
+
where: memory.lastLocation
|
|
124
|
+
}));
|
|
125
|
+
}, [memory.loaded, memory.lastLocation]);
|
|
126
|
+
const attributions = useRef({});
|
|
127
|
+
if (((_a = state.page) == null ? void 0 : _a.provider) && state.page.attribution) {
|
|
128
|
+
attributions.current[state.page.provider] = state.page.attribution;
|
|
129
|
+
}
|
|
130
|
+
const runQuery = useCallback((query) => {
|
|
131
|
+
Keyboard.dismiss();
|
|
132
|
+
setMissing(null);
|
|
133
|
+
setMode("list");
|
|
134
|
+
setMapSelected(null);
|
|
135
|
+
search.run(query);
|
|
136
|
+
setView("results");
|
|
137
|
+
}, [search]);
|
|
138
|
+
const remembered = useRef(null);
|
|
139
|
+
const {
|
|
140
|
+
rememberSearch
|
|
141
|
+
} = memory;
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (state.status !== "ready" || !state.query || !state.businesses.length) return;
|
|
144
|
+
const key = queryKey(state.query);
|
|
145
|
+
if (remembered.current === key) return;
|
|
146
|
+
remembered.current = key;
|
|
147
|
+
rememberSearch(state.query);
|
|
148
|
+
}, [state.status, state.query, state.businesses.length, rememberSearch]);
|
|
149
|
+
const submitDraft = (next) => {
|
|
150
|
+
const result = queryFromDraft(next);
|
|
151
|
+
if ("missing" in result) {
|
|
152
|
+
setMissing(result.missing);
|
|
153
|
+
if (result.missing === "where") setFocusWhereKey((n) => n + 1);
|
|
154
|
+
else setFocusWhatKey((n) => n + 1);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
runQuery(result.query);
|
|
158
|
+
};
|
|
159
|
+
const pickCategory = (category) => {
|
|
160
|
+
var _a2;
|
|
161
|
+
const next = draftWithCategory(draft, category.id);
|
|
162
|
+
setDraft(next);
|
|
163
|
+
if (next.where.trim() || next.near) {
|
|
164
|
+
submitDraft(next);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
setMissing("where");
|
|
168
|
+
(_a2 = homeScroll.current) == null ? void 0 : _a2.scrollTo({
|
|
169
|
+
y: 0,
|
|
170
|
+
animated: true
|
|
171
|
+
});
|
|
172
|
+
setFocusWhereKey((n) => n + 1);
|
|
173
|
+
};
|
|
174
|
+
const editSearch = () => {
|
|
175
|
+
setDraft(draftFromQuery(state.query, memory.lastLocation));
|
|
176
|
+
setMissing(null);
|
|
177
|
+
setView("home");
|
|
178
|
+
setFocusWhatKey((n) => n + 1);
|
|
179
|
+
};
|
|
180
|
+
const applyFilters = (values) => {
|
|
181
|
+
setFiltersOpen(false);
|
|
182
|
+
if (!state.query) return;
|
|
183
|
+
setMode("list");
|
|
184
|
+
search.run(withFilters(state.query, values));
|
|
185
|
+
};
|
|
186
|
+
const center = (_b = state.page) == null ? void 0 : _b.location;
|
|
187
|
+
const near = useMemo(() => typeof (center == null ? void 0 : center.latitude) === "number" && typeof (center == null ? void 0 : center.longitude) === "number" ? {
|
|
188
|
+
latitude: center.latitude,
|
|
189
|
+
longitude: center.longitude
|
|
190
|
+
} : void 0, [center == null ? void 0 : center.latitude, center == null ? void 0 : center.longitude]);
|
|
191
|
+
const toggleSave = useCallback((b) => {
|
|
192
|
+
const nowSaved = memory.toggleSaved(b, attributions.current[b.provider]);
|
|
193
|
+
showToast(nowSaved ? "Saved" : "Removed from saved");
|
|
194
|
+
}, [memory, showToast]);
|
|
195
|
+
const actions = useMemo(() => ({
|
|
196
|
+
onOpen: (b) => {
|
|
197
|
+
Keyboard.dismiss();
|
|
198
|
+
setDetail(b);
|
|
199
|
+
details.load(b.id, view === "results" ? near : void 0);
|
|
200
|
+
},
|
|
201
|
+
onToggleSave: toggleSave,
|
|
202
|
+
onCall: (b) => {
|
|
203
|
+
var _a2;
|
|
204
|
+
return openExternal(telUrl((_a2 = b.phone) != null ? _a2 : b.displayPhone));
|
|
205
|
+
},
|
|
206
|
+
onDirections: (b) => openExternal(directionsUrl(b)),
|
|
207
|
+
onWebsite: (b) => openExternal(b.website)
|
|
208
|
+
}), [details, near, toggleSave, view]);
|
|
209
|
+
const detailActions = useMemo(() => __spreadProps(__spreadValues({}, actions), {
|
|
210
|
+
onToggleSave: (b) => memory.toggleSaved(b, attributions.current[b.provider])
|
|
211
|
+
}), [actions, memory]);
|
|
212
|
+
const openAgent = (seed) => {
|
|
213
|
+
Keyboard.dismiss();
|
|
214
|
+
setDetail(null);
|
|
215
|
+
setAgentSeed(seed ? {
|
|
216
|
+
id: `${Date.now()}`,
|
|
217
|
+
text: seed
|
|
218
|
+
} : null);
|
|
219
|
+
setAgentOpen(true);
|
|
220
|
+
};
|
|
221
|
+
const showAgentResults = (results) => {
|
|
222
|
+
setAgentOpen(false);
|
|
223
|
+
setAgentSeed(null);
|
|
224
|
+
setMode("list");
|
|
225
|
+
search.showAgentResults(results);
|
|
226
|
+
setView("results");
|
|
227
|
+
};
|
|
228
|
+
const agentContext = useMemo(() => ({
|
|
229
|
+
query: view === "results" ? state.query : null,
|
|
230
|
+
page: view === "results" ? state.page : null,
|
|
231
|
+
businesses: view === "results" ? state.businesses : [],
|
|
232
|
+
open: detail,
|
|
233
|
+
savedCount: memory.saved.length,
|
|
234
|
+
orgName
|
|
235
|
+
}), [view, state.query, state.page, state.businesses, detail, memory.saved.length, orgName]);
|
|
236
|
+
const goBack = useCallback(() => {
|
|
237
|
+
if (view === "saved") {
|
|
238
|
+
setView(savedFrom);
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
if (view === "results") {
|
|
242
|
+
setView("home");
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
}, [view, savedFrom]);
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
const sub = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
249
|
+
if (agentOpen) {
|
|
250
|
+
setAgentOpen(false);
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
if (detail) {
|
|
254
|
+
setDetail(null);
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
return goBack();
|
|
258
|
+
});
|
|
259
|
+
return () => sub.remove();
|
|
260
|
+
}, [agentOpen, detail, goBack]);
|
|
261
|
+
const caps = useMemo(() => filterCapabilities(state.businesses, state.query), [state.businesses, state.query]);
|
|
262
|
+
const radius = radiusOf(state.query, (_c = state.page) == null ? void 0 : _c.radiusMiles);
|
|
263
|
+
const filterValues = useMemo(() => {
|
|
264
|
+
var _a2, _b2, _c2;
|
|
265
|
+
return {
|
|
266
|
+
openNow: Boolean((_a2 = state.query) == null ? void 0 : _a2.openNow),
|
|
267
|
+
sortBy: (_c2 = (_b2 = state.query) == null ? void 0 : _b2.sortBy) != null ? _c2 : "best_match",
|
|
268
|
+
radiusMiles: radius
|
|
269
|
+
};
|
|
270
|
+
}, [(_d = state.query) == null ? void 0 : _d.openNow, (_e = state.query) == null ? void 0 : _e.sortBy, radius]);
|
|
271
|
+
const pins = useMemo(() => mapPins(state.businesses), [state.businesses]);
|
|
272
|
+
const selectedOnMap = (_f = state.businesses.find((b) => {
|
|
273
|
+
var _a2;
|
|
274
|
+
return b.id === (mapSelected != null ? mapSelected : (_a2 = pins[0]) == null ? void 0 : _a2.id);
|
|
275
|
+
})) != null ? _f : null;
|
|
276
|
+
const home = /* @__PURE__ */ jsxs(ScrollView, { ref: homeScroll, style: styles.fill, contentContainerStyle: [styles.homeBody, {
|
|
277
|
+
paddingBottom: Math.max(insets.bottom, 16) + 24
|
|
278
|
+
}], keyboardShouldPersistTaps: "handled", keyboardDismissMode: "on-drag", testID: "ls-home", children: [
|
|
279
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.hero, {
|
|
280
|
+
color: theme.ink
|
|
281
|
+
}], children: "Find a local pro" }),
|
|
282
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.heroSub, {
|
|
283
|
+
color: theme.muted
|
|
284
|
+
}], children: "Electricians, plumbers, cleaners and more near you, with hours and a number to call." }),
|
|
285
|
+
/* @__PURE__ */ jsx(View, { style: styles.form, children: /* @__PURE__ */ jsx(SearchForm, { draft, onChange: (next) => {
|
|
286
|
+
setDraft(next);
|
|
287
|
+
if (missing) setMissing(null);
|
|
288
|
+
}, onSubmit: submitDraft, theme, locationAvailable, focusWhereKey, focusWhatKey, missing }) }),
|
|
289
|
+
memory.recent.length ? /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
290
|
+
/* @__PURE__ */ jsx(SectionTitle, { title: "Recent searches", theme, action: {
|
|
291
|
+
label: "Clear",
|
|
292
|
+
onPress: memory.clearRecent
|
|
293
|
+
} }),
|
|
294
|
+
/* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.bleed, contentContainerStyle: styles.rowScroll, keyboardShouldPersistTaps: "handled", children: memory.recent.map((query) => /* @__PURE__ */ jsx(Chip, { label: recentLabel(query), icon: "history", onPress: () => {
|
|
295
|
+
setDraft(draftFromQuery(query, memory.lastLocation));
|
|
296
|
+
runQuery(query);
|
|
297
|
+
}, theme }, recentLabel(query))) })
|
|
298
|
+
] }) : null,
|
|
299
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
300
|
+
/* @__PURE__ */ jsx(SectionTitle, { title: "Popular services", theme }),
|
|
301
|
+
/* @__PURE__ */ jsx(PopularGrid, { theme, onPick: pickCategory })
|
|
302
|
+
] }),
|
|
303
|
+
memory.saved.length ? /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
304
|
+
/* @__PURE__ */ jsx(SectionTitle, { title: "Saved pros", theme, action: {
|
|
305
|
+
label: "See all",
|
|
306
|
+
onPress: () => {
|
|
307
|
+
setSavedFrom("home");
|
|
308
|
+
setView("saved");
|
|
309
|
+
}
|
|
310
|
+
} }),
|
|
311
|
+
/* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.bleed, contentContainerStyle: styles.rowScroll, children: memory.saved.slice(0, 8).map((pro) => {
|
|
312
|
+
var _a2, _b2;
|
|
313
|
+
return /* @__PURE__ */ jsxs(Tap, { onPress: () => actions.onOpen(pro), accessibilityRole: "button", accessibilityLabel: `${pro.name}. Open details`, style: [styles.savedTile, {
|
|
314
|
+
backgroundColor: theme.card,
|
|
315
|
+
borderColor: theme.border
|
|
316
|
+
}], pressedStyle: DIM, children: [
|
|
317
|
+
/* @__PURE__ */ jsx(ProAvatar, { name: pro.name, imageUrl: pro.imageUrl, size: 40, isDark }),
|
|
318
|
+
/* @__PURE__ */ jsxs(View, { style: styles.savedText, children: [
|
|
319
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.savedName, {
|
|
320
|
+
color: theme.ink
|
|
321
|
+
}], numberOfLines: 1, children: pro.name }),
|
|
322
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.savedMeta, {
|
|
323
|
+
color: theme.muted
|
|
324
|
+
}], numberOfLines: 1, children: (_b2 = (_a2 = pro.categories[0]) != null ? _a2 : pro.address) != null ? _b2 : "" })
|
|
325
|
+
] })
|
|
326
|
+
] }, pro.id);
|
|
327
|
+
}) })
|
|
328
|
+
] }) : null,
|
|
329
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
330
|
+
/* @__PURE__ */ jsx(SectionTitle, { title: "All services", theme }),
|
|
331
|
+
/* @__PURE__ */ jsx(AllServices, { theme, onPick: pickCategory })
|
|
332
|
+
] })
|
|
333
|
+
] });
|
|
334
|
+
const resultsHeader = state.query ? /* @__PURE__ */ jsxs(View, { children: [
|
|
335
|
+
/* @__PURE__ */ jsxs(Tap, { onPress: editSearch, accessibilityRole: "button", accessibilityLabel: `${whatTitle(state.query)} near ${whereLabel(state.query, state.page)}. Change search`, style: [styles.searchPill, {
|
|
336
|
+
backgroundColor: theme.card,
|
|
337
|
+
borderColor: theme.border
|
|
338
|
+
}], pressedStyle: DIM, testID: "ls-search-pill", children: [
|
|
339
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "magnify", size: 19, color: theme.muted }),
|
|
340
|
+
/* @__PURE__ */ jsxs(View, { style: styles.pillText, children: [
|
|
341
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.pillWhat, {
|
|
342
|
+
color: theme.ink
|
|
343
|
+
}], numberOfLines: 1, children: whatTitle(state.query) }),
|
|
344
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.pillWhere, {
|
|
345
|
+
color: theme.muted
|
|
346
|
+
}], numberOfLines: 1, children: wherePillLabel(state.query, state.page) })
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "pencil-outline", size: 18, color: theme.muted })
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ jsxs(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.chipStrip, contentContainerStyle: styles.rowScroll, children: [
|
|
351
|
+
/* @__PURE__ */ jsx(Chip, { label: "Filters", icon: "tune-variant", badge: activeFilterCount(state.query), onPress: () => setFiltersOpen(true), theme, testID: "ls-filters" }),
|
|
352
|
+
caps.openNow ? /* @__PURE__ */ jsx(Chip, { label: "Open now", on: Boolean(state.query.openNow), onPress: () => applyFilters(__spreadProps(__spreadValues({}, filterValues), {
|
|
353
|
+
openNow: !filterValues.openNow
|
|
354
|
+
})), theme, testID: "ls-chip-open" }) : null,
|
|
355
|
+
/* @__PURE__ */ jsx(Chip, { label: `Within ${radius} mi`, on: radius !== DEFAULT_RADIUS_MILES, onPress: () => setFiltersOpen(true), theme, testID: "ls-chip-radius" }),
|
|
356
|
+
filterValues.sortBy !== "best_match" ? /* @__PURE__ */ jsx(Chip, { label: sortLabel(filterValues.sortBy), on: true, onPress: () => setFiltersOpen(true), theme }) : null,
|
|
357
|
+
pins.length && state.status === "ready" ? /* @__PURE__ */ jsx(Chip, { label: mode === "map" ? "List" : "Map", icon: mode === "map" ? "format-list-bulleted" : "map-outline", onPress: () => setMode(mode === "map" ? "list" : "map"), theme, testID: "ls-map-toggle" }) : null
|
|
358
|
+
] })
|
|
359
|
+
] }) : null;
|
|
360
|
+
const listFooter = /* @__PURE__ */ jsxs(View, { style: styles.footer, children: [
|
|
361
|
+
state.loadingMore ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.muted, style: styles.moreSpinner }) : null,
|
|
362
|
+
!state.loadingMore && state.moreError ? /* @__PURE__ */ jsxs(View, { style: styles.moreError, children: [
|
|
363
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.moreErrorText, {
|
|
364
|
+
color: theme.muted
|
|
365
|
+
}], children: state.moreError }),
|
|
366
|
+
/* @__PURE__ */ jsx(Chip, { label: "Try again", onPress: search.loadMore, theme })
|
|
367
|
+
] }) : null,
|
|
368
|
+
!state.loadingMore && !state.moreError && ((_g = state.page) == null ? void 0 : _g.nextCursor) ? /* @__PURE__ */ jsx(Chip, { label: "Show more", icon: "chevron-down", onPress: search.loadMore, theme, testID: "ls-more" }) : null,
|
|
369
|
+
((_h = state.page) == null ? void 0 : _h.attribution) ? /* @__PURE__ */ jsx(Text, { style: [styles.attribution, {
|
|
370
|
+
color: theme.faint
|
|
371
|
+
}], testID: "ls-attribution", children: state.page.attribution }) : null
|
|
372
|
+
] });
|
|
373
|
+
const resultsBody = (() => {
|
|
374
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
375
|
+
const {
|
|
376
|
+
query
|
|
377
|
+
} = state;
|
|
378
|
+
if (!query) return null;
|
|
379
|
+
if (state.status === "loading" || state.status === "idle") {
|
|
380
|
+
return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: styles.list, scrollEnabled: false, testID: "ls-results-loading", children: [
|
|
381
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles.summary, {
|
|
382
|
+
color: theme.muted
|
|
383
|
+
}], children: [
|
|
384
|
+
"Looking for ",
|
|
385
|
+
whatTitle(query).toLowerCase(),
|
|
386
|
+
" near ",
|
|
387
|
+
whereLabel(query),
|
|
388
|
+
"\u2026"
|
|
389
|
+
] }),
|
|
390
|
+
[0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(View, { style: styles.cardGap, children: /* @__PURE__ */ jsx(BusinessCardSkeleton, { theme }) }, i))
|
|
391
|
+
] });
|
|
392
|
+
}
|
|
393
|
+
if (state.status === "error") {
|
|
394
|
+
const kind = (_a2 = state.error) == null ? void 0 : _a2.kind;
|
|
395
|
+
if (kind === "location" || kind === "place") {
|
|
396
|
+
return /* @__PURE__ */ jsx(CenteredState, { icon: "map-marker-question-outline", title: kind === "place" ? "Couldn't find that place" : "Where should we look?", body: kind === "place" ? "Check the city, ZIP code or address, then search again." : (_b2 = state.error) == null ? void 0 : _b2.message, theme, primary: {
|
|
397
|
+
label: "Change place",
|
|
398
|
+
onPress: editSearch
|
|
399
|
+
}, secondary: kind === "place" ? {
|
|
400
|
+
label: "Try again",
|
|
401
|
+
onPress: search.retry
|
|
402
|
+
} : void 0, testID: "ls-results-error" });
|
|
403
|
+
}
|
|
404
|
+
return /* @__PURE__ */ jsx(CenteredState, { icon: "cloud-alert", title: "Couldn't load pros", body: (_c2 = state.error) == null ? void 0 : _c2.message, theme, primary: {
|
|
405
|
+
label: "Try again",
|
|
406
|
+
onPress: search.retry
|
|
407
|
+
}, testID: "ls-results-error" });
|
|
408
|
+
}
|
|
409
|
+
if (!state.businesses.length) {
|
|
410
|
+
return /* @__PURE__ */ jsx(CenteredState, { icon: "map-search-outline", title: noResultsLine(query, state.page), body: "Try a wider area or other words.", theme, primary: radius < MAX_RADIUS_MILES ? {
|
|
411
|
+
label: `Search within ${MAX_RADIUS_MILES} miles`,
|
|
412
|
+
onPress: () => applyFilters(__spreadProps(__spreadValues({}, filterValues), {
|
|
413
|
+
radiusMiles: MAX_RADIUS_MILES
|
|
414
|
+
}))
|
|
415
|
+
} : {
|
|
416
|
+
label: "Change search",
|
|
417
|
+
onPress: editSearch
|
|
418
|
+
}, secondary: radius < MAX_RADIUS_MILES ? {
|
|
419
|
+
label: "Change search",
|
|
420
|
+
onPress: editSearch
|
|
421
|
+
} : void 0, testID: "ls-results-empty" });
|
|
422
|
+
}
|
|
423
|
+
if (mode === "map") {
|
|
424
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.fill, children: [
|
|
425
|
+
/* @__PURE__ */ jsx(ResultsMap, { pins, theme, selectedId: (_d2 = selectedOnMap == null ? void 0 : selectedOnMap.id) != null ? _d2 : null, onSelect: setMapSelected, style: styles.fill }),
|
|
426
|
+
selectedOnMap ? /* @__PURE__ */ jsx(View, { style: [styles.mapCard, {
|
|
427
|
+
bottom: Math.max(insets.bottom, 12) + 4
|
|
428
|
+
}], children: /* @__PURE__ */ jsx(BusinessCard, { b: selectedOnMap, saved: memory.savedIds.has(selectedOnMap.id), theme, actions, index: state.businesses.indexOf(selectedOnMap) + 1 }) }) : null
|
|
429
|
+
] });
|
|
430
|
+
}
|
|
431
|
+
return /* @__PURE__ */ jsx(FlatList, { data: state.businesses, keyExtractor: (b) => b.id, renderItem: ({
|
|
432
|
+
item
|
|
433
|
+
}) => /* @__PURE__ */ jsx(View, { style: styles.cardGap, children: /* @__PURE__ */ jsx(BusinessCard, { b: item, saved: memory.savedIds.has(item.id), theme, actions }) }), ListHeaderComponent: /* @__PURE__ */ jsxs(Text, { style: [styles.summary, {
|
|
434
|
+
color: theme.muted
|
|
435
|
+
}], testID: "ls-results-summary", children: [
|
|
436
|
+
state.origin === "agent" ? "Found by the agent \xB7 " : "",
|
|
437
|
+
countLine(state.businesses.length, (_e2 = state.page) == null ? void 0 : _e2.total)
|
|
438
|
+
] }), ListFooterComponent: listFooter, contentContainerStyle: [styles.list, {
|
|
439
|
+
paddingBottom: Math.max(insets.bottom, 16) + 16
|
|
440
|
+
}], onEndReached: search.loadMore, onEndReachedThreshold: 0.6, keyboardShouldPersistTaps: "handled", initialNumToRender: 6, windowSize: 9, testID: "ls-results" });
|
|
441
|
+
})();
|
|
442
|
+
const savedAttributions = Array.from(new Set(memory.saved.map((p) => p.attribution).filter((line) => Boolean(line))));
|
|
443
|
+
const saved = /* @__PURE__ */ jsx(FlatList, { data: memory.saved, keyExtractor: (b) => b.id, renderItem: ({
|
|
444
|
+
item
|
|
445
|
+
}) => /* @__PURE__ */ jsx(View, { style: styles.cardGap, children: /* @__PURE__ */ jsx(BusinessCard, { b: item, saved: true, theme, actions }) }), ListHeaderComponent: /* @__PURE__ */ jsx(Text, { style: [styles.savedHeading, {
|
|
446
|
+
color: theme.ink
|
|
447
|
+
}], accessibilityRole: "header", children: "Saved pros" }), ListEmptyComponent: /* @__PURE__ */ jsx(CenteredState, { icon: "heart-outline", title: "No saved pros yet", body: "Tap the heart on any pro to keep them here, ready to call.", theme, testID: "ls-saved-empty" }), ListFooterComponent: savedAttributions.length ? /* @__PURE__ */ jsx(View, { style: styles.footer, children: savedAttributions.map((line) => /* @__PURE__ */ jsx(Text, { style: [styles.attribution, {
|
|
448
|
+
color: theme.faint
|
|
449
|
+
}], children: line }, line)) }) : null, contentContainerStyle: [styles.list, memory.saved.length ? null : styles.grow, {
|
|
450
|
+
paddingBottom: Math.max(insets.bottom, 16) + 16
|
|
451
|
+
}], testID: "ls-saved" });
|
|
452
|
+
const body = (() => {
|
|
453
|
+
if (sessionError) {
|
|
454
|
+
return /* @__PURE__ */ jsx(CenteredState, { icon: "cloud-alert", title: "Local Services is unavailable", body: sessionError, theme, primary: onRetrySession ? {
|
|
455
|
+
label: "Try again",
|
|
456
|
+
onPress: onRetrySession
|
|
457
|
+
} : void 0, testID: "ls-session-error" });
|
|
458
|
+
}
|
|
459
|
+
if (view === "saved") return saved;
|
|
460
|
+
if (view === "results") {
|
|
461
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.fill, children: [
|
|
462
|
+
resultsHeader,
|
|
463
|
+
resultsBody
|
|
464
|
+
] });
|
|
465
|
+
}
|
|
466
|
+
return home;
|
|
467
|
+
})();
|
|
468
|
+
const detailEntry = detail ? details.entries[detail.id] : void 0;
|
|
469
|
+
return /* @__PURE__ */ jsxs(GestureHandlerRootView, { style: [styles.fill, {
|
|
470
|
+
backgroundColor: theme.screen
|
|
471
|
+
}], testID: "ls-panel", children: [
|
|
472
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.topBar, {
|
|
473
|
+
paddingTop: insets.top + 4,
|
|
474
|
+
borderBottomColor: theme.border
|
|
475
|
+
}], children: [
|
|
476
|
+
/* @__PURE__ */ jsx(Tap, { onPress: () => {
|
|
477
|
+
if (!goBack()) onExit();
|
|
478
|
+
}, hitSlop: 8, accessibilityRole: "button", accessibilityLabel: "Back", style: styles.iconButton, pressedStyle: DIM, testID: "ls-back", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-left", size: 30, color: theme.ink }) }),
|
|
479
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.title, {
|
|
480
|
+
color: theme.ink
|
|
481
|
+
}], numberOfLines: 1, children: "Local Services" }),
|
|
482
|
+
view !== "saved" ? /* @__PURE__ */ jsxs(Tap, { onPress: () => {
|
|
483
|
+
setSavedFrom(view);
|
|
484
|
+
setView("saved");
|
|
485
|
+
}, hitSlop: 6, accessibilityRole: "button", accessibilityLabel: `Saved pros, ${memory.saved.length}`, style: [styles.ghostButton, {
|
|
486
|
+
backgroundColor: theme.chip
|
|
487
|
+
}], pressedStyle: DIM, testID: "ls-saved-button", children: [
|
|
488
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "heart-outline", size: 20, color: theme.ink }),
|
|
489
|
+
memory.saved.length ? /* @__PURE__ */ jsx(View, { style: [styles.dot, {
|
|
490
|
+
backgroundColor: theme.accent,
|
|
491
|
+
borderColor: theme.screen
|
|
492
|
+
}] }) : null
|
|
493
|
+
] }) : null,
|
|
494
|
+
/* @__PURE__ */ jsxs(Tap, { onPress: () => openAgent(), accessibilityRole: "button", accessibilityLabel: "Open Local Services agent", style: [styles.agentChip, {
|
|
495
|
+
backgroundColor: theme.ink
|
|
496
|
+
}], pressedStyle: DIM, testID: "ls-agent", children: [
|
|
497
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "creation", size: 17, color: theme.screen }),
|
|
498
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.agentLabel, {
|
|
499
|
+
color: theme.screen
|
|
500
|
+
}], children: "Agent" })
|
|
501
|
+
] })
|
|
502
|
+
] }),
|
|
503
|
+
body,
|
|
504
|
+
toast ? /* @__PURE__ */ jsx(Toast, { message: toast, theme, bottom: Math.max(insets.bottom, 12) + 24 }) : null,
|
|
505
|
+
/* @__PURE__ */ jsx(FiltersSheet, { visible: filtersOpen, values: filterValues, caps, theme, onApply: applyFilters, onClose: () => setFiltersOpen(false) }),
|
|
506
|
+
detail ? /* @__PURE__ */ jsx(BusinessDetail, { business: detail, entry: detailEntry, saved: memory.savedIds.has(detail.id), attribution: (_j = attributions.current[detail.provider]) != null ? _j : (_i = memory.saved.find((p) => p.id === detail.id)) == null ? void 0 : _i.attribution, theme, actions: detailActions, onRetry: () => details.load(detail.id, near, true), onAskAgent: (b) => openAgent(`Tell me about ${b.name}: is it a good pick for my job, and what should I ask when I call?`), onClose: () => setDetail(null) }) : null,
|
|
507
|
+
/* @__PURE__ */ jsx(LocalServicesAgentChatPane, { visible: agentOpen, onClose: () => {
|
|
508
|
+
setAgentOpen(false);
|
|
509
|
+
setAgentSeed(null);
|
|
510
|
+
}, hostChat, context: agentContext, seed: agentSeed, theme, onShowResults: showAgentResults })
|
|
511
|
+
] });
|
|
512
|
+
}
|
|
513
|
+
const styles = StyleSheet.create({
|
|
514
|
+
fill: {
|
|
515
|
+
flex: 1
|
|
516
|
+
},
|
|
517
|
+
topBar: {
|
|
518
|
+
flexDirection: "row",
|
|
519
|
+
alignItems: "center",
|
|
520
|
+
gap: 8,
|
|
521
|
+
paddingLeft: 4,
|
|
522
|
+
paddingRight: 12,
|
|
523
|
+
paddingBottom: 8,
|
|
524
|
+
minHeight: 52,
|
|
525
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
526
|
+
},
|
|
527
|
+
iconButton: {
|
|
528
|
+
width: 40,
|
|
529
|
+
height: 44,
|
|
530
|
+
alignItems: "center",
|
|
531
|
+
justifyContent: "center"
|
|
532
|
+
},
|
|
533
|
+
title: {
|
|
534
|
+
flex: 1,
|
|
535
|
+
minWidth: 0,
|
|
536
|
+
fontSize: 20,
|
|
537
|
+
fontWeight: "700",
|
|
538
|
+
letterSpacing: -0.3
|
|
539
|
+
},
|
|
540
|
+
ghostButton: {
|
|
541
|
+
width: 38,
|
|
542
|
+
height: 38,
|
|
543
|
+
borderRadius: 19,
|
|
544
|
+
alignItems: "center",
|
|
545
|
+
justifyContent: "center"
|
|
546
|
+
},
|
|
547
|
+
dot: {
|
|
548
|
+
position: "absolute",
|
|
549
|
+
top: 7,
|
|
550
|
+
right: 7,
|
|
551
|
+
width: 9,
|
|
552
|
+
height: 9,
|
|
553
|
+
borderRadius: 5,
|
|
554
|
+
borderWidth: 1.5
|
|
555
|
+
},
|
|
556
|
+
agentChip: {
|
|
557
|
+
flexDirection: "row",
|
|
558
|
+
alignItems: "center",
|
|
559
|
+
gap: 6,
|
|
560
|
+
height: 38,
|
|
561
|
+
paddingHorizontal: 13,
|
|
562
|
+
borderRadius: 19
|
|
563
|
+
},
|
|
564
|
+
agentLabel: {
|
|
565
|
+
fontSize: 14,
|
|
566
|
+
fontWeight: "600"
|
|
567
|
+
},
|
|
568
|
+
homeBody: {
|
|
569
|
+
paddingHorizontal: 16,
|
|
570
|
+
paddingTop: 20
|
|
571
|
+
},
|
|
572
|
+
hero: {
|
|
573
|
+
fontSize: 30,
|
|
574
|
+
fontWeight: "800",
|
|
575
|
+
letterSpacing: -0.8,
|
|
576
|
+
lineHeight: 35
|
|
577
|
+
},
|
|
578
|
+
heroSub: {
|
|
579
|
+
fontSize: 15,
|
|
580
|
+
lineHeight: 21,
|
|
581
|
+
marginTop: 6
|
|
582
|
+
},
|
|
583
|
+
form: {
|
|
584
|
+
marginTop: 18
|
|
585
|
+
},
|
|
586
|
+
section: {
|
|
587
|
+
marginTop: 28
|
|
588
|
+
},
|
|
589
|
+
sectionHead: {
|
|
590
|
+
flexDirection: "row",
|
|
591
|
+
alignItems: "baseline",
|
|
592
|
+
justifyContent: "space-between",
|
|
593
|
+
marginBottom: 12
|
|
594
|
+
},
|
|
595
|
+
sectionTitle: {
|
|
596
|
+
fontSize: 18,
|
|
597
|
+
fontWeight: "700",
|
|
598
|
+
letterSpacing: -0.3
|
|
599
|
+
},
|
|
600
|
+
sectionAction: {
|
|
601
|
+
fontSize: 14,
|
|
602
|
+
fontWeight: "500"
|
|
603
|
+
},
|
|
604
|
+
bleed: {
|
|
605
|
+
marginHorizontal: -16
|
|
606
|
+
},
|
|
607
|
+
rowScroll: {
|
|
608
|
+
gap: 8,
|
|
609
|
+
paddingHorizontal: 16
|
|
610
|
+
},
|
|
611
|
+
chip: {
|
|
612
|
+
flexDirection: "row",
|
|
613
|
+
alignItems: "center",
|
|
614
|
+
gap: 6,
|
|
615
|
+
height: 36,
|
|
616
|
+
paddingHorizontal: 14,
|
|
617
|
+
borderRadius: 18,
|
|
618
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
619
|
+
},
|
|
620
|
+
chipLabel: {
|
|
621
|
+
fontSize: 14,
|
|
622
|
+
fontWeight: "600"
|
|
623
|
+
},
|
|
624
|
+
badge: {
|
|
625
|
+
minWidth: 18,
|
|
626
|
+
height: 18,
|
|
627
|
+
borderRadius: 9,
|
|
628
|
+
paddingHorizontal: 5,
|
|
629
|
+
alignItems: "center",
|
|
630
|
+
justifyContent: "center"
|
|
631
|
+
},
|
|
632
|
+
badgeText: {
|
|
633
|
+
fontSize: 11,
|
|
634
|
+
fontWeight: "700"
|
|
635
|
+
},
|
|
636
|
+
savedTile: {
|
|
637
|
+
width: 210,
|
|
638
|
+
flexDirection: "row",
|
|
639
|
+
alignItems: "center",
|
|
640
|
+
gap: 10,
|
|
641
|
+
padding: 10,
|
|
642
|
+
borderRadius: 16,
|
|
643
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
644
|
+
},
|
|
645
|
+
savedText: {
|
|
646
|
+
flex: 1,
|
|
647
|
+
minWidth: 0
|
|
648
|
+
},
|
|
649
|
+
savedName: {
|
|
650
|
+
fontSize: 14,
|
|
651
|
+
fontWeight: "600"
|
|
652
|
+
},
|
|
653
|
+
savedMeta: {
|
|
654
|
+
fontSize: 12,
|
|
655
|
+
marginTop: 2
|
|
656
|
+
},
|
|
657
|
+
searchPill: {
|
|
658
|
+
flexDirection: "row",
|
|
659
|
+
alignItems: "center",
|
|
660
|
+
gap: 10,
|
|
661
|
+
marginHorizontal: 16,
|
|
662
|
+
marginTop: 12,
|
|
663
|
+
paddingHorizontal: 14,
|
|
664
|
+
height: 56,
|
|
665
|
+
borderRadius: 28,
|
|
666
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
667
|
+
},
|
|
668
|
+
pillText: {
|
|
669
|
+
flex: 1,
|
|
670
|
+
minWidth: 0
|
|
671
|
+
},
|
|
672
|
+
pillWhat: {
|
|
673
|
+
fontSize: 15,
|
|
674
|
+
fontWeight: "600"
|
|
675
|
+
},
|
|
676
|
+
pillWhere: {
|
|
677
|
+
fontSize: 13,
|
|
678
|
+
marginTop: 1
|
|
679
|
+
},
|
|
680
|
+
chipStrip: {
|
|
681
|
+
flexGrow: 0,
|
|
682
|
+
marginTop: 10
|
|
683
|
+
},
|
|
684
|
+
list: {
|
|
685
|
+
paddingHorizontal: 16,
|
|
686
|
+
paddingTop: 12
|
|
687
|
+
},
|
|
688
|
+
summary: {
|
|
689
|
+
fontSize: 13,
|
|
690
|
+
marginBottom: 10
|
|
691
|
+
},
|
|
692
|
+
cardGap: {
|
|
693
|
+
marginBottom: 12
|
|
694
|
+
},
|
|
695
|
+
footer: {
|
|
696
|
+
alignItems: "center",
|
|
697
|
+
paddingTop: 4,
|
|
698
|
+
gap: 14
|
|
699
|
+
},
|
|
700
|
+
moreSpinner: {
|
|
701
|
+
marginVertical: 8
|
|
702
|
+
},
|
|
703
|
+
moreError: {
|
|
704
|
+
alignItems: "center",
|
|
705
|
+
gap: 8
|
|
706
|
+
},
|
|
707
|
+
moreErrorText: {
|
|
708
|
+
fontSize: 14
|
|
709
|
+
},
|
|
710
|
+
attribution: {
|
|
711
|
+
fontSize: 11,
|
|
712
|
+
lineHeight: 15,
|
|
713
|
+
textAlign: "center",
|
|
714
|
+
marginTop: 6,
|
|
715
|
+
paddingHorizontal: 12
|
|
716
|
+
},
|
|
717
|
+
mapCard: {
|
|
718
|
+
position: "absolute",
|
|
719
|
+
left: 12,
|
|
720
|
+
right: 12,
|
|
721
|
+
borderRadius: 18,
|
|
722
|
+
shadowColor: "#000",
|
|
723
|
+
shadowOpacity: 0.18,
|
|
724
|
+
shadowRadius: 16,
|
|
725
|
+
shadowOffset: {
|
|
726
|
+
width: 0,
|
|
727
|
+
height: 6
|
|
728
|
+
},
|
|
729
|
+
elevation: 8
|
|
730
|
+
},
|
|
731
|
+
grow: {
|
|
732
|
+
flexGrow: 1
|
|
733
|
+
},
|
|
734
|
+
savedHeading: {
|
|
735
|
+
fontSize: 24,
|
|
736
|
+
fontWeight: "800",
|
|
737
|
+
letterSpacing: -0.5,
|
|
738
|
+
marginBottom: 14
|
|
739
|
+
}
|
|
740
|
+
});export{LocalServicesExperience,LocalServicesExperience as default};//# sourceMappingURL=LocalServicesExperience.js.map
|