@fast-simon/dashboard-utilities 1.0.143-beta.2 → 1.0.144-beta.0
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/components/FastSimonApi/FastSimonApi.js +118 -74
- package/dist/components/FastSimonApi/FastSimonApi.js.map +1 -1
- package/dist/components/FastSimonApi/reducer.d.ts +8 -1
- package/dist/components/FastSimonApi/reducer.js +22 -0
- package/dist/components/FastSimonApi/reducer.js.map +1 -1
- package/package.json +1 -1
|
@@ -76,6 +76,11 @@ const FastSimonApi = (_a) => {
|
|
|
76
76
|
// Ref for personalization_preview: enables synchronous reads across closures
|
|
77
77
|
const personalizationPreviewRef = useRef(state.personalization_preview);
|
|
78
78
|
personalizationPreviewRef.current = state.personalization_preview;
|
|
79
|
+
// Staleness counter for parallel analytics requests — incremented at start of each onSearch/onCollection
|
|
80
|
+
// Analytics responses check this to discard stale data from superseded queries
|
|
81
|
+
const searchRequestCounterRef = useRef(0);
|
|
82
|
+
// Pending analytics payload — stores analytics if it arrives before the fast response (race condition handling)
|
|
83
|
+
const pendingAnalyticsRef = useRef(null);
|
|
79
84
|
const [categories, setCategories] = useState([]);
|
|
80
85
|
const [analyticsFetched, setAnalyticsFetched] = useState(false);
|
|
81
86
|
const [lastAnalyticsQuery, setLastAnalyticsQuery] = useState('');
|
|
@@ -96,6 +101,9 @@ const FastSimonApi = (_a) => {
|
|
|
96
101
|
function mergeResultsKeepProduct(results) {
|
|
97
102
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'mergeResultsKeepProduct', payload: { results } });
|
|
98
103
|
}
|
|
104
|
+
function dispatchMergeAnalytics(payload) {
|
|
105
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'mergeAnalyticsData', payload });
|
|
106
|
+
}
|
|
99
107
|
function setIsLoading(isLoading) {
|
|
100
108
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'setIsLoading', payload: isLoading });
|
|
101
109
|
}
|
|
@@ -552,10 +560,6 @@ const FastSimonApi = (_a) => {
|
|
|
552
560
|
setIsLoading({ products: true, filters: true });
|
|
553
561
|
// Clear previous comparison data when starting new search
|
|
554
562
|
setComparisonData(null);
|
|
555
|
-
// Pass with_product_analytics only on first request for this query OR when switching from collection to search
|
|
556
|
-
// AND only if merchant is enterprise or subscription level 5
|
|
557
|
-
// forceProductAnalytics bypasses all conditions and always passes with_product_analytics
|
|
558
|
-
// Read from localStorage directly to get the current value (handles setting changes in SettingsModal)
|
|
559
563
|
const currentQuery = props.term || '';
|
|
560
564
|
const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();
|
|
561
565
|
const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentQuery !== lastAnalyticsQuery || lastAnalyticsMode !== 'search'));
|
|
@@ -563,17 +567,44 @@ const FastSimonApi = (_a) => {
|
|
|
563
567
|
const isHybridEnabled = getLSVectorSearchOn();
|
|
564
568
|
const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);
|
|
565
569
|
const personalizationParams = buildPersonalizationParams((_a = personalizationPreviewRef.current) !== null && _a !== void 0 ? _a : { enabled: false, spvJson: '', types: ['gender'] });
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
570
|
+
// Increment staleness counter and clear pending analytics
|
|
571
|
+
const requestId = ++searchRequestCounterRef.current;
|
|
572
|
+
pendingAnalyticsRef.current = null;
|
|
573
|
+
const commonRequestParams = Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, market_context: marketContext, variation_id: state.variation_id, force_and: state.force_and, ps: personalizationSegment, spv: personalizationParams.spv, personalization: personalizationParams.personalization });
|
|
574
|
+
// Fire analytics request in parallel (fire-and-forget) — only if analytics needed
|
|
575
|
+
if (shouldFetchAnalytics) {
|
|
576
|
+
FullTextSearch.getReasoningFullTextSearch(Object.assign(Object.assign({}, commonRequestParams), { with_product_analytics: true, facetRequired: 0 })).then(analyticsResponse => {
|
|
577
|
+
var _a;
|
|
578
|
+
if (searchRequestCounterRef.current !== requestId)
|
|
579
|
+
return; // stale
|
|
580
|
+
if ((_a = analyticsResponse.analytics) === null || _a === void 0 ? void 0 : _a.badges) {
|
|
581
|
+
setAnalyticsFetched(true);
|
|
582
|
+
setLastAnalyticsQuery(currentQuery);
|
|
583
|
+
setLastAnalyticsMode('search');
|
|
584
|
+
}
|
|
585
|
+
const productAnalyticsMap = {};
|
|
586
|
+
const items = analyticsResponse.items || analyticsResponse.products || [];
|
|
587
|
+
for (const product of items) {
|
|
588
|
+
if (product.analytics) {
|
|
589
|
+
productAnalyticsMap[String(product.id)] = product.analytics;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
const payload = {
|
|
593
|
+
analytics: analyticsResponse.analytics,
|
|
594
|
+
matching_sets: analyticsResponse.matching_sets,
|
|
595
|
+
productAnalyticsMap
|
|
596
|
+
};
|
|
597
|
+
pendingAnalyticsRef.current = payload;
|
|
598
|
+
dispatchMergeAnalytics(payload);
|
|
599
|
+
}).catch(err => {
|
|
600
|
+
console.error("[Analytics] Failed to fetch search analytics:", err);
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
// Fire fast request WITHOUT analytics
|
|
604
|
+
FullTextSearch.getReasoningFullTextSearch(Object.assign(Object.assign({}, commonRequestParams), { with_product_analytics: false })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
605
|
+
// Don't preserve stale analytics when fetching fresh ones
|
|
606
|
+
const existingAnalytics = shouldFetchAnalytics ? undefined : results === null || results === void 0 ? void 0 : results.analytics;
|
|
607
|
+
const existingMatchingSets = shouldFetchAnalytics ? undefined : results === null || results === void 0 ? void 0 : results.matching_sets;
|
|
577
608
|
response = getFormatedData(response, existingAnalytics, existingMatchingSets);
|
|
578
609
|
// Handle turbolink responses - skip additional API calls to prevent errors
|
|
579
610
|
if (response.turbolink && response.totalResults === 0) {
|
|
@@ -587,6 +618,14 @@ const FastSimonApi = (_a) => {
|
|
|
587
618
|
setIsLoading({ filters: false, products: false });
|
|
588
619
|
return;
|
|
589
620
|
}
|
|
621
|
+
// Show products immediately
|
|
622
|
+
mergeResults(response, isInfiniteScroll);
|
|
623
|
+
setIsLoading({ products: false, filters: true });
|
|
624
|
+
// If analytics arrived before fast response, re-apply to new results
|
|
625
|
+
if (pendingAnalyticsRef.current && searchRequestCounterRef.current === requestId) {
|
|
626
|
+
dispatchMergeAnalytics(pendingAnalyticsRef.current);
|
|
627
|
+
}
|
|
628
|
+
// Fire IDs + facets in parallel (previously sequential)
|
|
590
629
|
const listIdRequestProps = Object.assign({}, props);
|
|
591
630
|
listIdRequestProps.searchWithinSearch = undefined;
|
|
592
631
|
listIdRequestProps.productsPerPage = 1000000;
|
|
@@ -597,10 +636,6 @@ const FastSimonApi = (_a) => {
|
|
|
597
636
|
listIdRequestProps.ps = personalizationSegment;
|
|
598
637
|
listIdRequestProps.spv = personalizationParams.spv;
|
|
599
638
|
listIdRequestProps.personalization = personalizationParams.personalization;
|
|
600
|
-
let listIdRes = yield FullTextSearch.getReasoningFullTextSearchProductsIds(listIdRequestProps).then((response) => {
|
|
601
|
-
return response;
|
|
602
|
-
});
|
|
603
|
-
response.id_list = listIdRes.id_list;
|
|
604
639
|
const facetsRequestProps = Object.assign({}, props);
|
|
605
640
|
facetsRequestProps.facetRequired = 2;
|
|
606
641
|
facetsRequestProps.searchWithinSearch = props.searchWithinSearch;
|
|
@@ -612,37 +647,29 @@ const FastSimonApi = (_a) => {
|
|
|
612
647
|
facetsRequestProps.ps = personalizationSegment;
|
|
613
648
|
facetsRequestProps.spv = personalizationParams.spv;
|
|
614
649
|
facetsRequestProps.personalization = personalizationParams.personalization;
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
650
|
+
const [listIdRes, facetsRes] = yield Promise.all([
|
|
651
|
+
FullTextSearch.getReasoningFullTextSearchProductsIds(listIdRequestProps),
|
|
652
|
+
FullTextSearch.getReasoningFullTextSearch(facetsRequestProps)
|
|
653
|
+
]);
|
|
654
|
+
// Merge IDs and complete facets into existing results
|
|
655
|
+
mergeResultsKeepProduct({ id_list: listIdRes.id_list, facets: facetsRes.facets });
|
|
620
656
|
if (!customTitleChange) {
|
|
621
657
|
document.title = `Search Result for ${query}`;
|
|
622
658
|
}
|
|
623
659
|
else {
|
|
624
660
|
customTitleChange(results);
|
|
625
661
|
}
|
|
626
|
-
|
|
627
|
-
setIsLoading({
|
|
628
|
-
filters: true, products: false
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
setIsLoading({
|
|
633
|
-
filters: false, products: false
|
|
634
|
-
});
|
|
635
|
-
}
|
|
662
|
+
setIsLoading({ filters: false, products: false });
|
|
636
663
|
// Compare Mode: Make comparison call using IDs endpoint if hybrid search is enabled
|
|
637
|
-
console.log("[Compare Mode] isHybridEnabled:", isHybridEnabled, "hasIdList:", !!
|
|
638
|
-
if (isHybridEnabled &&
|
|
664
|
+
console.log("[Compare Mode] isHybridEnabled:", isHybridEnabled, "hasIdList:", !!listIdRes.id_list);
|
|
665
|
+
if (isHybridEnabled && listIdRes.id_list && listIdRes.id_list.length > 0) {
|
|
639
666
|
setIsComparing(true);
|
|
640
667
|
console.log("[Compare Mode] Making comparison IDs call...");
|
|
641
668
|
try {
|
|
642
669
|
// Get all IDs WITHOUT hybrid_search_settings
|
|
643
670
|
const comparisonResponse = yield FullTextSearch.getComparisonProductIds(Object.assign(Object.assign({}, props), { market_context: marketContext, variation_id: state.variation_id, force_and: state.force_and, ps: personalizationSegment, spv: personalizationParams.spv, personalization: personalizationParams.personalization }));
|
|
644
671
|
const hybridOffIds = (comparisonResponse.id_list || []).map(id => id.toString());
|
|
645
|
-
const hybridOnIds = (
|
|
672
|
+
const hybridOnIds = (listIdRes.id_list || []).map(id => id.toString());
|
|
646
673
|
console.log("[Compare Mode] Hybrid ON IDs count:", hybridOnIds.length);
|
|
647
674
|
console.log("[Compare Mode] Hybrid OFF IDs count:", hybridOffIds.length);
|
|
648
675
|
if (hybridOffIds.length > 0) {
|
|
@@ -690,28 +717,58 @@ const FastSimonApi = (_a) => {
|
|
|
690
717
|
const onCollection = (props, isInfiniteScroll) => {
|
|
691
718
|
var _a;
|
|
692
719
|
setIsLoading({ products: true, filters: true });
|
|
693
|
-
// Pass with_product_analytics only on first request for this collection OR when switching from search to collection
|
|
694
|
-
// AND only if merchant is enterprise or subscription level 5
|
|
695
|
-
// forceProductAnalytics bypasses all conditions and always passes with_product_analytics
|
|
696
|
-
// Read from localStorage directly to get the current value (handles setting changes in SettingsModal)
|
|
697
720
|
const currentCollection = props.categoryID || '';
|
|
698
721
|
const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();
|
|
699
722
|
const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentCollection !== lastAnalyticsCollection || lastAnalyticsMode !== 'collection'));
|
|
700
723
|
const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);
|
|
701
724
|
const personalizationParams = buildPersonalizationParams((_a = personalizationPreviewRef.current) !== null && _a !== void 0 ? _a : { enabled: false, spvJson: '', types: ['gender'] });
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
725
|
+
// Increment staleness counter and clear pending analytics
|
|
726
|
+
const requestId = ++searchRequestCounterRef.current;
|
|
727
|
+
pendingAnalyticsRef.current = null;
|
|
728
|
+
const commonRequestParams = Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, market_context: marketContext, variation_id: state.variation_id, ps: personalizationSegment, spv: personalizationParams.spv, personalization: personalizationParams.personalization, force_and: state.force_and });
|
|
729
|
+
// Fire analytics request in parallel (fire-and-forget) — only if analytics needed
|
|
730
|
+
if (shouldFetchAnalytics) {
|
|
731
|
+
SmartCollections.getSmartCollections(Object.assign(Object.assign({}, commonRequestParams), { with_product_analytics: true, facetRequired: 0 })).then(analyticsResponse => {
|
|
732
|
+
var _a;
|
|
733
|
+
if (searchRequestCounterRef.current !== requestId)
|
|
734
|
+
return; // stale
|
|
735
|
+
if ((_a = analyticsResponse.analytics) === null || _a === void 0 ? void 0 : _a.badges) {
|
|
736
|
+
setAnalyticsFetched(true);
|
|
737
|
+
setLastAnalyticsCollection(currentCollection);
|
|
738
|
+
setLastAnalyticsMode('collection');
|
|
739
|
+
}
|
|
740
|
+
const productAnalyticsMap = {};
|
|
741
|
+
const items = analyticsResponse.items || analyticsResponse.products || [];
|
|
742
|
+
for (const product of items) {
|
|
743
|
+
if (product.analytics) {
|
|
744
|
+
productAnalyticsMap[String(product.id)] = product.analytics;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const payload = {
|
|
748
|
+
analytics: analyticsResponse.analytics,
|
|
749
|
+
matching_sets: analyticsResponse.matching_sets,
|
|
750
|
+
productAnalyticsMap
|
|
751
|
+
};
|
|
752
|
+
pendingAnalyticsRef.current = payload;
|
|
753
|
+
dispatchMergeAnalytics(payload);
|
|
754
|
+
}).catch(err => {
|
|
755
|
+
console.error("[Analytics] Failed to fetch collection analytics:", err);
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
// Fire fast request WITHOUT analytics
|
|
759
|
+
SmartCollections.getSmartCollections(Object.assign(Object.assign({}, commonRequestParams), { with_product_analytics: false })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
760
|
+
// Don't preserve stale analytics when fetching fresh ones
|
|
761
|
+
const existingAnalytics = shouldFetchAnalytics ? undefined : results === null || results === void 0 ? void 0 : results.analytics;
|
|
762
|
+
const existingMatchingSets = shouldFetchAnalytics ? undefined : results === null || results === void 0 ? void 0 : results.matching_sets;
|
|
714
763
|
response = getFormatedData(response, existingAnalytics, existingMatchingSets);
|
|
764
|
+
// Show products immediately
|
|
765
|
+
mergeResults(response, isInfiniteScroll);
|
|
766
|
+
setIsLoading({ products: false, filters: true });
|
|
767
|
+
// If analytics arrived before fast response, re-apply to new results
|
|
768
|
+
if (pendingAnalyticsRef.current && searchRequestCounterRef.current === requestId) {
|
|
769
|
+
dispatchMergeAnalytics(pendingAnalyticsRef.current);
|
|
770
|
+
}
|
|
771
|
+
// Fire IDs + facets in parallel (previously sequential)
|
|
715
772
|
const listIdRequestProps = Object.assign({}, props);
|
|
716
773
|
listIdRequestProps.searchWithinSearch = undefined;
|
|
717
774
|
listIdRequestProps.productsPerPage = 1000000;
|
|
@@ -722,10 +779,6 @@ const FastSimonApi = (_a) => {
|
|
|
722
779
|
listIdRequestProps.ps = personalizationSegment;
|
|
723
780
|
listIdRequestProps.spv = personalizationParams.spv;
|
|
724
781
|
listIdRequestProps.personalization = personalizationParams.personalization;
|
|
725
|
-
let listIdRes = yield SmartCollections.getSmartCollectionsProductsIds(listIdRequestProps).then((response) => {
|
|
726
|
-
return response;
|
|
727
|
-
});
|
|
728
|
-
response.id_list = listIdRes.id_list;
|
|
729
782
|
const facetsRequestProps = Object.assign({}, props);
|
|
730
783
|
facetsRequestProps.facetRequired = 2;
|
|
731
784
|
facetsRequestProps.searchWithinSearch = props.searchWithinSearch;
|
|
@@ -737,21 +790,13 @@ const FastSimonApi = (_a) => {
|
|
|
737
790
|
facetsRequestProps.ps = personalizationSegment;
|
|
738
791
|
facetsRequestProps.spv = personalizationParams.spv;
|
|
739
792
|
facetsRequestProps.personalization = personalizationParams.personalization;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
filters: true, products: false
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
751
|
-
setIsLoading({
|
|
752
|
-
filters: false, products: false
|
|
753
|
-
});
|
|
754
|
-
}
|
|
793
|
+
const [listIdRes, facetsRes] = yield Promise.all([
|
|
794
|
+
SmartCollections.getSmartCollectionsProductsIds(listIdRequestProps),
|
|
795
|
+
SmartCollections.getSmartCollections(facetsRequestProps)
|
|
796
|
+
]);
|
|
797
|
+
// Merge IDs and complete facets into existing results
|
|
798
|
+
mergeResultsKeepProduct({ id_list: listIdRes.id_list, facets: facetsRes.facets });
|
|
799
|
+
setIsLoading({ filters: false, products: false });
|
|
755
800
|
getAllCategories().then(r => {
|
|
756
801
|
var _a, _b;
|
|
757
802
|
if (!customTitleChange) {
|
|
@@ -761,8 +806,7 @@ const FastSimonApi = (_a) => {
|
|
|
761
806
|
customTitleChange(results);
|
|
762
807
|
}
|
|
763
808
|
});
|
|
764
|
-
}))
|
|
765
|
-
});
|
|
809
|
+
}));
|
|
766
810
|
};
|
|
767
811
|
// Memoize to prevent unnecessary recreation
|
|
768
812
|
const getAllCategories = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FastSimonApi.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/FastSimonApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAwD,SAAS,EAAE,kBAAkB,EAA2B,MAAM,WAAW,CAAC;AACzI,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAC,yBAAyB,EAAqB,MAA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C,YAAY,CAAC,CAAC","sourcesContent":["import React, {useEffect, useReducer, useRef, useState, useMemo, useCallback} from \"react\";\nimport {ComparisonData, ProductRankChange, CustomSortSettings, FastState, FastStateFunctions, IsLoading, SetStateProps} from \"./context\";\nimport {ThemeProvider} from \"react-jss\";\nimport {fastStateReducer} from \"./reducer\";\nimport {newObject} from \"../common\";\n\nimport {SortBy} from \"../../@types/sortBy\";\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../../@types/results\";\nimport {getShowSalesAnalyticsSetting} from \"../../utils/getSalesAnalyticsSettings\";\nimport {getLSVectorSearchOn} from \"../../utils/getLSVectorSearch\";\nimport {getPersonalizationSegment, UserSegmentPreview} from \"../../utils/userSegmentPreview\";\nimport {buildPersonalizationParams, PersonalizationPreviewSettings} from \"../../utils/personalizationPreview\";\n\nimport {Product} from \"../../@types/product\";\nimport {FastCategory, smartCollectionsProps, smartCollectionsResults} from \"../../@types/categories\";\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\nimport {FullTextSearch} from \"../../services/search\";\nimport {SmartCollections} from \"../../services/smartCollections\";\nimport {autocompleteProps, AutocompleteReasoningResponse} from \"../../@types/autocomplete\";\nimport {Autocomplete} from \"../../services/autocomplete\";\n\nexport type AppType = \"SPA\" | \"MPA\";\n\ninterface Props {\n storeID: number;\n uuid: string;\n type?: AppType;\n onReady?: VoidFunction;\n cartToken?: string;\n defaultSort?: SortBy\n collectionID?: string\n withProductAttributes?: boolean\n promoTiles?: boolean\n getTitle?: ({}: { categoryID?: string, query?: string }) => string\n isInfiniteScroll?: boolean\n useFilters?: boolean\n noReport?: boolean\n customTitleChange?: (results?: FullTextServerResponseAll | smartCollectionsResults) => void\n theme?: Partial<MainTheme>\n children?: React.ReactNode;\n siteKey?:string\n isEnterpriseMerchandising?: boolean;\n subscription?: number;\n marketContext?: string | null; // Region code for market-specific product filtering (e.g., \"US\", \"CA\", \"UK\")\n forceProductAnalytics?: boolean; // When true, always pass with_product_analytics regardless of other conditions\n variationId?: string | null; // A/B test variation ID for reasoning/experiment tracking\n}\n\nexport interface MainTheme {\n primaryColor: string\n lighterPrimary: string\n successGreen: string\n errorRed: string\n loadingYellow: string,\n}\n\nconst mainTheme: MainTheme = {\n primaryColor: \"#1976d2\",\n lighterPrimary: \"rgba(25,118,210,0.71)\",\n successGreen: \"#4BB543\",\n errorRed: \"#ff0033\",\n loadingYellow: \"#f3b706\",\n}\n\n\nconst FastSimonApi: React.FC<Props> = ({\n storeID, uuid,siteKey, children,\n defaultSort , promoTiles = false, theme,\n withProductAttributes = false, isInfiniteScroll = false, getTitle,\n useFilters, noReport = false, customTitleChange,\n isEnterpriseMerchandising = false, subscription = 0,\n marketContext = null,\n forceProductAnalytics = false,\n variationId = null,\n ...props\n }) => {\n const [state, dispatch] = (useReducer as any)?.(fastStateReducer, {\n isReady: false,\n type: props.type ?? 'SPA',\n page: 1,\n query: '',\n sortBy: defaultSort,\n isLoading: {\n products: false,\n filters: false,\n },\n collectionID: props.collectionID,\n narrow: undefined,\n results: undefined,\n recommendations: {},\n singleProducts: {},\n searchWithinSearch: \"\",\n segments: undefined,\n flag:[],\n custom_sort_settings:undefined,\n isAutocomplete:false,\n variation_id: variationId, // Initialize from prop, then updated via setVariationId\n force_and: false,\n user_segment_preview: 'none' as UserSegmentPreview, // User segment preview mode for AI Explainer\n personalization_preview: null as PersonalizationPreviewSettings | null,\n // Compare Mode state\n comparisonData: null,\n isComparing: false\n });\n\n // Ref for user_segment_preview: enables synchronous reads across closures\n // so that any fetch triggered in the same handler (e.g. setCustomSort) reads the latest value\n const userSegmentPreviewRef = useRef<UserSegmentPreview>(state.user_segment_preview);\n userSegmentPreviewRef.current = state.user_segment_preview;\n\n // Ref for personalization_preview: enables synchronous reads across closures\n const personalizationPreviewRef = useRef<PersonalizationPreviewSettings | null>(state.personalization_preview);\n personalizationPreviewRef.current = state.personalization_preview;\n\n const [categories, setCategories] = useState<FastCategory[]>([]);\n const [analyticsFetched, setAnalyticsFetched] = useState(false);\n const [lastAnalyticsQuery, setLastAnalyticsQuery] = useState<string>('');\n const [lastAnalyticsCollection, setLastAnalyticsCollection] = useState<string>('');\n const [lastAnalyticsMode, setLastAnalyticsMode] = useState<'search' | 'collection' | ''>('');\n\n // Only enable analytics for enterprise merchants or subscription level 5\n const isAnalyticsEnabled = isEnterpriseMerchandising || subscription === 5;\n\n const {results, isLoading, query, sortBy, type, collectionID, page, narrow, recommendations, singleProducts, isReady, autocomplete, segments,isAutocomplete\n\n } = state;\n\n function setResults(results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse | undefined) {\n (dispatch as any)?.({type: 'setResults', payload: results});\n }\n\n function mergeResults(results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse, infiniteScroll: boolean) {\n (dispatch as any)?.({type: 'mergeResults', payload: {results, infiniteScroll}});\n }\n function mergeFacetsWithResults(facets:Narrow[]) {\n (dispatch as any)?.({type: 'mergeFacetsWithResults', payload: facets});\n }\n\n function mergeResultsKeepProduct(results: FullTextServerResponseAll | smartCollectionsResults) {\n (dispatch as any)?.({type: 'mergeResultsKeepProduct', payload: {results}});\n }\n\n function setIsLoading(isLoading: IsLoading) {\n (dispatch as any)?.({type: 'setIsLoading', payload: isLoading});\n }\n\n function setIsAutocomplete(isAutocomplete:boolean)\n {\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: isAutocomplete});\n }\n\n function setVariationId(variationId: string | null) {\n (dispatch as any)?.({type: 'setVariationId', payload: variationId});\n }\n\n function setComparisonData(comparisonData: ComparisonData | null) {\n (dispatch as any)?.({type: 'setComparisonData', payload: comparisonData});\n }\n\n function setIsComparing(isComparing: boolean) {\n (dispatch as any)?.({type: 'setIsComparing', payload: isComparing});\n }\n\n function setForceAnd(forceAnd: boolean) {\n (dispatch as any)?.({type: 'setForceAnd', payload: forceAnd});\n }\n\n function updateSettingsAndRefetch(settings: Partial<Pick<typeof state, 'force_and' | 'custom_sort_settings' | 'flag' | 'user_segment_preview' | 'personalization_preview'>>) {\n (dispatch as any)?.({type: 'updateSettingsAndRefetch', payload: settings});\n }\n\n function setUserSegmentPreview(preview: UserSegmentPreview) {\n userSegmentPreviewRef.current = preview;\n (dispatch as any)?.({type: 'setUserSegmentPreview', payload: preview});\n }\n\n function setPersonalizationPreview(preview: PersonalizationPreviewSettings | null) {\n personalizationPreviewRef.current = preview;\n (dispatch as any)?.({type: 'setPersonalizationPreview', payload: preview});\n }\n\n // Compute detailed comparison between Hybrid ON and Hybrid OFF using full ID lists\n function computeComparisonFromIds(hybridOnIds: string[], hybridOffIds: string[]): ComparisonData {\n // Create rank maps (1-based index)\n const onRankMap = new Map<string, number>();\n const offRankMap = new Map<string, number>();\n\n hybridOnIds.forEach((id, index) => onRankMap.set(id.toString(), index + 1));\n hybridOffIds.forEach((id, index) => offRankMap.set(id.toString(), index + 1));\n\n const productChanges = new Map<string, ProductRankChange>();\n let totalImproved = 0;\n let totalDeclined = 0;\n let totalNew = 0;\n let totalUnchanged = 0;\n\n // Analyze all products in hybrid ON results\n hybridOnIds.forEach((id) => {\n const idStr = id.toString();\n const rankWithHybrid = onRankMap.get(idStr) || -1;\n const rankWithoutHybrid = offRankMap.get(idStr) || -1;\n\n let status: ProductRankChange['status'];\n let rankDelta = 0;\n\n if (rankWithoutHybrid === -1) {\n // Product not in results without hybrid - it's new due to hybrid\n status = 'new';\n totalNew++;\n } else {\n rankDelta = rankWithoutHybrid - rankWithHybrid; // Positive = improved (moved up)\n\n if (rankDelta > 0) {\n status = 'improved';\n totalImproved++;\n } else if (rankDelta < 0) {\n status = 'declined';\n totalDeclined++;\n } else {\n status = 'unchanged';\n totalUnchanged++;\n }\n }\n\n productChanges.set(idStr, {\n productId: idStr,\n rankWithHybrid,\n rankWithoutHybrid,\n rankDelta,\n status\n });\n });\n\n return {\n hybridOnIds: hybridOnIds.map(id => id.toString()),\n hybridOffIds: hybridOffIds.map(id => id.toString()),\n productChanges,\n totalImproved,\n totalDeclined,\n totalNew,\n totalUnchanged\n };\n }\n\n function setQuery(query: string , isAutocomplete?:boolean) {\n (dispatch as any)?.({type: 'setQuery', payload: query});\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: isAutocomplete?isAutocomplete:false});\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: query,\n sortBy: defaultSort,\n segments: state.segments,\n withProductAttributes:withProductAttributes,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll,isAutocomplete?isAutocomplete:false);\n }\n function setCustomSort(customSortSettings:CustomSortSettings) {\n (dispatch as any)?.({type: 'setCustomSort', payload: customSortSettings});\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes:state.withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:customSortSettings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setFlag(flags: string[]) {\n const flagsToData=flags.map((f)=>{return \"disable_\" + f;});\n (dispatch as any)?.({type: 'setFlag', payload: flagsToData });\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid: uuid,\n storeID: storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.defaultSort,\n segments: state.segments,\n categoryID: state.collectionID,\n withProductAttributes: withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n if(flags.length>0)\n {\n flags.forEach((f)=>{\n let flagProp = \"disable_\" + f;\n // Add the dynamic key to the object\n // @ts-ignore\n fetchParams[flagProp as any] = true;\n });\n }\n\n\n fetchResults(fetchParams, isInfiniteScroll,state.isAutocomplete);\n }\n\n function setSortBy(sortBy: SortBy) {\n (dispatch as any)?.({type: 'setSortBy', payload: sortBy});\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes:withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n function setSegments(segments: string[]) {\n (dispatch as any)?.({type: 'setSegments', payload: segments});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll,state.isAutocomplete);\n\n }\n function setType(type: AppType) {\n (dispatch as any)?.({type: 'setType', payload: type});\n }\n\n function setCollectionID(collectionID: string) {\n (dispatch as any)?.({type: 'setCollectionID', payload: collectionID});\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: false});\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n categoryID: collectionID,\n sortBy: defaultSort,\n segments: state.segments,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setPage(page: number) {\n (dispatch as any)?.({type: 'setPage', payload: page});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n page: page,\n segments: state.segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setNarrow(narrow: ServerNarrow[] | undefined) {\n (dispatch as any)?.({type: 'setNarrow', payload: narrow});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setState({...newState}: SetStateProps) {\n console.log(\"state\", state);\n console.log(\"setState\", newState);\n\n (dispatch as any)?.({type: 'setState', payload: newState});\n\n fetchResults({\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: newState.query,\n narrowBy: newState.narrow?newState.narrow:undefined,\n sortBy: newState.sortBy ?? defaultSort,\n categoryID: newState.collectionID,\n page: newState.page,\n segments: newState.segments,\n variation_id: state.variation_id,\n force_and: state.force_and,\n }, Boolean(!results && isInfiniteScroll && newState.page && newState.page > 1));\n }\n\n\n function setSingleProducts(products: Product[]) {\n (dispatch as any)?.({type: \"setSingleProducts\", payload: products});\n }\n\n\n function setReady(isReady: boolean) {\n (dispatch as any)?.({type: \"setReady\", payload: isReady});\n }\n\n function setSearchWithinSearch(searchWithinSearch: string) {\n (dispatch as any)?.({type: \"setSearchWithinSearch\", payload: searchWithinSearch});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n searchWithinSearch:searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function fetchResults(props:{\n uuid:string, storeID:number,siteKey?:string, term?: string, page?: number, narrowBy?: ServerNarrow[] | undefined,\n sortBy?: SortBy, categoryID?: string, searchWithinSearch?: string, segments?: string[] ,withProductAttributes?:boolean,\n disable_semantics?:number,disable_merchandising?:number,disable_strategies?:number,disable_turbolinks?:number,disable_personalization?:number,custom_sort_settings?:CustomSortSettings,\n variation_id?: string | null, force_and?: boolean\n },\n isInfiniteScroll: boolean,\n autocomplete:boolean=false) {\n\n // on first request check if we need to fetch more then 1 product\n\n if (props.term && !autocomplete) {\n onSearch(newObject({\n ...props,\n page: props.page || 1,\n infiniteScrollPage: isInfiniteScroll,\n }) as Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll);\n } else if(props.term && autocomplete){\n onAutocompleteSearch(newObject({\n ...props\n }) as Omit<autocompleteProps, \"callback\" | \"page\" | \"narrowBy\" | \"sortBy\" | \"categoryID\" | \"searchWithinSearch\" | \"custom_sort_settings\">);\n } else if (props.categoryID) {\n onCollection(newObject({\n ...props,\n page: props.page || 1,\n infiniteScrollPage: isInfiniteScroll,\n }) as Omit<smartCollectionsProps, \"callback\">, isInfiniteScroll);\n }\n\n return;\n\n }\n\n\n\n useEffect(() => {\n function handleSetQueryEvent(event: any) {\n // Support both string (legacy) and object with isAutocomplete flag\n if (typeof event.detail === 'string') {\n setQuery(event.detail);\n } else {\n setQuery(event.detail.query, event.detail.isAutocomplete);\n }\n }\n\n function handleSetFlagEvent(event: any){\n setFlag(event.details)\n\n }\n function handleSetCollectionEvent(event: any) {\n setCollectionID(typeof event.detail === 'string' ? event.detail : event.detail.collectionID);\n }\n\n function handleSetCollectionURLEvent(event: any) {\n getAllCategories().then(r => {\n const id = r.find(c => c.u === event.detail)?.id;\n\n if (id) {\n setCollectionID(id);\n return;\n }\n\n window.location.href = event.detail;\n })\n }\n\n function handleSetPageEvent(event: any) {\n setPage(event.detail);\n }\n\n function handleSetSortEvent(event: any) {\n setSortBy(event.detail);\n }\n\n function handleSetNarrowEvent(event: any) {\n setNarrow(event.detail);\n }\n\n function handleSetSegmentsEvent(event: any) {\n setSegments(event.detail);\n }\n function handleSetIsAutocomplete(event:any){\n setIsAutocomplete(event.detail)\n }\n window.addEventListener('fast-simon-update-query', handleSetQueryEvent);\n window.addEventListener('fast-simon-update-collection', handleSetCollectionEvent);\n window.addEventListener('fast-simon-update-collection-url', handleSetCollectionURLEvent);\n window.addEventListener('fast-simon-update-page', handleSetPageEvent);\n window.addEventListener('fast-simon-update-sort', handleSetSortEvent);\n window.addEventListener('fast-simon-update-narrow', handleSetNarrowEvent);\n window.addEventListener('fast-simon-update-segments', handleSetSegmentsEvent);\n window.addEventListener('fast-simon-update-flag', handleSetFlagEvent);\n window.addEventListener('fast-simon-update-is-autocomplete', handleSetIsAutocomplete);\n\n return () => {\n window.removeEventListener('fast-simon-update-query', handleSetQueryEvent);\n window.removeEventListener('fast-simon-update-collection', handleSetCollectionEvent);\n window.removeEventListener('fast-simon-update-collection-url', handleSetCollectionURLEvent);\n window.removeEventListener('fast-simon-update-page', handleSetPageEvent);\n window.removeEventListener('fast-simon-update-sort', handleSetSortEvent);\n window.removeEventListener('fast-simon-update-narrow', handleSetNarrowEvent);\n window.removeEventListener('fast-simon-update-segments', handleSetSegmentsEvent);\n window.removeEventListener('fast-simon-update-flag', handleSetFlagEvent);\n window.removeEventListener('fast-simon-update-is-autocomplete', handleSetIsAutocomplete);\n }\n\n }, []);\n\n // Settings modal refetch: triggered after state is updated (no race conditions)\n // All settings (force_and, flags, custom_sort, user_segment_preview, personalization_preview)\n // are batched via updateSettingsAndRefetch to avoid double-fetches and stale-state reads.\n useEffect(() => {\n if (!state.refetchTrigger) return;\n // Build fetchParams from the now-updated state\n const fetchParams = {\n siteKey: siteKey,\n uuid: uuid,\n storeID: storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy ?? defaultSort,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes: withProductAttributes,\n searchWithinSearch: state.searchWithinSearch,\n custom_sort_settings: state.custom_sort_settings,\n disable_merchandising: state.flag?.find((f: string) => f == \"disable_merchandising\") ? 1 : 0,\n disable_semantics: state.flag?.find((f: string) => f == \"disable_semantics\") ? 1 : 0,\n disable_turbolinks: state.flag?.find((f: string) => f == \"disable_turbolinks\") ? 1 : 0,\n disable_strategies: state.flag?.find((f: string) => f == \"disable_strategies\") ? 1 : 0,\n disable_merchandising_rules: state.flag?.find((f: string) => f == \"disable_merchandising_rules\") ? 1 : 0,\n disable_antonyms: state.flag?.find((f: string) => f == \"disable_antonyms\") ? 1 : 0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n fetchResults(fetchParams, isInfiniteScroll, state.isAutocomplete);\n }, [state.refetchTrigger]);\n\n const onSearch = (props: Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\n\n // Clear previous comparison data when starting new search\n setComparisonData(null);\n\n // Pass with_product_analytics only on first request for this query OR when switching from collection to search\n // AND only if merchant is enterprise or subscription level 5\n // forceProductAnalytics bypasses all conditions and always passes with_product_analytics\n // Read from localStorage directly to get the current value (handles setting changes in SettingsModal)\n const currentQuery = props.term || '';\n const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();\n const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentQuery !== lastAnalyticsQuery || lastAnalyticsMode !== 'search'));\n\n // Check if hybrid search is enabled - we'll need to make a comparison call\n const isHybridEnabled = getLSVectorSearchOn();\n\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n FullTextSearch.getReasoningFullTextSearch({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n }).then(async(response) => {\n // Mark analytics as fetched only if response contains analytics data with badges\n if (shouldFetchAnalytics && response.analytics?.badges) {\n setAnalyticsFetched(true);\n setLastAnalyticsQuery(currentQuery);\n setLastAnalyticsMode('search');\n }\n\n // Preserve existing analytics and matching_sets if new response doesn't have them\n const existingAnalytics = (results as any)?.analytics;\n const existingMatchingSets = (results as any)?.matching_sets;\n response=getFormatedData(response, existingAnalytics, existingMatchingSets);\n\n // Handle turbolink responses - skip additional API calls to prevent errors\n if (response.turbolink && response.totalResults === 0) {\n mergeResults(response, isInfiniteScroll);\n\n if (!customTitleChange) {\n document.title = `Search Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n setIsLoading({filters: false, products: false});\n return;\n }\n\n const listIdRequestProps = { ...props };\n listIdRequestProps.searchWithinSearch=undefined;\n listIdRequestProps.productsPerPage=1000000;\n listIdRequestProps.page=1;\n listIdRequestProps.market_context = marketContext;\n listIdRequestProps.variation_id = state.variation_id;\n listIdRequestProps.force_and = state.force_and;\n listIdRequestProps.ps = personalizationSegment;\n listIdRequestProps.spv = personalizationParams.spv;\n listIdRequestProps.personalization = personalizationParams.personalization;\n let listIdRes=await FullTextSearch.getReasoningFullTextSearchProductsIds(listIdRequestProps).then((response)=>{\n return response;\n });\n response.id_list=listIdRes.id_list;\n\n const facetsRequestProps = { ...props };\n facetsRequestProps.facetRequired=2;\n facetsRequestProps.searchWithinSearch=props.searchWithinSearch;\n facetsRequestProps.productsPerPage=props.productsPerPage;\n facetsRequestProps.page=props.page;\n facetsRequestProps.market_context = marketContext;\n facetsRequestProps.variation_id = state.variation_id;\n facetsRequestProps.force_and = state.force_and;\n facetsRequestProps.ps = personalizationSegment;\n facetsRequestProps.spv = personalizationParams.spv;\n facetsRequestProps.personalization = personalizationParams.personalization;\n let facetsRes=await FullTextSearch.getReasoningFullTextSearch(facetsRequestProps).then((response)=>{\n return response;\n });\n response.facets=facetsRes.facets;\n\n mergeResults(response, isInfiniteScroll);\n\n if (!customTitleChange) {\n document.title = `Search Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n if (!response) {\n setIsLoading({\n filters: true, products: false\n });\n } else {\n setIsLoading({\n filters: false, products: false\n });\n }\n\n // Compare Mode: Make comparison call using IDs endpoint if hybrid search is enabled\n console.log(\"[Compare Mode] isHybridEnabled:\", isHybridEnabled, \"hasIdList:\", !!response.id_list);\n if (isHybridEnabled && response.id_list && response.id_list.length > 0) {\n setIsComparing(true);\n console.log(\"[Compare Mode] Making comparison IDs call...\");\n try {\n // Get all IDs WITHOUT hybrid_search_settings\n const comparisonResponse = await FullTextSearch.getComparisonProductIds({\n ...props,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n });\n\n const hybridOffIds = (comparisonResponse.id_list || []).map(id => id.toString());\n const hybridOnIds = (response.id_list || []).map(id => id.toString());\n console.log(\"[Compare Mode] Hybrid ON IDs count:\", hybridOnIds.length);\n console.log(\"[Compare Mode] Hybrid OFF IDs count:\", hybridOffIds.length);\n\n if (hybridOffIds.length > 0) {\n const diff = computeComparisonFromIds(hybridOnIds, hybridOffIds);\n console.log(\"[Compare Mode] Diff computed - improved:\", diff.totalImproved, \"declined:\", diff.totalDeclined, \"new:\", diff.totalNew);\n setComparisonData(diff);\n }\n } catch (error) {\n console.error(\"[Compare Mode] Failed to fetch comparison IDs:\", error);\n setComparisonData(null);\n } finally {\n setIsComparing(false);\n }\n }\n });\n }\n const onAutocompleteSearch = (props: Omit<autocompleteProps, \"callback\">) => {\n setIsLoading({products: true, filters: true});\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n Autocomplete.getAutocompleteReasoning({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n }).then(async(response) => {\n response=getFormatedData(response);\n\n mergeResults(response, false);\n\n if (!customTitleChange) {\n document.title = `Autocomplete Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n if (!response) {\n setIsLoading({\n filters: true, products: false\n });\n } else {\n setIsLoading({\n filters: false, products: false\n });\n }\n });\n }\n\n const onCollection = (props: Omit<smartCollectionsProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\n\n // Pass with_product_analytics only on first request for this collection OR when switching from search to collection\n // AND only if merchant is enterprise or subscription level 5\n // forceProductAnalytics bypasses all conditions and always passes with_product_analytics\n // Read from localStorage directly to get the current value (handles setting changes in SettingsModal)\n const currentCollection = props.categoryID || '';\n const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();\n const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentCollection !== lastAnalyticsCollection || lastAnalyticsMode !== 'collection'));\n\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n SmartCollections.getSmartCollections({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext,\n variation_id: state.variation_id,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization,\n force_and: state.force_and})\n .then( async (response) => {\n // Mark analytics as fetched only if response contains analytics data with badges\n if (shouldFetchAnalytics && response.analytics?.badges) {\n setAnalyticsFetched(true);\n setLastAnalyticsCollection(currentCollection);\n setLastAnalyticsMode('collection');\n }\n\n // Preserve existing analytics and matching_sets if new response doesn't have them\n const existingAnalytics = (results as any)?.analytics;\n const existingMatchingSets = (results as any)?.matching_sets;\n response=getFormatedData(response, existingAnalytics, existingMatchingSets);\n\n const listIdRequestProps = { ...props };\n listIdRequestProps.searchWithinSearch=undefined;\n listIdRequestProps.productsPerPage=1000000;\n listIdRequestProps.page=1;\n listIdRequestProps.market_context = marketContext;\n listIdRequestProps.variation_id = state.variation_id;\n listIdRequestProps.force_and = state.force_and;\n listIdRequestProps.ps = personalizationSegment;\n listIdRequestProps.spv = personalizationParams.spv;\n listIdRequestProps.personalization = personalizationParams.personalization;\n let listIdRes=await SmartCollections.getSmartCollectionsProductsIds(listIdRequestProps).then((response)=>{\n return response;\n });\n response.id_list=listIdRes.id_list;\n\n const facetsRequestProps = { ...props };\n facetsRequestProps.facetRequired=2;\n facetsRequestProps.searchWithinSearch=props.searchWithinSearch;\n facetsRequestProps.productsPerPage=props.productsPerPage;\n facetsRequestProps.page=props.page;\n facetsRequestProps.market_context = marketContext;\n facetsRequestProps.variation_id = state.variation_id;\n facetsRequestProps.force_and = state.force_and;\n facetsRequestProps.ps = personalizationSegment;\n facetsRequestProps.spv = personalizationParams.spv;\n facetsRequestProps.personalization = personalizationParams.personalization;\n let facetsRes= await SmartCollections.getSmartCollections(facetsRequestProps).then((response)=>{\n return response;\n });\n response.facets=facetsRes.facets;\n\n mergeResults(response, isInfiniteScroll);\n\n if (!response) {\n setIsLoading({\n filters: true, products: false\n });\n } else {\n setIsLoading({\n filters: false, products: false\n });\n }\n\n getAllCategories().then(r => {\n if (!customTitleChange) {\n document.title = r.find(c => c.id === props.categoryID)?.l ?? \"Collection\";\n } else {\n customTitleChange(results);\n }\n });\n }).then(()=>{\n\n });\n }\n\n // Memoize to prevent unnecessary recreation\n const getAllCategories = useCallback(async () => {\n if (categories.length > 0) {\n return new Promise<FastCategory[]>(resolve => resolve(categories))\n }\n\n const data = categories || [];\n\n setCategories(data)\n\n return data;\n }, [categories]);\n\n const getFormatedData = (response: any, existingAnalytics?: any, existingMatchingSets?: any) => {\n const results = response;\n\n results.products = response.items;\n delete results.items;\n results.totalResults = response.total_results;\n delete results.total_results;\n if (response.sort_by) {\n results.sortBy = response.sort_by;\n delete results.sort_by;\n }\n\n if (response.pop_products_no_results) {\n results.isNoResults = true;\n }\n\n if (response.total_p) {\n results.pageCount = response.total_p;\n delete results.total_p;\n }\n\n\n if (response.ancestor_categories) {\n results.ancestors = response.ancestor_categories;\n delete results.ancestor_categories;\n }\n\n if (response.avoid_tag_prefixes) {\n results.avoidPrefixList = response.avoid_tag_prefixes.split(\",\");\n }\n\n\n results.page = response.p || 1;\n delete results.p;\n\n // Preserve analytics field if present (contains winners/overexposed data)\n // If response has new analytics, use it; otherwise keep existing analytics\n if (response.analytics) {\n results.analytics = response.analytics;\n } else if (existingAnalytics) {\n results.analytics = existingAnalytics;\n }\n\n // Preserve matching_sets field if present (product ID -> set name)\n // If response has new matching_sets, use it; otherwise keep existing\n if (response.matching_sets) {\n results.matching_sets = response.matching_sets;\n } else if (existingMatchingSets) {\n results.matching_sets = existingMatchingSets;\n }\n\n return results;\n };\n\n\n // Memoize state context to prevent unnecessary re-renders\n const stateContextValue = useMemo(() => ({\n narrow,\n results,\n page,\n query,\n sortBy,\n type,\n collectionID,\n isLoading,\n recommendations,\n singleProducts,\n isReady,\n autocomplete,\n isAutocomplete,\n variation_id: state.variation_id,\n force_and: state.force_and,\n comparisonData: state.comparisonData,\n isComparing: state.isComparing\n }), [narrow, results, page, query, sortBy, type, collectionID, isLoading, recommendations, singleProducts, isReady, autocomplete, isAutocomplete, state.variation_id, state.force_and, state.comparisonData, state.isComparing]);\n\n // Memoize theme to prevent unnecessary object creation\n const mergedTheme = useMemo(() => ({...mainTheme, ...theme}), [theme]);\n\n // @ts-ignore\n return (\n <FastStateFunctions.Provider\n value={{\n setQuery,\n setSort: setSortBy,\n setNarrow,\n setPage,\n getAllCategories,\n setCollection: setCollectionID,\n setState,\n setSearchWithinSearch,\n setSegments,\n setFlag,\n setCustomSort,\n setIsAutocomplete,\n setVariationId,\n setForceAnd,\n setUserSegmentPreview,\n setPersonalizationPreview,\n updateSettingsAndRefetch\n }}>\n <FastState.Provider value={stateContextValue}>\n <ThemeProvider theme={mergedTheme}>\n {children}\n </ThemeProvider>\n </FastState.Provider>\n </FastStateFunctions.Provider>\n )\n};\n\n// Memoize component to prevent unnecessary re-renders when parent updates\nexport default React.memo(FastSimonApi);"]}
|
|
1
|
+
{"version":3,"file":"FastSimonApi.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/FastSimonApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAwD,SAAS,EAAE,kBAAkB,EAA2B,MAAM,WAAW,CAAC;AACzI,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAC,yBAAyB,EAAqB,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAAC,0BAA0B,EAAiC,MAAM,oCAAoC,CAAC;AAK9G,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAqCzD,MAAM,SAAS,GAAc;IACzB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,uBAAuB;IACvC,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,SAAS;CAC3B,CAAA;AAGD,MAAM,YAAY,GAAoB,CAAC,EAUC,EAAE,EAAE;;QAVL,EACI,OAAO,EAAE,IAAI,EAAC,OAAO,EAAE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Ac,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjO,uDAAuD;IACvD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,iCAAK,SAAS,GAAK,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEvE,aAAa;IACb,OAAO,CACH,KAAC,kBAAkB,CAAC,QAAQ,kBACxB,KAAK,EAAE;YACH,QAAQ;YACR,OAAO,EAAE,SAAS;YAClB,SAAS;YACT,OAAO;YACP,gBAAgB;YAChB,aAAa,EAAE,eAAe;YAC9B,QAAQ;YACR,qBAAqB;YACrB,WAAW;YACX,OAAO;YACP,aAAa;YACb,iBAAiB;YACjB,cAAc;YACd,WAAW;YACX,qBAAqB;YACrB,yBAAyB;YACzB,wBAAwB;SAC3B,gBACD,KAAC,SAAS,CAAC,QAAQ,kBAAC,KAAK,EAAE,iBAAiB,gBACxC,KAAC,aAAa,kBAAC,KAAK,EAAE,WAAW,gBAC5B,QAAQ,IACG,IACC,IACK,CACjC,CAAA;AACL,CAAC,CAAC;AAEF,0EAA0E;AAC1E,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import React, {useEffect, useReducer, useRef, useState, useMemo, useCallback} from \"react\";\nimport {ComparisonData, ProductRankChange, CustomSortSettings, FastState, FastStateFunctions, IsLoading, SetStateProps} from \"./context\";\nimport {ThemeProvider} from \"react-jss\";\nimport {fastStateReducer} from \"./reducer\";\nimport {newObject} from \"../common\";\n\nimport {SortBy} from \"../../@types/sortBy\";\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../../@types/results\";\nimport {getShowSalesAnalyticsSetting} from \"../../utils/getSalesAnalyticsSettings\";\nimport {getLSVectorSearchOn} from \"../../utils/getLSVectorSearch\";\nimport {getPersonalizationSegment, UserSegmentPreview} from \"../../utils/userSegmentPreview\";\nimport {buildPersonalizationParams, PersonalizationPreviewSettings} from \"../../utils/personalizationPreview\";\n\nimport {Product, ProductAnalytics} from \"../../@types/product\";\nimport {FastCategory, smartCollectionsProps, smartCollectionsResults} from \"../../@types/categories\";\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\nimport {FullTextSearch} from \"../../services/search\";\nimport {SmartCollections} from \"../../services/smartCollections\";\nimport {autocompleteProps, AutocompleteReasoningResponse} from \"../../@types/autocomplete\";\nimport {Autocomplete} from \"../../services/autocomplete\";\n\nexport type AppType = \"SPA\" | \"MPA\";\n\ninterface Props {\n storeID: number;\n uuid: string;\n type?: AppType;\n onReady?: VoidFunction;\n cartToken?: string;\n defaultSort?: SortBy\n collectionID?: string\n withProductAttributes?: boolean\n promoTiles?: boolean\n getTitle?: ({}: { categoryID?: string, query?: string }) => string\n isInfiniteScroll?: boolean\n useFilters?: boolean\n noReport?: boolean\n customTitleChange?: (results?: FullTextServerResponseAll | smartCollectionsResults) => void\n theme?: Partial<MainTheme>\n children?: React.ReactNode;\n siteKey?:string\n isEnterpriseMerchandising?: boolean;\n subscription?: number;\n marketContext?: string | null; // Region code for market-specific product filtering (e.g., \"US\", \"CA\", \"UK\")\n forceProductAnalytics?: boolean; // When true, always pass with_product_analytics regardless of other conditions\n variationId?: string | null; // A/B test variation ID for reasoning/experiment tracking\n}\n\nexport interface MainTheme {\n primaryColor: string\n lighterPrimary: string\n successGreen: string\n errorRed: string\n loadingYellow: string,\n}\n\nconst mainTheme: MainTheme = {\n primaryColor: \"#1976d2\",\n lighterPrimary: \"rgba(25,118,210,0.71)\",\n successGreen: \"#4BB543\",\n errorRed: \"#ff0033\",\n loadingYellow: \"#f3b706\",\n}\n\n\nconst FastSimonApi: React.FC<Props> = ({\n storeID, uuid,siteKey, children,\n defaultSort , promoTiles = false, theme,\n withProductAttributes = false, isInfiniteScroll = false, getTitle,\n useFilters, noReport = false, customTitleChange,\n isEnterpriseMerchandising = false, subscription = 0,\n marketContext = null,\n forceProductAnalytics = false,\n variationId = null,\n ...props\n }) => {\n const [state, dispatch] = (useReducer as any)?.(fastStateReducer, {\n isReady: false,\n type: props.type ?? 'SPA',\n page: 1,\n query: '',\n sortBy: defaultSort,\n isLoading: {\n products: false,\n filters: false,\n },\n collectionID: props.collectionID,\n narrow: undefined,\n results: undefined,\n recommendations: {},\n singleProducts: {},\n searchWithinSearch: \"\",\n segments: undefined,\n flag:[],\n custom_sort_settings:undefined,\n isAutocomplete:false,\n variation_id: variationId, // Initialize from prop, then updated via setVariationId\n force_and: false,\n user_segment_preview: 'none' as UserSegmentPreview, // User segment preview mode for AI Explainer\n personalization_preview: null as PersonalizationPreviewSettings | null,\n // Compare Mode state\n comparisonData: null,\n isComparing: false\n });\n\n // Ref for user_segment_preview: enables synchronous reads across closures\n // so that any fetch triggered in the same handler (e.g. setCustomSort) reads the latest value\n const userSegmentPreviewRef = useRef<UserSegmentPreview>(state.user_segment_preview);\n userSegmentPreviewRef.current = state.user_segment_preview;\n\n // Ref for personalization_preview: enables synchronous reads across closures\n const personalizationPreviewRef = useRef<PersonalizationPreviewSettings | null>(state.personalization_preview);\n personalizationPreviewRef.current = state.personalization_preview;\n\n // Staleness counter for parallel analytics requests — incremented at start of each onSearch/onCollection\n // Analytics responses check this to discard stale data from superseded queries\n const searchRequestCounterRef = useRef(0);\n\n // Pending analytics payload — stores analytics if it arrives before the fast response (race condition handling)\n const pendingAnalyticsRef = useRef<{\n analytics?: FullTextServerResponseAll['analytics'];\n matching_sets?: Record<string, string>;\n productAnalyticsMap?: Record<string, ProductAnalytics>;\n } | null>(null);\n\n const [categories, setCategories] = useState<FastCategory[]>([]);\n const [analyticsFetched, setAnalyticsFetched] = useState(false);\n const [lastAnalyticsQuery, setLastAnalyticsQuery] = useState<string>('');\n const [lastAnalyticsCollection, setLastAnalyticsCollection] = useState<string>('');\n const [lastAnalyticsMode, setLastAnalyticsMode] = useState<'search' | 'collection' | ''>('');\n\n // Only enable analytics for enterprise merchants or subscription level 5\n const isAnalyticsEnabled = isEnterpriseMerchandising || subscription === 5;\n\n const {results, isLoading, query, sortBy, type, collectionID, page, narrow, recommendations, singleProducts, isReady, autocomplete, segments,isAutocomplete\n\n } = state;\n\n function setResults(results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse | undefined) {\n (dispatch as any)?.({type: 'setResults', payload: results});\n }\n\n function mergeResults(results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse, infiniteScroll: boolean) {\n (dispatch as any)?.({type: 'mergeResults', payload: {results, infiniteScroll}});\n }\n function mergeFacetsWithResults(facets:Narrow[]) {\n (dispatch as any)?.({type: 'mergeFacetsWithResults', payload: facets});\n }\n\n function mergeResultsKeepProduct(results: FullTextServerResponseAll | smartCollectionsResults) {\n (dispatch as any)?.({type: 'mergeResultsKeepProduct', payload: {results}});\n }\n\n function dispatchMergeAnalytics(payload: {\n analytics?: FullTextServerResponseAll['analytics'];\n matching_sets?: Record<string, string>;\n productAnalyticsMap?: Record<string, ProductAnalytics>;\n }) {\n (dispatch as any)?.({type: 'mergeAnalyticsData', payload});\n }\n\n function setIsLoading(isLoading: IsLoading) {\n (dispatch as any)?.({type: 'setIsLoading', payload: isLoading});\n }\n\n function setIsAutocomplete(isAutocomplete:boolean)\n {\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: isAutocomplete});\n }\n\n function setVariationId(variationId: string | null) {\n (dispatch as any)?.({type: 'setVariationId', payload: variationId});\n }\n\n function setComparisonData(comparisonData: ComparisonData | null) {\n (dispatch as any)?.({type: 'setComparisonData', payload: comparisonData});\n }\n\n function setIsComparing(isComparing: boolean) {\n (dispatch as any)?.({type: 'setIsComparing', payload: isComparing});\n }\n\n function setForceAnd(forceAnd: boolean) {\n (dispatch as any)?.({type: 'setForceAnd', payload: forceAnd});\n }\n\n function updateSettingsAndRefetch(settings: Partial<Pick<typeof state, 'force_and' | 'custom_sort_settings' | 'flag' | 'user_segment_preview' | 'personalization_preview'>>) {\n (dispatch as any)?.({type: 'updateSettingsAndRefetch', payload: settings});\n }\n\n function setUserSegmentPreview(preview: UserSegmentPreview) {\n userSegmentPreviewRef.current = preview;\n (dispatch as any)?.({type: 'setUserSegmentPreview', payload: preview});\n }\n\n function setPersonalizationPreview(preview: PersonalizationPreviewSettings | null) {\n personalizationPreviewRef.current = preview;\n (dispatch as any)?.({type: 'setPersonalizationPreview', payload: preview});\n }\n\n // Compute detailed comparison between Hybrid ON and Hybrid OFF using full ID lists\n function computeComparisonFromIds(hybridOnIds: string[], hybridOffIds: string[]): ComparisonData {\n // Create rank maps (1-based index)\n const onRankMap = new Map<string, number>();\n const offRankMap = new Map<string, number>();\n\n hybridOnIds.forEach((id, index) => onRankMap.set(id.toString(), index + 1));\n hybridOffIds.forEach((id, index) => offRankMap.set(id.toString(), index + 1));\n\n const productChanges = new Map<string, ProductRankChange>();\n let totalImproved = 0;\n let totalDeclined = 0;\n let totalNew = 0;\n let totalUnchanged = 0;\n\n // Analyze all products in hybrid ON results\n hybridOnIds.forEach((id) => {\n const idStr = id.toString();\n const rankWithHybrid = onRankMap.get(idStr) || -1;\n const rankWithoutHybrid = offRankMap.get(idStr) || -1;\n\n let status: ProductRankChange['status'];\n let rankDelta = 0;\n\n if (rankWithoutHybrid === -1) {\n // Product not in results without hybrid - it's new due to hybrid\n status = 'new';\n totalNew++;\n } else {\n rankDelta = rankWithoutHybrid - rankWithHybrid; // Positive = improved (moved up)\n\n if (rankDelta > 0) {\n status = 'improved';\n totalImproved++;\n } else if (rankDelta < 0) {\n status = 'declined';\n totalDeclined++;\n } else {\n status = 'unchanged';\n totalUnchanged++;\n }\n }\n\n productChanges.set(idStr, {\n productId: idStr,\n rankWithHybrid,\n rankWithoutHybrid,\n rankDelta,\n status\n });\n });\n\n return {\n hybridOnIds: hybridOnIds.map(id => id.toString()),\n hybridOffIds: hybridOffIds.map(id => id.toString()),\n productChanges,\n totalImproved,\n totalDeclined,\n totalNew,\n totalUnchanged\n };\n }\n\n function setQuery(query: string , isAutocomplete?:boolean) {\n (dispatch as any)?.({type: 'setQuery', payload: query});\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: isAutocomplete?isAutocomplete:false});\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: query,\n sortBy: defaultSort,\n segments: state.segments,\n withProductAttributes:withProductAttributes,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll,isAutocomplete?isAutocomplete:false);\n }\n function setCustomSort(customSortSettings:CustomSortSettings) {\n (dispatch as any)?.({type: 'setCustomSort', payload: customSortSettings});\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes:state.withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:customSortSettings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setFlag(flags: string[]) {\n const flagsToData=flags.map((f)=>{return \"disable_\" + f;});\n (dispatch as any)?.({type: 'setFlag', payload: flagsToData });\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid: uuid,\n storeID: storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.defaultSort,\n segments: state.segments,\n categoryID: state.collectionID,\n withProductAttributes: withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n if(flags.length>0)\n {\n flags.forEach((f)=>{\n let flagProp = \"disable_\" + f;\n // Add the dynamic key to the object\n // @ts-ignore\n fetchParams[flagProp as any] = true;\n });\n }\n\n\n fetchResults(fetchParams, isInfiniteScroll,state.isAutocomplete);\n }\n\n function setSortBy(sortBy: SortBy) {\n (dispatch as any)?.({type: 'setSortBy', payload: sortBy});\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes:withProductAttributes,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n function setSegments(segments: string[]) {\n (dispatch as any)?.({type: 'setSegments', payload: segments});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll,state.isAutocomplete);\n\n }\n function setType(type: AppType) {\n (dispatch as any)?.({type: 'setType', payload: type});\n }\n\n function setCollectionID(collectionID: string) {\n (dispatch as any)?.({type: 'setCollectionID', payload: collectionID});\n (dispatch as any)?.({type: 'setIsAutocomplete', payload: false});\n\n // Create the object with the computed property\n let fetchParams = {\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n categoryID: collectionID,\n sortBy: defaultSort,\n segments: state.segments,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setPage(page: number) {\n (dispatch as any)?.({type: 'setPage', payload: page});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n page: page,\n segments: state.segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setNarrow(narrow: ServerNarrow[] | undefined) {\n (dispatch as any)?.({type: 'setNarrow', payload: narrow});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: state.query,\n narrowBy: narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n searchWithinSearch:state.searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function setState({...newState}: SetStateProps) {\n console.log(\"state\", state);\n console.log(\"setState\", newState);\n\n (dispatch as any)?.({type: 'setState', payload: newState});\n\n fetchResults({\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: newState.query,\n narrowBy: newState.narrow?newState.narrow:undefined,\n sortBy: newState.sortBy ?? defaultSort,\n categoryID: newState.collectionID,\n page: newState.page,\n segments: newState.segments,\n variation_id: state.variation_id,\n force_and: state.force_and,\n }, Boolean(!results && isInfiniteScroll && newState.page && newState.page > 1));\n }\n\n\n function setSingleProducts(products: Product[]) {\n (dispatch as any)?.({type: \"setSingleProducts\", payload: products});\n }\n\n\n function setReady(isReady: boolean) {\n (dispatch as any)?.({type: \"setReady\", payload: isReady});\n }\n\n function setSearchWithinSearch(searchWithinSearch: string) {\n (dispatch as any)?.({type: \"setSearchWithinSearch\", payload: searchWithinSearch});\n\n let fetchParams = {\n withProductAttributes:withProductAttributes,\n siteKey:siteKey,\n uuid:uuid,\n storeID:storeID,\n term: query,\n narrowBy: state.narrow,\n sortBy: state.sortBy,\n categoryID: state.collectionID,\n segments: state.segments,\n searchWithinSearch:searchWithinSearch,\n custom_sort_settings:state.custom_sort_settings,\n disable_merchandising:state.flag.find((f:string)=>f==\"disable_merchandising\")?1:0,\n disable_semantics:state.flag.find((f:string)=>f==\"disable_semantics\")?1:0,\n disable_turbolinks:state.flag.find((f:string)=>f==\"disable_turbolinks\")?1:0,\n disable_strategies:state.flag.find((f:string)=>f==\"disable_strategies\")?1:0,\n disable_merchandising_rules:state.flag.find((f:string)=>f==\"disable_merchandising_rules\")?1:0,\n disable_antonyms:state.flag.find((f:string)=>f==\"disable_antonyms\")?1:0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n\n fetchResults(fetchParams, isInfiniteScroll);\n\n }\n\n function fetchResults(props:{\n uuid:string, storeID:number,siteKey?:string, term?: string, page?: number, narrowBy?: ServerNarrow[] | undefined,\n sortBy?: SortBy, categoryID?: string, searchWithinSearch?: string, segments?: string[] ,withProductAttributes?:boolean,\n disable_semantics?:number,disable_merchandising?:number,disable_strategies?:number,disable_turbolinks?:number,disable_personalization?:number,custom_sort_settings?:CustomSortSettings,\n variation_id?: string | null, force_and?: boolean\n },\n isInfiniteScroll: boolean,\n autocomplete:boolean=false) {\n\n // on first request check if we need to fetch more then 1 product\n\n if (props.term && !autocomplete) {\n onSearch(newObject({\n ...props,\n page: props.page || 1,\n infiniteScrollPage: isInfiniteScroll,\n }) as Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll);\n } else if(props.term && autocomplete){\n onAutocompleteSearch(newObject({\n ...props\n }) as Omit<autocompleteProps, \"callback\" | \"page\" | \"narrowBy\" | \"sortBy\" | \"categoryID\" | \"searchWithinSearch\" | \"custom_sort_settings\">);\n } else if (props.categoryID) {\n onCollection(newObject({\n ...props,\n page: props.page || 1,\n infiniteScrollPage: isInfiniteScroll,\n }) as Omit<smartCollectionsProps, \"callback\">, isInfiniteScroll);\n }\n\n return;\n\n }\n\n\n\n useEffect(() => {\n function handleSetQueryEvent(event: any) {\n // Support both string (legacy) and object with isAutocomplete flag\n if (typeof event.detail === 'string') {\n setQuery(event.detail);\n } else {\n setQuery(event.detail.query, event.detail.isAutocomplete);\n }\n }\n\n function handleSetFlagEvent(event: any){\n setFlag(event.details)\n\n }\n function handleSetCollectionEvent(event: any) {\n setCollectionID(typeof event.detail === 'string' ? event.detail : event.detail.collectionID);\n }\n\n function handleSetCollectionURLEvent(event: any) {\n getAllCategories().then(r => {\n const id = r.find(c => c.u === event.detail)?.id;\n\n if (id) {\n setCollectionID(id);\n return;\n }\n\n window.location.href = event.detail;\n })\n }\n\n function handleSetPageEvent(event: any) {\n setPage(event.detail);\n }\n\n function handleSetSortEvent(event: any) {\n setSortBy(event.detail);\n }\n\n function handleSetNarrowEvent(event: any) {\n setNarrow(event.detail);\n }\n\n function handleSetSegmentsEvent(event: any) {\n setSegments(event.detail);\n }\n function handleSetIsAutocomplete(event:any){\n setIsAutocomplete(event.detail)\n }\n window.addEventListener('fast-simon-update-query', handleSetQueryEvent);\n window.addEventListener('fast-simon-update-collection', handleSetCollectionEvent);\n window.addEventListener('fast-simon-update-collection-url', handleSetCollectionURLEvent);\n window.addEventListener('fast-simon-update-page', handleSetPageEvent);\n window.addEventListener('fast-simon-update-sort', handleSetSortEvent);\n window.addEventListener('fast-simon-update-narrow', handleSetNarrowEvent);\n window.addEventListener('fast-simon-update-segments', handleSetSegmentsEvent);\n window.addEventListener('fast-simon-update-flag', handleSetFlagEvent);\n window.addEventListener('fast-simon-update-is-autocomplete', handleSetIsAutocomplete);\n\n return () => {\n window.removeEventListener('fast-simon-update-query', handleSetQueryEvent);\n window.removeEventListener('fast-simon-update-collection', handleSetCollectionEvent);\n window.removeEventListener('fast-simon-update-collection-url', handleSetCollectionURLEvent);\n window.removeEventListener('fast-simon-update-page', handleSetPageEvent);\n window.removeEventListener('fast-simon-update-sort', handleSetSortEvent);\n window.removeEventListener('fast-simon-update-narrow', handleSetNarrowEvent);\n window.removeEventListener('fast-simon-update-segments', handleSetSegmentsEvent);\n window.removeEventListener('fast-simon-update-flag', handleSetFlagEvent);\n window.removeEventListener('fast-simon-update-is-autocomplete', handleSetIsAutocomplete);\n }\n\n }, []);\n\n // Settings modal refetch: triggered after state is updated (no race conditions)\n // All settings (force_and, flags, custom_sort, user_segment_preview, personalization_preview)\n // are batched via updateSettingsAndRefetch to avoid double-fetches and stale-state reads.\n useEffect(() => {\n if (!state.refetchTrigger) return;\n // Build fetchParams from the now-updated state\n const fetchParams = {\n siteKey: siteKey,\n uuid: uuid,\n storeID: storeID,\n term: state.query,\n narrowBy: state.narrow,\n sortBy: state.sortBy ?? defaultSort,\n categoryID: state.collectionID,\n segments: state.segments,\n withProductAttributes: withProductAttributes,\n searchWithinSearch: state.searchWithinSearch,\n custom_sort_settings: state.custom_sort_settings,\n disable_merchandising: state.flag?.find((f: string) => f == \"disable_merchandising\") ? 1 : 0,\n disable_semantics: state.flag?.find((f: string) => f == \"disable_semantics\") ? 1 : 0,\n disable_turbolinks: state.flag?.find((f: string) => f == \"disable_turbolinks\") ? 1 : 0,\n disable_strategies: state.flag?.find((f: string) => f == \"disable_strategies\") ? 1 : 0,\n disable_merchandising_rules: state.flag?.find((f: string) => f == \"disable_merchandising_rules\") ? 1 : 0,\n disable_antonyms: state.flag?.find((f: string) => f == \"disable_antonyms\") ? 1 : 0,\n variation_id: state.variation_id,\n force_and: state.force_and,\n };\n fetchResults(fetchParams, isInfiniteScroll, state.isAutocomplete);\n }, [state.refetchTrigger]);\n\n const onSearch = (props: Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\n\n // Clear previous comparison data when starting new search\n setComparisonData(null);\n\n const currentQuery = props.term || '';\n const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();\n const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentQuery !== lastAnalyticsQuery || lastAnalyticsMode !== 'search'));\n\n // Check if hybrid search is enabled - we'll need to make a comparison call\n const isHybridEnabled = getLSVectorSearchOn();\n\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n // Increment staleness counter and clear pending analytics\n const requestId = ++searchRequestCounterRef.current;\n pendingAnalyticsRef.current = null;\n\n const commonRequestParams = {\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n };\n\n // Fire analytics request in parallel (fire-and-forget) — only if analytics needed\n if (shouldFetchAnalytics) {\n FullTextSearch.getReasoningFullTextSearch({\n ...commonRequestParams,\n with_product_analytics: true,\n facetRequired: 0,\n }).then(analyticsResponse => {\n if (searchRequestCounterRef.current !== requestId) return; // stale\n\n if (analyticsResponse.analytics?.badges) {\n setAnalyticsFetched(true);\n setLastAnalyticsQuery(currentQuery);\n setLastAnalyticsMode('search');\n }\n\n const productAnalyticsMap: Record<string, ProductAnalytics> = {};\n const items = (analyticsResponse as any).items || analyticsResponse.products || [];\n for (const product of items) {\n if (product.analytics) {\n productAnalyticsMap[String(product.id)] = product.analytics;\n }\n }\n\n const payload = {\n analytics: analyticsResponse.analytics,\n matching_sets: analyticsResponse.matching_sets,\n productAnalyticsMap\n };\n\n pendingAnalyticsRef.current = payload;\n dispatchMergeAnalytics(payload);\n }).catch(err => {\n console.error(\"[Analytics] Failed to fetch search analytics:\", err);\n });\n }\n\n // Fire fast request WITHOUT analytics\n FullTextSearch.getReasoningFullTextSearch({\n ...commonRequestParams,\n with_product_analytics: false,\n }).then(async(response) => {\n // Don't preserve stale analytics when fetching fresh ones\n const existingAnalytics = shouldFetchAnalytics ? undefined : (results as any)?.analytics;\n const existingMatchingSets = shouldFetchAnalytics ? undefined : (results as any)?.matching_sets;\n response=getFormatedData(response, existingAnalytics, existingMatchingSets);\n\n // Handle turbolink responses - skip additional API calls to prevent errors\n if (response.turbolink && response.totalResults === 0) {\n mergeResults(response, isInfiniteScroll);\n\n if (!customTitleChange) {\n document.title = `Search Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n setIsLoading({filters: false, products: false});\n return;\n }\n\n // Show products immediately\n mergeResults(response, isInfiniteScroll);\n setIsLoading({products: false, filters: true});\n\n // If analytics arrived before fast response, re-apply to new results\n if (pendingAnalyticsRef.current && searchRequestCounterRef.current === requestId) {\n dispatchMergeAnalytics(pendingAnalyticsRef.current);\n }\n\n // Fire IDs + facets in parallel (previously sequential)\n const listIdRequestProps = { ...props };\n listIdRequestProps.searchWithinSearch=undefined;\n listIdRequestProps.productsPerPage=1000000;\n listIdRequestProps.page=1;\n listIdRequestProps.market_context = marketContext;\n listIdRequestProps.variation_id = state.variation_id;\n listIdRequestProps.force_and = state.force_and;\n listIdRequestProps.ps = personalizationSegment;\n listIdRequestProps.spv = personalizationParams.spv;\n listIdRequestProps.personalization = personalizationParams.personalization;\n\n const facetsRequestProps = { ...props };\n facetsRequestProps.facetRequired=2;\n facetsRequestProps.searchWithinSearch=props.searchWithinSearch;\n facetsRequestProps.productsPerPage=props.productsPerPage;\n facetsRequestProps.page=props.page;\n facetsRequestProps.market_context = marketContext;\n facetsRequestProps.variation_id = state.variation_id;\n facetsRequestProps.force_and = state.force_and;\n facetsRequestProps.ps = personalizationSegment;\n facetsRequestProps.spv = personalizationParams.spv;\n facetsRequestProps.personalization = personalizationParams.personalization;\n\n const [listIdRes, facetsRes] = await Promise.all([\n FullTextSearch.getReasoningFullTextSearchProductsIds(listIdRequestProps),\n FullTextSearch.getReasoningFullTextSearch(facetsRequestProps)\n ]);\n\n // Merge IDs and complete facets into existing results\n mergeResultsKeepProduct({id_list: listIdRes.id_list, facets: facetsRes.facets} as any);\n\n if (!customTitleChange) {\n document.title = `Search Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n setIsLoading({filters: false, products: false});\n\n // Compare Mode: Make comparison call using IDs endpoint if hybrid search is enabled\n console.log(\"[Compare Mode] isHybridEnabled:\", isHybridEnabled, \"hasIdList:\", !!listIdRes.id_list);\n if (isHybridEnabled && listIdRes.id_list && listIdRes.id_list.length > 0) {\n setIsComparing(true);\n console.log(\"[Compare Mode] Making comparison IDs call...\");\n try {\n // Get all IDs WITHOUT hybrid_search_settings\n const comparisonResponse = await FullTextSearch.getComparisonProductIds({\n ...props,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n });\n\n const hybridOffIds = (comparisonResponse.id_list || []).map(id => id.toString());\n const hybridOnIds = (listIdRes.id_list || []).map(id => id.toString());\n console.log(\"[Compare Mode] Hybrid ON IDs count:\", hybridOnIds.length);\n console.log(\"[Compare Mode] Hybrid OFF IDs count:\", hybridOffIds.length);\n\n if (hybridOffIds.length > 0) {\n const diff = computeComparisonFromIds(hybridOnIds, hybridOffIds);\n console.log(\"[Compare Mode] Diff computed - improved:\", diff.totalImproved, \"declined:\", diff.totalDeclined, \"new:\", diff.totalNew);\n setComparisonData(diff);\n }\n } catch (error) {\n console.error(\"[Compare Mode] Failed to fetch comparison IDs:\", error);\n setComparisonData(null);\n } finally {\n setIsComparing(false);\n }\n }\n });\n }\n const onAutocompleteSearch = (props: Omit<autocompleteProps, \"callback\">) => {\n setIsLoading({products: true, filters: true});\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n Autocomplete.getAutocompleteReasoning({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext,\n variation_id: state.variation_id,\n force_and: state.force_and,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization\n }).then(async(response) => {\n response=getFormatedData(response);\n\n mergeResults(response, false);\n\n if (!customTitleChange) {\n document.title = `Autocomplete Result for ${query}`;\n } else {\n customTitleChange(results);\n }\n\n if (!response) {\n setIsLoading({\n filters: true, products: false\n });\n } else {\n setIsLoading({\n filters: false, products: false\n });\n }\n });\n }\n\n const onCollection = (props: Omit<smartCollectionsProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\n\n const currentCollection = props.categoryID || '';\n const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();\n const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentCollection !== lastAnalyticsCollection || lastAnalyticsMode !== 'collection'));\n\n const personalizationSegment = getPersonalizationSegment(userSegmentPreviewRef.current);\n const personalizationParams = buildPersonalizationParams(\n personalizationPreviewRef.current ?? {enabled: false, spvJson: '', types: ['gender']}\n );\n\n // Increment staleness counter and clear pending analytics\n const requestId = ++searchRequestCounterRef.current;\n pendingAnalyticsRef.current = null;\n\n const commonRequestParams = {\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext,\n variation_id: state.variation_id,\n ps: personalizationSegment,\n spv: personalizationParams.spv,\n personalization: personalizationParams.personalization,\n force_and: state.force_and\n };\n\n // Fire analytics request in parallel (fire-and-forget) — only if analytics needed\n if (shouldFetchAnalytics) {\n SmartCollections.getSmartCollections({\n ...commonRequestParams,\n with_product_analytics: true,\n facetRequired: 0,\n }).then(analyticsResponse => {\n if (searchRequestCounterRef.current !== requestId) return; // stale\n\n if (analyticsResponse.analytics?.badges) {\n setAnalyticsFetched(true);\n setLastAnalyticsCollection(currentCollection);\n setLastAnalyticsMode('collection');\n }\n\n const productAnalyticsMap: Record<string, ProductAnalytics> = {};\n const items = (analyticsResponse as any).items || analyticsResponse.products || [];\n for (const product of items) {\n if (product.analytics) {\n productAnalyticsMap[String(product.id)] = product.analytics;\n }\n }\n\n const payload = {\n analytics: analyticsResponse.analytics,\n matching_sets: analyticsResponse.matching_sets,\n productAnalyticsMap\n };\n\n pendingAnalyticsRef.current = payload;\n dispatchMergeAnalytics(payload);\n }).catch(err => {\n console.error(\"[Analytics] Failed to fetch collection analytics:\", err);\n });\n }\n\n // Fire fast request WITHOUT analytics\n SmartCollections.getSmartCollections({\n ...commonRequestParams,\n with_product_analytics: false,\n }).then(async (response) => {\n // Don't preserve stale analytics when fetching fresh ones\n const existingAnalytics = shouldFetchAnalytics ? undefined : (results as any)?.analytics;\n const existingMatchingSets = shouldFetchAnalytics ? undefined : (results as any)?.matching_sets;\n response=getFormatedData(response, existingAnalytics, existingMatchingSets);\n\n // Show products immediately\n mergeResults(response, isInfiniteScroll);\n setIsLoading({products: false, filters: true});\n\n // If analytics arrived before fast response, re-apply to new results\n if (pendingAnalyticsRef.current && searchRequestCounterRef.current === requestId) {\n dispatchMergeAnalytics(pendingAnalyticsRef.current);\n }\n\n // Fire IDs + facets in parallel (previously sequential)\n const listIdRequestProps = { ...props };\n listIdRequestProps.searchWithinSearch=undefined;\n listIdRequestProps.productsPerPage=1000000;\n listIdRequestProps.page=1;\n listIdRequestProps.market_context = marketContext;\n listIdRequestProps.variation_id = state.variation_id;\n listIdRequestProps.force_and = state.force_and;\n listIdRequestProps.ps = personalizationSegment;\n listIdRequestProps.spv = personalizationParams.spv;\n listIdRequestProps.personalization = personalizationParams.personalization;\n\n const facetsRequestProps = { ...props };\n facetsRequestProps.facetRequired=2;\n facetsRequestProps.searchWithinSearch=props.searchWithinSearch;\n facetsRequestProps.productsPerPage=props.productsPerPage;\n facetsRequestProps.page=props.page;\n facetsRequestProps.market_context = marketContext;\n facetsRequestProps.variation_id = state.variation_id;\n facetsRequestProps.force_and = state.force_and;\n facetsRequestProps.ps = personalizationSegment;\n facetsRequestProps.spv = personalizationParams.spv;\n facetsRequestProps.personalization = personalizationParams.personalization;\n\n const [listIdRes, facetsRes] = await Promise.all([\n SmartCollections.getSmartCollectionsProductsIds(listIdRequestProps),\n SmartCollections.getSmartCollections(facetsRequestProps)\n ]);\n\n // Merge IDs and complete facets into existing results\n mergeResultsKeepProduct({id_list: listIdRes.id_list, facets: facetsRes.facets} as any);\n\n setIsLoading({filters: false, products: false});\n\n getAllCategories().then(r => {\n if (!customTitleChange) {\n document.title = r.find(c => c.id === props.categoryID)?.l ?? \"Collection\";\n } else {\n customTitleChange(results);\n }\n });\n });\n }\n\n // Memoize to prevent unnecessary recreation\n const getAllCategories = useCallback(async () => {\n if (categories.length > 0) {\n return new Promise<FastCategory[]>(resolve => resolve(categories))\n }\n\n const data = categories || [];\n\n setCategories(data)\n\n return data;\n }, [categories]);\n\n const getFormatedData = (response: any, existingAnalytics?: any, existingMatchingSets?: any) => {\n const results = response;\n\n results.products = response.items;\n delete results.items;\n results.totalResults = response.total_results;\n delete results.total_results;\n if (response.sort_by) {\n results.sortBy = response.sort_by;\n delete results.sort_by;\n }\n\n if (response.pop_products_no_results) {\n results.isNoResults = true;\n }\n\n if (response.total_p) {\n results.pageCount = response.total_p;\n delete results.total_p;\n }\n\n\n if (response.ancestor_categories) {\n results.ancestors = response.ancestor_categories;\n delete results.ancestor_categories;\n }\n\n if (response.avoid_tag_prefixes) {\n results.avoidPrefixList = response.avoid_tag_prefixes.split(\",\");\n }\n\n\n results.page = response.p || 1;\n delete results.p;\n\n // Preserve analytics field if present (contains winners/overexposed data)\n // If response has new analytics, use it; otherwise keep existing analytics\n if (response.analytics) {\n results.analytics = response.analytics;\n } else if (existingAnalytics) {\n results.analytics = existingAnalytics;\n }\n\n // Preserve matching_sets field if present (product ID -> set name)\n // If response has new matching_sets, use it; otherwise keep existing\n if (response.matching_sets) {\n results.matching_sets = response.matching_sets;\n } else if (existingMatchingSets) {\n results.matching_sets = existingMatchingSets;\n }\n\n return results;\n };\n\n\n // Memoize state context to prevent unnecessary re-renders\n const stateContextValue = useMemo(() => ({\n narrow,\n results,\n page,\n query,\n sortBy,\n type,\n collectionID,\n isLoading,\n recommendations,\n singleProducts,\n isReady,\n autocomplete,\n isAutocomplete,\n variation_id: state.variation_id,\n force_and: state.force_and,\n comparisonData: state.comparisonData,\n isComparing: state.isComparing\n }), [narrow, results, page, query, sortBy, type, collectionID, isLoading, recommendations, singleProducts, isReady, autocomplete, isAutocomplete, state.variation_id, state.force_and, state.comparisonData, state.isComparing]);\n\n // Memoize theme to prevent unnecessary object creation\n const mergedTheme = useMemo(() => ({...mainTheme, ...theme}), [theme]);\n\n // @ts-ignore\n return (\n <FastStateFunctions.Provider\n value={{\n setQuery,\n setSort: setSortBy,\n setNarrow,\n setPage,\n getAllCategories,\n setCollection: setCollectionID,\n setState,\n setSearchWithinSearch,\n setSegments,\n setFlag,\n setCustomSort,\n setIsAutocomplete,\n setVariationId,\n setForceAnd,\n setUserSegmentPreview,\n setPersonalizationPreview,\n updateSettingsAndRefetch\n }}>\n <FastState.Provider value={stateContextValue}>\n <ThemeProvider theme={mergedTheme}>\n {children}\n </ThemeProvider>\n </FastState.Provider>\n </FastStateFunctions.Provider>\n )\n};\n\n// Memoize component to prevent unnecessary re-renders when parent updates\nexport default React.memo(FastSimonApi);"]}
|
|
@@ -5,7 +5,7 @@ import { SortBy } from "../../@types/sortBy";
|
|
|
5
5
|
import { FullTextServerResponseAll } from "../../@types/results";
|
|
6
6
|
import { smartCollectionsResults } from "../../@types/categories";
|
|
7
7
|
import { Narrow, ServerNarrow } from "../../@types/narrow";
|
|
8
|
-
import { Product } from "../../@types/product";
|
|
8
|
+
import { Product, ProductAnalytics } from "../../@types/product";
|
|
9
9
|
import { Widget } from "../../@types/widget";
|
|
10
10
|
import { AutocompleteReasoningResponse, AutocompleteResults } from "../../@types/autocomplete";
|
|
11
11
|
type FastStateAction = {
|
|
@@ -97,6 +97,13 @@ type FastStateAction = {
|
|
|
97
97
|
} | {
|
|
98
98
|
type: 'setPersonalizationPreview';
|
|
99
99
|
payload: PersonalizationPreviewSettings | null;
|
|
100
|
+
} | {
|
|
101
|
+
type: 'mergeAnalyticsData';
|
|
102
|
+
payload: {
|
|
103
|
+
analytics?: FullTextServerResponseAll['analytics'];
|
|
104
|
+
matching_sets?: Record<string, string>;
|
|
105
|
+
productAnalyticsMap?: Record<string, ProductAnalytics>;
|
|
106
|
+
};
|
|
100
107
|
} | {
|
|
101
108
|
type: 'updateSettingsAndRefetch';
|
|
102
109
|
payload: Partial<Pick<FastStateProps, 'force_and' | 'custom_sort_settings' | 'flag' | 'user_segment_preview' | 'personalization_preview'>>;
|
|
@@ -86,6 +86,28 @@ export function fastStateReducer(state, action) {
|
|
|
86
86
|
return Object.assign(Object.assign({}, state), { isComparing: action.payload });
|
|
87
87
|
case 'setPersonalizationPreview':
|
|
88
88
|
return Object.assign(Object.assign({}, state), { personalization_preview: action.payload });
|
|
89
|
+
case 'mergeAnalyticsData': {
|
|
90
|
+
if (!state.results || !state.results.products)
|
|
91
|
+
return state;
|
|
92
|
+
const updatedResults = Object.assign({}, state.results);
|
|
93
|
+
if (action.payload.analytics) {
|
|
94
|
+
updatedResults.analytics = action.payload.analytics;
|
|
95
|
+
}
|
|
96
|
+
if (action.payload.matching_sets) {
|
|
97
|
+
updatedResults.matching_sets = action.payload.matching_sets;
|
|
98
|
+
}
|
|
99
|
+
if (action.payload.productAnalyticsMap) {
|
|
100
|
+
updatedResults.products = updatedResults.products.map(product => {
|
|
101
|
+
var _a;
|
|
102
|
+
const productAnalytics = (_a = action.payload.productAnalyticsMap) === null || _a === void 0 ? void 0 : _a[String(product.id)];
|
|
103
|
+
if (productAnalytics) {
|
|
104
|
+
return Object.assign(Object.assign({}, product), { analytics: productAnalytics });
|
|
105
|
+
}
|
|
106
|
+
return product;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return Object.assign(Object.assign({}, state), { results: updatedResults });
|
|
110
|
+
}
|
|
89
111
|
case 'updateSettingsAndRefetch':
|
|
90
112
|
return Object.assign(Object.assign(Object.assign({}, state), action.payload), { refetchTrigger: ((_g = state.refetchTrigger) !== null && _g !== void 0 ? _g : 0) + 1 });
|
|
91
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/reducer.ts"],"names":[],"mappings":"AA4CA,MAAM,UAAU,gBAAgB,CAAC,KAAqB,EAAE,MAAuB;;IAC3E,QAAQ,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,UAAU;YACX,uCAAW,KAAK,KAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAC;QAE9C,KAAK,SAAS;YACV,uCAAW,KAAK,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5C,KAAK,SAAS;YACV,uCAAW,KAAK,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5C,KAAK,UAAU;YACX,uCAAW,KAAK,KAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,YAAY,EA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IAAE;QAEpD,KAAK,aAAa;YACd,uCAAW,KAAK,KAAE,SAAS,EAAE,MAAM,CAAC,OAAO,IAAE;QAEjD,KAAK,uBAAuB;YACxB,uCAAW,KAAK,KAAE,oBAAoB,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5D,KAAK,mBAAmB;YACpB,uCAAW,KAAK,KAAE,cAAc,EAAE,MAAM,CAAC,OAAO,IAAE;QAEtD,KAAK,gBAAgB;YACjB,uCAAW,KAAK,KAAE,WAAW,EAAE,MAAM,CAAC,OAAO,IAAE;QAEnD,KAAK,2BAA2B;YAC5B,uCAAW,KAAK,KAAE,uBAAuB,EAAE,MAAM,CAAC,OAAO,IAAE;QAE/D,KAAK,0BAA0B;YAC3B,qDAAW,KAAK,GAAK,MAAM,CAAC,OAAO,KAAE,cAAc,EAAE,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAE;KAE7F;AACL,CAAC","sourcesContent":["import {ComparisonData, CustomSortSettings, FastStateProps, IsLoading} from \"./context\";\nimport {PersonalizationPreviewSettings} from \"../../utils/personalizationPreview\";\nimport {AppType} from \"./FastSimonApi\";\nimport {SortBy} from \"../../@types/sortBy\";\nimport {FullTextServerResponseAll} from \"../../@types/results\";\nimport {smartCollectionsResults} from \"../../@types/categories\";\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\nimport {Product} from \"../../@types/product\";\n\nimport {Widget} from \"../../@types/widget\";\nimport {AutocompleteReasoningResponse, AutocompleteResults} from \"../../@types/autocomplete\";\n\ntype FastStateAction =\n | { type: 'setReady', payload: boolean }\n | { type: 'setType', payload: AppType }\n | { type: 'setPage', payload: number }\n | { type: 'setQuery', payload: string }\n | { type: 'setSortBy', payload: SortBy }\n | { type: 'setIsLoading', payload: IsLoading }\n | { type: 'setCollectionID', payload: string }\n | { type: 'setNarrow', payload: ServerNarrow[] | undefined }\n | { type: 'setResults', payload: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse | undefined }\n | { type: 'mergeResults', payload: { results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse, infiniteScroll: boolean } }\n | { type: 'mergeFacetsWithResults', payload:Narrow[] }\n | { type: 'mergeResultsKeepProduct', payload: { results: FullTextServerResponseAll | smartCollectionsResults } }\n | { type: 'setState', payload: Partial<FastStateProps> }\n | { type: 'setRecommendations', payload: { id: string, widget: Widget } }\n | { type: 'setSingleProducts', payload: Product[] }\n | { type: 'setIsAutocomplete', payload: boolean }\n | { type: 'setAutocomplete', payload: AutocompleteResults }\n | { type: 'setSearchWithinSearch', payload: string }\n | { type: 'setSegments', payload: string[] }\n | { type: 'setFlag', payload: string[] }\n | { type: 'setCustomSort',payload:CustomSortSettings}\n | { type: 'setVariationId', payload: string | null }\n | { type: 'setForceAnd', payload: boolean }\n | { type: 'setUserSegmentPreview', payload: 'none' | 'new' | 'returning' }\n | { type: 'setComparisonData', payload: ComparisonData | null }\n | { type: 'setIsComparing', payload: boolean }\n | { type: 'setPersonalizationPreview', payload: PersonalizationPreviewSettings | null }\n | { type: 'updateSettingsAndRefetch', payload: Partial<Pick<FastStateProps, 'force_and' | 'custom_sort_settings' | 'flag' | 'user_segment_preview' | 'personalization_preview'>> }\n\n\n\nexport function fastStateReducer(state: FastStateProps, action: FastStateAction) {\n switch (action.type) {\n case \"setReady\":\n return {...state, isReady: action.payload}\n\n case 'setType':\n return {...state, type: action.payload};\n\n case 'setPage':\n return {...state, page: action.payload};\n\n case 'setQuery':\n return {...state, query: action.payload, collectionID: undefined, page: 1, narrow: undefined, searchWithinSearch: undefined, sortBy:undefined};\n\n case 'setSortBy':\n return {...state, sortBy: action.payload, page: 1};\n\n case 'setSegments':\n return {...state, segments: action.payload, page: 1};\n\n case 'setIsLoading':\n return {...state, isLoading: action.payload};\n\n case 'setCollectionID':\n return {...state, collectionID: action.payload, query: \"\", page: 1, narrow: undefined, searchWithinSearch: undefined , sortBy:undefined};\n\n case 'setNarrow':\n return {...state, narrow: action.payload, page: 1};\n\n case 'setResults':\n return {...state, results: {isNoResults: false, ...action.payload}} as FastStateProps;\n\n case 'mergeResultsKeepProduct': {\n return {...state, results: {...state.results, ...action.payload.results, products: state.results?.products || []}};\n }\n\n case 'mergeFacetsWithResults':{\n return {...state, narrow: action.payload};\n }\n\n case 'mergeResults': {\n const sortBy = action.payload.results?.sortBy ?? state.sortBy\n\n if (!action.payload.infiniteScroll) {\n return {...state,sortBy, results: { ...action.payload.results}} as FastStateProps;\n }\n\n const products = state.results?.products ?? [];\n const newProducts = action.payload.results.products ?? [];\n\n // Optimize: Use Set for O(1) lookup instead of O(n) find() - prevents O(n²)\n const existingIds = new Set(products.map(p => p.id));\n const uniqueNewProducts = newProducts.filter(p => !existingIds.has(p.id));\n\n // Only merge if there are actually new products\n if (uniqueNewProducts.length > 0) {\n return {\n ...state,\n results: {...state.results, isNoResults: false, ...action.payload.results, products: [...products, ...uniqueNewProducts]}\n } as FastStateProps;\n }\n\n return {\n ...state,\n results: {...state.results, isNoResults: false, ...action.payload.results, products: products}\n } as FastStateProps;\n\n }\n\n case 'setState': {\n if (action.payload.query) {\n return {...state, ...action.payload, collectionID: undefined, searchWithinSearch: undefined, segments: undefined}\n } else {\n return {...state, ...action.payload, query: \"\", searchWithinSearch: undefined, segments: undefined};\n }\n }\n\n case \"setRecommendations\": {\n return {\n ...state,\n recommendations: {\n ...state.recommendations,\n [action.payload.id]: action.payload.widget\n }\n }\n }\n\n case \"setSingleProducts\": {\n const products: { [id: string]: Product } = {...state.singleProducts};\n\n for (const product of action.payload) {\n products[product.id] = product;\n }\n\n return {...state, singleProducts: products}\n }\n case \"setIsAutocomplete\":{\n return {...state, isAutocomplete: action.payload}\n }\n\n case \"setAutocomplete\": {\n return {...state, autocomplete: action.payload}\n }\n\n case \"setSearchWithinSearch\": {\n return {...state, searchWithinSearch: action.payload}\n }\n case 'setFlag':\n return {...state, flag: action.payload};\n\n case 'setCustomSort':\n return {...state, custom_sort_settings: action.payload};\n\n case 'setVariationId':\n return {...state, variation_id: action.payload};\n\n case 'setForceAnd':\n return {...state, force_and: action.payload};\n\n case 'setUserSegmentPreview':\n return {...state, user_segment_preview: action.payload};\n\n case 'setComparisonData':\n return {...state, comparisonData: action.payload};\n\n case 'setIsComparing':\n return {...state, isComparing: action.payload};\n\n case 'setPersonalizationPreview':\n return {...state, personalization_preview: action.payload};\n\n case 'updateSettingsAndRefetch':\n return {...state, ...action.payload, refetchTrigger: (state.refetchTrigger ?? 0) + 1};\n\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/reducer.ts"],"names":[],"mappings":"AAiDA,MAAM,UAAU,gBAAgB,CAAC,KAAqB,EAAE,MAAuB;;IAC3E,QAAQ,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,UAAU;YACX,uCAAW,KAAK,KAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAC;QAE9C,KAAK,SAAS;YACV,uCAAW,KAAK,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5C,KAAK,SAAS;YACV,uCAAW,KAAK,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5C,KAAK,UAAU;YACX,uCAAW,KAAK,KAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAC,SAAS,IAAE;QAEnJ,KAAK,WAAW;YACZ,uCAAW,KAAK,KAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,IAAE;QAEvD,KAAK,aAAa;YACd,uCAAW,KAAK,KAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,IAAE;QAEzD,KAAK,cAAc;YACf,uCAAW,KAAK,KAAE,SAAS,EAAE,MAAM,CAAC,OAAO,IAAE;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,CAAC,OAAO,IAAE;QAE/D,KAAK,oBAAoB,CAAC,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ;gBAAE,OAAO,KAAK,CAAC;YAE5D,MAAM,cAAc,qBAAQ,KAAK,CAAC,OAAO,CAAE,CAAC;YAE5C,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE;gBACzB,cAAsB,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;aAChE;YAED,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE;gBAC7B,cAAsB,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;aACxE;YAED,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE;gBACpC,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;;oBAC5D,MAAM,gBAAgB,GAAG,MAAA,MAAM,CAAC,OAAO,CAAC,mBAAmB,0CAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;oBAClF,IAAI,gBAAgB,EAAE;wBAClB,uCAAY,OAAO,KAAE,SAAS,EAAE,gBAAgB,IAAG;qBACtD;oBACD,OAAO,OAAO,CAAC;gBACnB,CAAC,CAAC,CAAC;aACN;YAED,OAAO,gCAAK,KAAK,KAAE,OAAO,EAAE,cAAc,GAAoB,CAAC;SAClE;QAED,KAAK,0BAA0B;YAC3B,qDAAW,KAAK,GAAK,MAAM,CAAC,OAAO,KAAE,cAAc,EAAE,CAAC,MAAA,KAAK,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAE;KAE7F;AACL,CAAC","sourcesContent":["import {ComparisonData, CustomSortSettings, FastStateProps, IsLoading} from \"./context\";\nimport {PersonalizationPreviewSettings} from \"../../utils/personalizationPreview\";\nimport {AppType} from \"./FastSimonApi\";\nimport {SortBy} from \"../../@types/sortBy\";\nimport {FullTextServerResponseAll} from \"../../@types/results\";\nimport {smartCollectionsResults} from \"../../@types/categories\";\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\nimport {Product, ProductAnalytics} from \"../../@types/product\";\n\nimport {Widget} from \"../../@types/widget\";\nimport {AutocompleteReasoningResponse, AutocompleteResults} from \"../../@types/autocomplete\";\n\ntype FastStateAction =\n | { type: 'setReady', payload: boolean }\n | { type: 'setType', payload: AppType }\n | { type: 'setPage', payload: number }\n | { type: 'setQuery', payload: string }\n | { type: 'setSortBy', payload: SortBy }\n | { type: 'setIsLoading', payload: IsLoading }\n | { type: 'setCollectionID', payload: string }\n | { type: 'setNarrow', payload: ServerNarrow[] | undefined }\n | { type: 'setResults', payload: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse | undefined }\n | { type: 'mergeResults', payload: { results: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse, infiniteScroll: boolean } }\n | { type: 'mergeFacetsWithResults', payload:Narrow[] }\n | { type: 'mergeResultsKeepProduct', payload: { results: FullTextServerResponseAll | smartCollectionsResults } }\n | { type: 'setState', payload: Partial<FastStateProps> }\n | { type: 'setRecommendations', payload: { id: string, widget: Widget } }\n | { type: 'setSingleProducts', payload: Product[] }\n | { type: 'setIsAutocomplete', payload: boolean }\n | { type: 'setAutocomplete', payload: AutocompleteResults }\n | { type: 'setSearchWithinSearch', payload: string }\n | { type: 'setSegments', payload: string[] }\n | { type: 'setFlag', payload: string[] }\n | { type: 'setCustomSort',payload:CustomSortSettings}\n | { type: 'setVariationId', payload: string | null }\n | { type: 'setForceAnd', payload: boolean }\n | { type: 'setUserSegmentPreview', payload: 'none' | 'new' | 'returning' }\n | { type: 'setComparisonData', payload: ComparisonData | null }\n | { type: 'setIsComparing', payload: boolean }\n | { type: 'setPersonalizationPreview', payload: PersonalizationPreviewSettings | null }\n | { type: 'mergeAnalyticsData', payload: {\n analytics?: FullTextServerResponseAll['analytics'],\n matching_sets?: Record<string, string>,\n productAnalyticsMap?: Record<string, ProductAnalytics>\n }}\n | { type: 'updateSettingsAndRefetch', payload: Partial<Pick<FastStateProps, 'force_and' | 'custom_sort_settings' | 'flag' | 'user_segment_preview' | 'personalization_preview'>> }\n\n\n\nexport function fastStateReducer(state: FastStateProps, action: FastStateAction) {\n switch (action.type) {\n case \"setReady\":\n return {...state, isReady: action.payload}\n\n case 'setType':\n return {...state, type: action.payload};\n\n case 'setPage':\n return {...state, page: action.payload};\n\n case 'setQuery':\n return {...state, query: action.payload, collectionID: undefined, page: 1, narrow: undefined, searchWithinSearch: undefined, sortBy:undefined};\n\n case 'setSortBy':\n return {...state, sortBy: action.payload, page: 1};\n\n case 'setSegments':\n return {...state, segments: action.payload, page: 1};\n\n case 'setIsLoading':\n return {...state, isLoading: action.payload};\n\n case 'setCollectionID':\n return {...state, collectionID: action.payload, query: \"\", page: 1, narrow: undefined, searchWithinSearch: undefined , sortBy:undefined};\n\n case 'setNarrow':\n return {...state, narrow: action.payload, page: 1};\n\n case 'setResults':\n return {...state, results: {isNoResults: false, ...action.payload}} as FastStateProps;\n\n case 'mergeResultsKeepProduct': {\n return {...state, results: {...state.results, ...action.payload.results, products: state.results?.products || []}};\n }\n\n case 'mergeFacetsWithResults':{\n return {...state, narrow: action.payload};\n }\n\n case 'mergeResults': {\n const sortBy = action.payload.results?.sortBy ?? state.sortBy\n\n if (!action.payload.infiniteScroll) {\n return {...state,sortBy, results: { ...action.payload.results}} as FastStateProps;\n }\n\n const products = state.results?.products ?? [];\n const newProducts = action.payload.results.products ?? [];\n\n // Optimize: Use Set for O(1) lookup instead of O(n) find() - prevents O(n²)\n const existingIds = new Set(products.map(p => p.id));\n const uniqueNewProducts = newProducts.filter(p => !existingIds.has(p.id));\n\n // Only merge if there are actually new products\n if (uniqueNewProducts.length > 0) {\n return {\n ...state,\n results: {...state.results, isNoResults: false, ...action.payload.results, products: [...products, ...uniqueNewProducts]}\n } as FastStateProps;\n }\n\n return {\n ...state,\n results: {...state.results, isNoResults: false, ...action.payload.results, products: products}\n } as FastStateProps;\n\n }\n\n case 'setState': {\n if (action.payload.query) {\n return {...state, ...action.payload, collectionID: undefined, searchWithinSearch: undefined, segments: undefined}\n } else {\n return {...state, ...action.payload, query: \"\", searchWithinSearch: undefined, segments: undefined};\n }\n }\n\n case \"setRecommendations\": {\n return {\n ...state,\n recommendations: {\n ...state.recommendations,\n [action.payload.id]: action.payload.widget\n }\n }\n }\n\n case \"setSingleProducts\": {\n const products: { [id: string]: Product } = {...state.singleProducts};\n\n for (const product of action.payload) {\n products[product.id] = product;\n }\n\n return {...state, singleProducts: products}\n }\n case \"setIsAutocomplete\":{\n return {...state, isAutocomplete: action.payload}\n }\n\n case \"setAutocomplete\": {\n return {...state, autocomplete: action.payload}\n }\n\n case \"setSearchWithinSearch\": {\n return {...state, searchWithinSearch: action.payload}\n }\n case 'setFlag':\n return {...state, flag: action.payload};\n\n case 'setCustomSort':\n return {...state, custom_sort_settings: action.payload};\n\n case 'setVariationId':\n return {...state, variation_id: action.payload};\n\n case 'setForceAnd':\n return {...state, force_and: action.payload};\n\n case 'setUserSegmentPreview':\n return {...state, user_segment_preview: action.payload};\n\n case 'setComparisonData':\n return {...state, comparisonData: action.payload};\n\n case 'setIsComparing':\n return {...state, isComparing: action.payload};\n\n case 'setPersonalizationPreview':\n return {...state, personalization_preview: action.payload};\n\n case 'mergeAnalyticsData': {\n if (!state.results || !state.results.products) return state;\n\n const updatedResults = { ...state.results };\n\n if (action.payload.analytics) {\n (updatedResults as any).analytics = action.payload.analytics;\n }\n\n if (action.payload.matching_sets) {\n (updatedResults as any).matching_sets = action.payload.matching_sets;\n }\n\n if (action.payload.productAnalyticsMap) {\n updatedResults.products = updatedResults.products.map(product => {\n const productAnalytics = action.payload.productAnalyticsMap?.[String(product.id)];\n if (productAnalytics) {\n return { ...product, analytics: productAnalytics };\n }\n return product;\n });\n }\n\n return { ...state, results: updatedResults } as FastStateProps;\n }\n\n case 'updateSettingsAndRefetch':\n return {...state, ...action.payload, refetchTrigger: (state.refetchTrigger ?? 0) + 1};\n\n }\n}\n\n"]}
|