@fast-simon/dashboard-utilities 1.0.116 → 1.0.119
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/@types/autocomplete.d.ts +1 -0
- package/dist/@types/autocomplete.js.map +1 -1
- package/dist/@types/categories.d.ts +1 -0
- package/dist/@types/categories.js.map +1 -1
- package/dist/@types/results.d.ts +1 -0
- package/dist/@types/results.js.map +1 -1
- package/dist/components/FastSimonApi/FastSimonApi.d.ts +1 -0
- package/dist/components/FastSimonApi/FastSimonApi.js +26 -7
- package/dist/components/FastSimonApi/FastSimonApi.js.map +1 -1
- package/dist/components/FastSimonApi/context.d.ts +2 -0
- package/dist/components/FastSimonApi/context.js.map +1 -1
- package/dist/components/FastSimonApi/reducer.d.ts +5 -0
- package/dist/components/FastSimonApi/reducer.js +2 -0
- package/dist/components/FastSimonApi/reducer.js.map +1 -1
- package/dist/services/autocomplete.d.ts +1 -1
- package/dist/services/autocomplete.js +2 -2
- package/dist/services/autocomplete.js.map +1 -1
- package/dist/services/landingPage.js +3 -1
- package/dist/services/landingPage.js.map +1 -1
- package/dist/services/search.d.ts +2 -2
- package/dist/services/search.js +4 -4
- package/dist/services/search.js.map +1 -1
- package/dist/services/smartCollections.d.ts +2 -2
- package/dist/services/smartCollections.js +4 -4
- package/dist/services/smartCollections.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/@types/autocomplete.ts"],"names":[],"mappings":"","sourcesContent":["import {ServerProduct} from \"./product\";\nimport {Facet, FastCategory, FastTurbolinks} from \"./facets\";\nimport {PopularSearch, ContextFilteringData, QueryUnderstanding} from \"./results\";\nimport {SortBy} from \"./sortBy\";\n\n\n\nexport interface AutocompleteResults {\n totalResults: number,\n categories?: FastCategory[],\n products: ServerProduct[]\n turbolinks?: FastTurbolinks[]\n popularSearches: PopularSearch[]\n query: string\n}\n\nexport interface autocompleteProps {\n storeID: number\n uuid: string\n siteKey?:string\n cdn?: number\n term: string,\n userToken: string,\n sessionStart: number,\n withAttributes?: boolean\n segments?: string[],\n hasShopifyMarkets?: boolean,\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n}\nexport interface AutocompleteReasoningResponse {\n auto_facets?: boolean\n isp_quick_view_mode?: number\n products: ServerProduct[]\n merch: {\n prorduct:any,\n rules:any,\n strategy:any,\n visual:any\n }\n personalized_products:any[]\n term:string\n totalResults: number\n uuid:string\n\n //all bellow wont be never field but to keep consistent with all the AIExplainer implementation\n sortBy?:SortBy\n within_search_results_for?: string,\n isNoResults?:any,\n pageCount?:number,\n narrow?: [string, string, string][],\n facets?: Facet[],\n page?: number,\n results_for?: string,\n id_list?:number[]\n turbolink?: string\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n}"]}
|
|
1
|
+
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/@types/autocomplete.ts"],"names":[],"mappings":"","sourcesContent":["import {ServerProduct} from \"./product\";\nimport {Facet, FastCategory, FastTurbolinks} from \"./facets\";\nimport {PopularSearch, ContextFilteringData, QueryUnderstanding} from \"./results\";\nimport {SortBy} from \"./sortBy\";\n\n\n\nexport interface AutocompleteResults {\n totalResults: number,\n categories?: FastCategory[],\n products: ServerProduct[]\n turbolinks?: FastTurbolinks[]\n popularSearches: PopularSearch[]\n query: string\n}\n\nexport interface autocompleteProps {\n storeID: number\n uuid: string\n siteKey?:string\n cdn?: number\n term: string,\n userToken: string,\n sessionStart: number,\n withAttributes?: boolean\n segments?: string[],\n hasShopifyMarkets?: boolean,\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n variation_id?: string | null // A/B test variation ID for reasoning/experiment tracking\n}\nexport interface AutocompleteReasoningResponse {\n auto_facets?: boolean\n isp_quick_view_mode?: number\n products: ServerProduct[]\n merch: {\n prorduct:any,\n rules:any,\n strategy:any,\n visual:any\n }\n personalized_products:any[]\n term:string\n totalResults: number\n uuid:string\n\n //all bellow wont be never field but to keep consistent with all the AIExplainer implementation\n sortBy?:SortBy\n within_search_results_for?: string,\n isNoResults?:any,\n pageCount?:number,\n narrow?: [string, string, string][],\n facets?: Facet[],\n page?: number,\n results_for?: string,\n id_list?:number[]\n turbolink?: string\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/@types/categories.ts"],"names":[],"mappings":"","sourcesContent":["import {SortBy} from \"./sortBy\";\nimport {Narrow, ServerNarrow} from \"./narrow\";\nimport { ServerProduct} from \"./product\";\nimport {ServerFacet} from \"./facets\";\nimport {ContextFilteringData, QueryUnderstanding} from \"./results\";\n\n\nexport type AncestorCategory = [string, string, string] // category_id, category_name, category_url\nexport interface RelatedCategory {\n id: string\n l: string\n t: string\n u: string\n}\nexport type CategoryAncestor = [string, string, string]\nexport interface Category {\n d: string\n id: string\n l: string\n p_id: string\n t: string\n u: string\n parent_name?: string\n}\nexport interface FastCategory {\n d: string\n id: string\n l: string\n p_id: string\n t: string\n u: string\n parent_name?: string\n}\nexport interface smartCollectionsProps {\n storeID: number\n uuid: string\n siteKey?:string\n cdn: number\n categoryID: string,\n userToken: string,\n sessionStart: number,\n page?: number\n productsPerPage?: number\n sortBy?: SortBy\n narrowBy?: ServerNarrow[]\n facetRequired?: FacetRequired\n withAttributes?: boolean\n recent?: string\n rec?: boolean\n searchWithinSearch?: string,\n segments?: string[],\n hasShopifyMarkets?: boolean,\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\n with_product_analytics?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n}\nexport type FacetRequired = 0 | 1 | 2\nexport type smartCollectionsCallback = ({}: {\n action: \"products\" | \"facets and products\"\n payload: smartCollectionsResults\n}) => void\nexport interface smartCollectionsResults {\n ancestors: CategoryAncestor[]\n categoryID: string\n name: string\n category_name: string\n products: ServerProduct[]\n facets?: ServerFacet[]\n totalResults: number\n sortBy?: SortBy,\n narrow?: Narrow[],\n isNoResults?: boolean\n page?: number\n pageCount?: number\n avoidPrefixList?: string[]\n merch?: any\n bannerHTML?: string\n turbolink?:string\n hiddenProducts?:ServerProduct[]\n within_search_results_for?:string\n results_for?: string\n id_list?:number[]\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n analytics?: {\n badges?: {\n winners?: Record<string, string> // Product ID -> tooltip message\n overexposed?: Record<string, string> // Product ID -> tooltip message\n new_arrivals?: string[]\n }\n key_hidden_winners?: string\n key_overexposed?: string\n }\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n\n}\nexport type inventoryCallback = ({}: {\n action: \"products inventory\"\n payload: {productsInventory: productsInventoryResults[]}\n}) => void\nexport interface productsInventoryResults {\n id: string;\n totalInventory: number;\n}"]}
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/@types/categories.ts"],"names":[],"mappings":"","sourcesContent":["import {SortBy} from \"./sortBy\";\nimport {Narrow, ServerNarrow} from \"./narrow\";\nimport { ServerProduct} from \"./product\";\nimport {ServerFacet} from \"./facets\";\nimport {ContextFilteringData, QueryUnderstanding} from \"./results\";\n\n\nexport type AncestorCategory = [string, string, string] // category_id, category_name, category_url\nexport interface RelatedCategory {\n id: string\n l: string\n t: string\n u: string\n}\nexport type CategoryAncestor = [string, string, string]\nexport interface Category {\n d: string\n id: string\n l: string\n p_id: string\n t: string\n u: string\n parent_name?: string\n}\nexport interface FastCategory {\n d: string\n id: string\n l: string\n p_id: string\n t: string\n u: string\n parent_name?: string\n}\nexport interface smartCollectionsProps {\n storeID: number\n uuid: string\n siteKey?:string\n cdn: number\n categoryID: string,\n userToken: string,\n sessionStart: number,\n page?: number\n productsPerPage?: number\n sortBy?: SortBy\n narrowBy?: ServerNarrow[]\n facetRequired?: FacetRequired\n withAttributes?: boolean\n recent?: string\n rec?: boolean\n searchWithinSearch?: string,\n segments?: string[],\n hasShopifyMarkets?: boolean,\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\n with_product_analytics?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n variation_id?: string | null // A/B test variation ID for reasoning/experiment tracking\n}\nexport type FacetRequired = 0 | 1 | 2\nexport type smartCollectionsCallback = ({}: {\n action: \"products\" | \"facets and products\"\n payload: smartCollectionsResults\n}) => void\nexport interface smartCollectionsResults {\n ancestors: CategoryAncestor[]\n categoryID: string\n name: string\n category_name: string\n products: ServerProduct[]\n facets?: ServerFacet[]\n totalResults: number\n sortBy?: SortBy,\n narrow?: Narrow[],\n isNoResults?: boolean\n page?: number\n pageCount?: number\n avoidPrefixList?: string[]\n merch?: any\n bannerHTML?: string\n turbolink?:string\n hiddenProducts?:ServerProduct[]\n within_search_results_for?:string\n results_for?: string\n id_list?:number[]\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n analytics?: {\n badges?: {\n winners?: Record<string, string> // Product ID -> tooltip message\n overexposed?: Record<string, string> // Product ID -> tooltip message\n new_arrivals?: string[]\n }\n key_hidden_winners?: string\n key_overexposed?: string\n }\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n\n}\nexport type inventoryCallback = ({}: {\n action: \"products inventory\"\n payload: {productsInventory: productsInventoryResults[]}\n}) => void\nexport interface productsInventoryResults {\n id: string;\n totalInventory: number;\n}"]}
|
package/dist/@types/results.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../src/@types/results.ts"],"names":[],"mappings":"","sourcesContent":["import type {Narrow, ServerNarrow} from \"./narrow\";\nimport type {SortBy} from \"./sortBy\";\n\nimport type { Facet} from \"./facets\";\nimport {AncestorCategory, RelatedCategory} from \"./categories\";\n\nimport {Product, ServerProduct} from \"./product\";\n\nexport interface PopularSearch {\n label: string\n type: \"p\"\n}\ninterface Base {\n narrow: Narrow,\n sortBy: SortBy,\n totalResults: number,\n page: number,\n totalPages: number,\n products: Product[],\n facets: Facet[],\n avoidTagPrefixes: string[],\n sort: SortBy,\n productIDS: string[],\n bannerHTML: string,\n bannerHTMLMobile: string,\n // ancestors: Ancestor[]\n}\n\nexport interface SearchResults extends Base {\n query: string,\n totalCMS: number,\n didYouMean?: string[],\n personalizedProductIds: number[],\n sessionProductIds: number[],\n resultsFor?: string,\n isRelatedResults?: boolean\n relatedSearch?: string[]\n}\n\nexport interface CategoryResults extends Base {\n categoryID: string,\n categoryName: string,\n personalizationRecencyLimit?: number,\n personalizedProductIds: number[],\n sessionProductIds: number[],\n relatedCategories: RelatedCategory[],\n}\n\nexport interface LandingPageResults extends Base {\n lpSlug: string,\n title: string,\n indexPage: number\n}\n\nexport type FacetRequired = 0 | 1 | 2\nexport type CategoryAncestor = [string, string, string]\n\nexport interface fullTextSearchProps {\n term: string\n storeID: number\n siteKey?:string\n uuid: string\n cdn?: number\n userToken: string,\n sessionStart: number,\n page?: number\n productsPerPage?: number\n sortBy?: SortBy\n narrowBy?: ServerNarrow[]\n facetRequired?: FacetRequired\n withAttributes?: boolean\n recent?: string\n searchWithinSearch?: string,\n segments?: string[]\n hasShopifyMarkets?: boolean\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\n with_product_analytics?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n}\nexport interface ContextFilteringData {\n hidden: number[] // Product IDs hidden by context filtering\n unpublished: Record<number, string> // product_id -> region_code (e.g., \"US\", \"CA\")\n unsellable: Record<number, string> // product_id -> region_code (e.g., \"UK\", \"FR\")\n}\n\nexport interface fullTextSearchResponse {\n products: ServerProduct[]\n facets: Facet[]\n total_results: number\n facets_completed?: boolean\n sortBy?: SortBy,\n narrow: [string, string, string][]\n pop_products_no_results?: boolean\n page: number\n total_p: number\n personalized_products?: number[],\n ancestor_categories?: CategoryAncestor[]\n avoid_tag_prefixes?: string\n merch?: any\n}\nexport interface QueryUnderstanding {\n query: string\n has_ai_enrichment: boolean\n structured_attributes: Record<string, string[]>\n social_attributes: Record<string, string[]>\n intent_mapping: string[]\n}\n\nexport interface FullTextServerResponseAll extends fullTextSearchResponse{\n alternatives?: string[]\n term: string\n cms_number_found?: number\n within_search_results_for?: string\n banner_html: string\n banner_html_mobile: string\n turbolink?: string\n personalized_products?: number[]\n session_products?: number[]\n results_for?: string\n related_results?: boolean,\n ancestor_categories?: AncestorCategory[],\n related_search?: string[],\n hidden?:any,\n isNoResults?:any,\n totalResults?:any,\n hiddenProducts?:ServerProduct[],\n pageCount?:number,\n sort_by?: SortBy,\n id_list?:number[]\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n analytics?: {\n badges?: {\n winners?: Record<string, string> // Product ID -> tooltip message\n overexposed?: Record<string, string> // Product ID -> tooltip message\n new_arrivals?: string[]\n }\n key_hidden_winners?: string\n key_overexposed?: string\n }\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n\n}"]}
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../src/@types/results.ts"],"names":[],"mappings":"","sourcesContent":["import type {Narrow, ServerNarrow} from \"./narrow\";\nimport type {SortBy} from \"./sortBy\";\n\nimport type { Facet} from \"./facets\";\nimport {AncestorCategory, RelatedCategory} from \"./categories\";\n\nimport {Product, ServerProduct} from \"./product\";\n\nexport interface PopularSearch {\n label: string\n type: \"p\"\n}\ninterface Base {\n narrow: Narrow,\n sortBy: SortBy,\n totalResults: number,\n page: number,\n totalPages: number,\n products: Product[],\n facets: Facet[],\n avoidTagPrefixes: string[],\n sort: SortBy,\n productIDS: string[],\n bannerHTML: string,\n bannerHTMLMobile: string,\n // ancestors: Ancestor[]\n}\n\nexport interface SearchResults extends Base {\n query: string,\n totalCMS: number,\n didYouMean?: string[],\n personalizedProductIds: number[],\n sessionProductIds: number[],\n resultsFor?: string,\n isRelatedResults?: boolean\n relatedSearch?: string[]\n}\n\nexport interface CategoryResults extends Base {\n categoryID: string,\n categoryName: string,\n personalizationRecencyLimit?: number,\n personalizedProductIds: number[],\n sessionProductIds: number[],\n relatedCategories: RelatedCategory[],\n}\n\nexport interface LandingPageResults extends Base {\n lpSlug: string,\n title: string,\n indexPage: number\n}\n\nexport type FacetRequired = 0 | 1 | 2\nexport type CategoryAncestor = [string, string, string]\n\nexport interface fullTextSearchProps {\n term: string\n storeID: number\n siteKey?:string\n uuid: string\n cdn?: number\n userToken: string,\n sessionStart: number,\n page?: number\n productsPerPage?: number\n sortBy?: SortBy\n narrowBy?: ServerNarrow[]\n facetRequired?: FacetRequired\n withAttributes?: boolean\n recent?: string\n searchWithinSearch?: string,\n segments?: string[]\n hasShopifyMarkets?: boolean\n disable_turbolinks?:boolean\n disable_strategies?:boolean\n disable_merchandising?:boolean\n disable_semantics?:boolean\n disable_merchandising_rules?:boolean\n disable_antonyms?:boolean\n custom_sort_settings?:{personalization_rank: number, creation_date: number, popularity: number, inventory: number}\n with_product_analytics?:boolean\n market_context?: string | null // Region code for market-specific filtering (e.g., \"US\", \"CA\", \"UK\")\n variation_id?: string | null // A/B test variation ID for reasoning/experiment tracking\n}\nexport interface ContextFilteringData {\n hidden: number[] // Product IDs hidden by context filtering\n unpublished: Record<number, string> // product_id -> region_code (e.g., \"US\", \"CA\")\n unsellable: Record<number, string> // product_id -> region_code (e.g., \"UK\", \"FR\")\n}\n\nexport interface fullTextSearchResponse {\n products: ServerProduct[]\n facets: Facet[]\n total_results: number\n facets_completed?: boolean\n sortBy?: SortBy,\n narrow: [string, string, string][]\n pop_products_no_results?: boolean\n page: number\n total_p: number\n personalized_products?: number[],\n ancestor_categories?: CategoryAncestor[]\n avoid_tag_prefixes?: string\n merch?: any\n}\nexport interface QueryUnderstanding {\n query: string\n has_ai_enrichment: boolean\n structured_attributes: Record<string, string[]>\n social_attributes: Record<string, string[]>\n intent_mapping: string[]\n}\n\nexport interface FullTextServerResponseAll extends fullTextSearchResponse{\n alternatives?: string[]\n term: string\n cms_number_found?: number\n within_search_results_for?: string\n banner_html: string\n banner_html_mobile: string\n turbolink?: string\n personalized_products?: number[]\n session_products?: number[]\n results_for?: string\n related_results?: boolean,\n ancestor_categories?: AncestorCategory[],\n related_search?: string[],\n hidden?:any,\n isNoResults?:any,\n totalResults?:any,\n hiddenProducts?:ServerProduct[],\n pageCount?:number,\n sort_by?: SortBy,\n id_list?:number[]\n context?: ContextFilteringData // Context-based filtering data (market contexts)\n analytics?: {\n badges?: {\n winners?: Record<string, string> // Product ID -> tooltip message\n overexposed?: Record<string, string> // Product ID -> tooltip message\n new_arrivals?: string[]\n }\n key_hidden_winners?: string\n key_overexposed?: string\n }\n query_understanding?: QueryUnderstanding\n reformulation_source?: string\n\n}"]}
|
|
@@ -37,7 +37,7 @@ const mainTheme = {
|
|
|
37
37
|
};
|
|
38
38
|
const FastSimonApi = (_a) => {
|
|
39
39
|
var _b;
|
|
40
|
-
var { storeID, uuid, siteKey, children, defaultSort, promoTiles = false, theme, withProductAttributes = false, isInfiniteScroll = false, getTitle, useFilters, noReport = false, customTitleChange, isEnterpriseMerchandising = false, subscription = 0, marketContext = null, forceProductAnalytics = false } = _a, props = __rest(_a, ["storeID", "uuid", "siteKey", "children", "defaultSort", "promoTiles", "theme", "withProductAttributes", "isInfiniteScroll", "getTitle", "useFilters", "noReport", "customTitleChange", "isEnterpriseMerchandising", "subscription", "marketContext", "forceProductAnalytics"]);
|
|
40
|
+
var { storeID, uuid, siteKey, children, defaultSort, promoTiles = false, theme, withProductAttributes = false, isInfiniteScroll = false, getTitle, useFilters, noReport = false, customTitleChange, isEnterpriseMerchandising = false, subscription = 0, marketContext = null, forceProductAnalytics = false, variationId = null } = _a, props = __rest(_a, ["storeID", "uuid", "siteKey", "children", "defaultSort", "promoTiles", "theme", "withProductAttributes", "isInfiniteScroll", "getTitle", "useFilters", "noReport", "customTitleChange", "isEnterpriseMerchandising", "subscription", "marketContext", "forceProductAnalytics", "variationId"]);
|
|
41
41
|
const [state, dispatch] = useReducer === null || useReducer === void 0 ? void 0 : useReducer(fastStateReducer, {
|
|
42
42
|
isReady: false,
|
|
43
43
|
type: (_b = props.type) !== null && _b !== void 0 ? _b : 'SPA',
|
|
@@ -57,7 +57,8 @@ const FastSimonApi = (_a) => {
|
|
|
57
57
|
segments: undefined,
|
|
58
58
|
flag: [],
|
|
59
59
|
custom_sort_settings: undefined,
|
|
60
|
-
isAutocomplete: false
|
|
60
|
+
isAutocomplete: false,
|
|
61
|
+
variation_id: variationId
|
|
61
62
|
});
|
|
62
63
|
const [categories, setCategories] = useState([]);
|
|
63
64
|
const [analyticsFetched, setAnalyticsFetched] = useState(false);
|
|
@@ -85,6 +86,9 @@ const FastSimonApi = (_a) => {
|
|
|
85
86
|
function setIsAutocomplete(isAutocomplete) {
|
|
86
87
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'setIsAutocomplete', payload: isAutocomplete });
|
|
87
88
|
}
|
|
89
|
+
function setVariationId(variationId) {
|
|
90
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'setVariationId', payload: variationId });
|
|
91
|
+
}
|
|
88
92
|
function setQuery(query, isAutocomplete) {
|
|
89
93
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'setQuery', payload: query });
|
|
90
94
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'setIsAutocomplete', payload: isAutocomplete ? isAutocomplete : false });
|
|
@@ -104,6 +108,7 @@ const FastSimonApi = (_a) => {
|
|
|
104
108
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
105
109
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
106
110
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
111
|
+
variation_id: state.variation_id,
|
|
107
112
|
};
|
|
108
113
|
fetchResults(fetchParams, isInfiniteScroll, isAutocomplete ? isAutocomplete : false);
|
|
109
114
|
}
|
|
@@ -128,6 +133,7 @@ const FastSimonApi = (_a) => {
|
|
|
128
133
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
129
134
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
130
135
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
136
|
+
variation_id: state.variation_id,
|
|
131
137
|
};
|
|
132
138
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
133
139
|
}
|
|
@@ -147,6 +153,7 @@ const FastSimonApi = (_a) => {
|
|
|
147
153
|
withProductAttributes: withProductAttributes,
|
|
148
154
|
searchWithinSearch: state.searchWithinSearch,
|
|
149
155
|
custom_sort_settings: state.custom_sort_settings,
|
|
156
|
+
variation_id: state.variation_id,
|
|
150
157
|
};
|
|
151
158
|
if (flags.length > 0) {
|
|
152
159
|
flags.forEach((f) => {
|
|
@@ -179,6 +186,7 @@ const FastSimonApi = (_a) => {
|
|
|
179
186
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
180
187
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
181
188
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
189
|
+
variation_id: state.variation_id,
|
|
182
190
|
};
|
|
183
191
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
184
192
|
}
|
|
@@ -202,6 +210,7 @@ const FastSimonApi = (_a) => {
|
|
|
202
210
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
203
211
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
204
212
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
213
|
+
variation_id: state.variation_id,
|
|
205
214
|
};
|
|
206
215
|
fetchResults(fetchParams, isInfiniteScroll, state.isAutocomplete);
|
|
207
216
|
}
|
|
@@ -226,6 +235,7 @@ const FastSimonApi = (_a) => {
|
|
|
226
235
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
227
236
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
228
237
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
238
|
+
variation_id: state.variation_id,
|
|
229
239
|
};
|
|
230
240
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
231
241
|
}
|
|
@@ -250,6 +260,7 @@ const FastSimonApi = (_a) => {
|
|
|
250
260
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
251
261
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
252
262
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
263
|
+
variation_id: state.variation_id,
|
|
253
264
|
};
|
|
254
265
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
255
266
|
}
|
|
@@ -273,6 +284,7 @@ const FastSimonApi = (_a) => {
|
|
|
273
284
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
274
285
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
275
286
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
287
|
+
variation_id: state.variation_id,
|
|
276
288
|
};
|
|
277
289
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
278
290
|
}
|
|
@@ -292,6 +304,7 @@ const FastSimonApi = (_a) => {
|
|
|
292
304
|
categoryID: newState.collectionID,
|
|
293
305
|
page: newState.page,
|
|
294
306
|
segments: newState.segments,
|
|
307
|
+
variation_id: state.variation_id,
|
|
295
308
|
}, Boolean(!results && isInfiniteScroll && newState.page && newState.page > 1));
|
|
296
309
|
}
|
|
297
310
|
function setSingleProducts(products) {
|
|
@@ -320,6 +333,7 @@ const FastSimonApi = (_a) => {
|
|
|
320
333
|
disable_strategies: state.flag.find((f) => f == "disable_strategies") ? 1 : 0,
|
|
321
334
|
disable_merchandising_rules: state.flag.find((f) => f == "disable_merchandising_rules") ? 1 : 0,
|
|
322
335
|
disable_antonyms: state.flag.find((f) => f == "disable_antonyms") ? 1 : 0,
|
|
336
|
+
variation_id: state.variation_id,
|
|
323
337
|
};
|
|
324
338
|
fetchResults(fetchParams, isInfiniteScroll);
|
|
325
339
|
}
|
|
@@ -408,7 +422,7 @@ const FastSimonApi = (_a) => {
|
|
|
408
422
|
const currentQuery = props.term || '';
|
|
409
423
|
const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();
|
|
410
424
|
const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentQuery !== lastAnalyticsQuery || lastAnalyticsMode !== 'search'));
|
|
411
|
-
FullTextSearch.getReasoningFullTextSearch(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, with_product_analytics: shouldFetchAnalytics, market_context: marketContext })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
425
|
+
FullTextSearch.getReasoningFullTextSearch(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, with_product_analytics: shouldFetchAnalytics, market_context: marketContext, variation_id: variationId })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
412
426
|
var _a;
|
|
413
427
|
// Mark analytics as fetched only if response contains analytics data with badges
|
|
414
428
|
if (shouldFetchAnalytics && ((_a = response.analytics) === null || _a === void 0 ? void 0 : _a.badges)) {
|
|
@@ -436,6 +450,7 @@ const FastSimonApi = (_a) => {
|
|
|
436
450
|
listIdRequestProps.productsPerPage = 1000000;
|
|
437
451
|
listIdRequestProps.page = 1;
|
|
438
452
|
listIdRequestProps.market_context = marketContext;
|
|
453
|
+
listIdRequestProps.variation_id = variationId;
|
|
439
454
|
let listIdRes = yield FullTextSearch.getReasoningFullTextSearchProductsIds(listIdRequestProps).then((response) => {
|
|
440
455
|
return response;
|
|
441
456
|
});
|
|
@@ -446,6 +461,7 @@ const FastSimonApi = (_a) => {
|
|
|
446
461
|
facetsRequestProps.productsPerPage = props.productsPerPage;
|
|
447
462
|
facetsRequestProps.page = props.page;
|
|
448
463
|
facetsRequestProps.market_context = marketContext;
|
|
464
|
+
facetsRequestProps.variation_id = variationId;
|
|
449
465
|
let facetsRes = yield FullTextSearch.getReasoningFullTextSearch(facetsRequestProps).then((response) => {
|
|
450
466
|
return response;
|
|
451
467
|
});
|
|
@@ -471,7 +487,7 @@ const FastSimonApi = (_a) => {
|
|
|
471
487
|
};
|
|
472
488
|
const onAutocompleteSearch = (props) => {
|
|
473
489
|
setIsLoading({ products: true, filters: true });
|
|
474
|
-
Autocomplete.getAutocompleteReasoning(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, market_context: marketContext })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
490
|
+
Autocomplete.getAutocompleteReasoning(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, market_context: marketContext, variation_id: variationId })).then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
475
491
|
response = getFormatedData(response);
|
|
476
492
|
mergeResults(response, false);
|
|
477
493
|
if (!customTitleChange) {
|
|
@@ -501,7 +517,7 @@ const FastSimonApi = (_a) => {
|
|
|
501
517
|
const currentCollection = props.categoryID || '';
|
|
502
518
|
const currentForceAnalytics = forceProductAnalytics || getShowSalesAnalyticsSetting();
|
|
503
519
|
const shouldFetchAnalytics = currentForceAnalytics || (isAnalyticsEnabled && (currentCollection !== lastAnalyticsCollection || lastAnalyticsMode !== 'collection'));
|
|
504
|
-
SmartCollections.getSmartCollections(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, with_product_analytics: shouldFetchAnalytics, market_context: marketContext }))
|
|
520
|
+
SmartCollections.getSmartCollections(Object.assign(Object.assign({}, props), { withAttributes: promoTiles || withProductAttributes, with_product_analytics: shouldFetchAnalytics, market_context: marketContext, variation_id: variationId }))
|
|
505
521
|
.then((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
506
522
|
var _a;
|
|
507
523
|
// Mark analytics as fetched only if response contains analytics data with badges
|
|
@@ -518,6 +534,7 @@ const FastSimonApi = (_a) => {
|
|
|
518
534
|
listIdRequestProps.productsPerPage = 1000000;
|
|
519
535
|
listIdRequestProps.page = 1;
|
|
520
536
|
listIdRequestProps.market_context = marketContext;
|
|
537
|
+
listIdRequestProps.variation_id = variationId;
|
|
521
538
|
let listIdRes = yield SmartCollections.getSmartCollectionsProductsIds(listIdRequestProps).then((response) => {
|
|
522
539
|
return response;
|
|
523
540
|
});
|
|
@@ -528,6 +545,7 @@ const FastSimonApi = (_a) => {
|
|
|
528
545
|
facetsRequestProps.productsPerPage = props.productsPerPage;
|
|
529
546
|
facetsRequestProps.page = props.page;
|
|
530
547
|
facetsRequestProps.market_context = marketContext;
|
|
548
|
+
facetsRequestProps.variation_id = variationId;
|
|
531
549
|
let facetsRes = yield SmartCollections.getSmartCollections(facetsRequestProps).then((response) => {
|
|
532
550
|
return response;
|
|
533
551
|
});
|
|
@@ -612,8 +630,9 @@ const FastSimonApi = (_a) => {
|
|
|
612
630
|
setSegments,
|
|
613
631
|
setFlag,
|
|
614
632
|
setCustomSort,
|
|
615
|
-
setIsAutocomplete
|
|
616
|
-
|
|
633
|
+
setIsAutocomplete,
|
|
634
|
+
setVariationId
|
|
635
|
+
} }, { children: _jsx(FastState.Provider, Object.assign({ value: { narrow, results, page, query, sortBy, type, collectionID, isLoading, recommendations, singleProducts, isReady, autocomplete, isAutocomplete, variation_id: state.variation_id } }, { children: _jsx(ThemeProvider, Object.assign({ theme: Object.assign(Object.assign({}, mainTheme), theme) }, { children: children })) })) })));
|
|
617
636
|
};
|
|
618
637
|
export default FastSimonApi;
|
|
619
638
|
//# sourceMappingURL=FastSimonApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FastSimonApi.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/FastSimonApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAqB,SAAS,EAAE,kBAAkB,EAA2B,MAAM,WAAW,CAAC;AACtG,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;AAKnF,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAoCzD,MAAM,SAAS,GAAc;IACzB,YAAY,EAAE,SAAS;IAC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AAa;YACb,iBAAiB;SACpB,gBACD,KAAC,SAAS,CAAC,QAAQ,kBACf,KAAK,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAC,gBACpJ,KAAC,aAAa,kBAAC,KAAK,kCAAM,SAAS,GAAK,KAAK,iBACxC,QAAQ,IACG,IACC,IACK,CACjC,CAAA;AACL,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, {useEffect, useReducer, useState} from \"react\";\nimport {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\";\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}\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 ...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 });\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 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 };\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 };\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 };\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 };\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 };\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 };\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 };\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 };\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 }, 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 };\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 },\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(event.detail);\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 const onSearch = (props: Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\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 FullTextSearch.getReasoningFullTextSearch({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext\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 if new response doesn't have it\n const existingAnalytics = (results as any)?.analytics;\n response=getFormatedData(response, existingAnalytics);\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 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 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 }\n const onAutocompleteSearch = (props: Omit<autocompleteProps, \"callback\">) => {\n setIsLoading({products: true, filters: true});\n Autocomplete.getAutocompleteReasoning({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext\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 SmartCollections.getSmartCollections({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext})\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 if new response doesn't have it\n const existingAnalytics = (results as any)?.analytics;\n response=getFormatedData(response, existingAnalytics);\n\n const listIdRequestProps = { ...props };\n listIdRequestProps.searchWithinSearch=undefined;\n listIdRequestProps.productsPerPage=1000000;\n listIdRequestProps.page=1;\n listIdRequestProps.market_context = marketContext;\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 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 const getAllCategories = 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 }\n\n const getFormatedData = (response: any, existingAnalytics?: 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 return results;\n };\n\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 }}>\n <FastState.Provider\n value={{narrow, results, page, query, sortBy, type, collectionID, isLoading, recommendations, singleProducts, isReady, autocomplete, isAutocomplete}}>\n <ThemeProvider theme={{...mainTheme, ...theme}}>\n {children}\n </ThemeProvider>\n </FastState.Provider>\n </FastStateFunctions.Provider>\n )\n};\n\nexport default FastSimonApi;"]}
|
|
1
|
+
{"version":3,"file":"FastSimonApi.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/FastSimonApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAqB,SAAS,EAAE,kBAAkB,EAA2B,MAAM,WAAW,CAAC;AACtG,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;AAKnF,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,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AC7B,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpE;QAGD,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,OAAO,CAAC,CAAC,CAAC;QAEjB,0EAA0E;QAC1E,2EAA2E;QAC3E,IAAI,QAAQ,CAAC,SAAS,EAAE;YACpB,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;SAC1C;aAAM,IAAI,iBAAiB,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,iBAAiB,CAAC;SACzC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC,CAAC;IAGF,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;SACjB,gBACD,KAAC,SAAS,CAAC,QAAQ,kBACf,KAAK,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAC,gBACtL,KAAC,aAAa,kBAAC,KAAK,kCAAM,SAAS,GAAK,KAAK,iBACxC,QAAQ,IACG,IACC,IACK,CACjC,CAAA;AACL,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, {useEffect, useReducer, useState} from \"react\";\nimport {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\";\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\n });\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 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 };\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 };\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 };\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 };\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 };\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 };\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 };\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 };\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 }, 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 };\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\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(event.detail);\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 const onSearch = (props: Omit<fullTextSearchProps, \"callback\">, isInfiniteScroll: boolean) => {\n setIsLoading({products: true, filters: true});\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 FullTextSearch.getReasoningFullTextSearch({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext,\n variation_id: variationId\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 if new response doesn't have it\n const existingAnalytics = (results as any)?.analytics;\n response=getFormatedData(response, existingAnalytics);\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 = variationId;\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 = variationId;\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 }\n const onAutocompleteSearch = (props: Omit<autocompleteProps, \"callback\">) => {\n setIsLoading({products: true, filters: true});\n Autocomplete.getAutocompleteReasoning({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n market_context: marketContext,\n variation_id: variationId\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 SmartCollections.getSmartCollections({\n ...props,\n withAttributes: promoTiles || withProductAttributes,\n with_product_analytics: shouldFetchAnalytics,\n market_context: marketContext,\n variation_id: variationId})\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 if new response doesn't have it\n const existingAnalytics = (results as any)?.analytics;\n response=getFormatedData(response, existingAnalytics);\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 = variationId;\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 = variationId;\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 const getAllCategories = 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 }\n\n const getFormatedData = (response: any, existingAnalytics?: 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 return results;\n };\n\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 }}>\n <FastState.Provider\n value={{narrow, results, page, query, sortBy, type, collectionID, isLoading, recommendations, singleProducts, isReady, autocomplete, isAutocomplete, variation_id: state.variation_id}}>\n <ThemeProvider theme={{...mainTheme, ...theme}}>\n {children}\n </ThemeProvider>\n </FastState.Provider>\n </FastStateFunctions.Provider>\n )\n};\n\nexport default FastSimonApi;"]}
|
|
@@ -41,6 +41,7 @@ export interface FastStateProps {
|
|
|
41
41
|
flag?: string[];
|
|
42
42
|
custom_sort_settings?: CustomSortSettings;
|
|
43
43
|
isAutocomplete?: boolean;
|
|
44
|
+
variation_id?: string | null;
|
|
44
45
|
}
|
|
45
46
|
export interface FastStateFunctionsProps {
|
|
46
47
|
setQuery: (query: string, isAutocomplete?: boolean) => void;
|
|
@@ -55,6 +56,7 @@ export interface FastStateFunctionsProps {
|
|
|
55
56
|
setSegments: (segments: string[]) => void;
|
|
56
57
|
setCustomSort: (customSortSettings: CustomSortSettings) => void;
|
|
57
58
|
setIsAutocomplete: (isAutocomplete: boolean) => void;
|
|
59
|
+
setVariationId: (variationId: string | null) => void;
|
|
58
60
|
}
|
|
59
61
|
export declare const FastState: React.Context<FastStateProps>;
|
|
60
62
|
export declare const FastStateFunctions: React.Context<FastStateFunctionsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AAqExC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,EAAoB,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA6B,CAAC,CAAA;AAEpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,OAAO,UAAU,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC,CAAA","sourcesContent":["import React, {useContext} from \"react\";\n\n\nimport {FullTextServerResponseAll} from \"../../@types/results\";\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\nimport {SortBy} from \"../../@types/sortBy\";\nimport {Product} from \"../../@types/product\";\nimport {FastCategory, smartCollectionsResults} from \"../../@types/categories\";\nimport {AppType} from \"./FastSimonApi\";\nimport {Widget} from \"../../@types/widget\";\nimport {AutocompleteReasoningResponse, AutocompleteResults} from \"../../@types/autocomplete\";\n\n\nexport interface SetStateProps extends Partial<FastStateProps> {\n\n}\n\nexport interface IsLoading {\n products: boolean,\n filters: boolean,\n}\nexport interface CustomSortSettings{\n personalization_rank: number,\n creation_date: number,\n popularity: number,\n inventory: number\n}\n\nexport interface FastStateProps {\n isReady: boolean\n isLoading: IsLoading,\n results?: FullTextServerResponseAll | smartCollectionsResults | AutocompleteReasoningResponse\n query: string\n page: number,\n narrow?: ServerNarrow[]\n type: AppType\n collectionID?: string\n sortBy?: SortBy\n recommendations?: {\n [id: string]: Widget\n },\n singleProducts?: {\n [id: string]: Product\n }\n autocomplete?: AutocompleteResults\n searchWithinSearch?: string,\n segments?: string[],\n flag?:string[]\n custom_sort_settings?:CustomSortSettings\n isAutocomplete?:boolean\n variation_id?: string | null\n}\n\nexport interface FastStateFunctionsProps {\n setQuery: (query: string, isAutocomplete?:boolean) => void,\n setSort: (sortBy: SortBy) => void,\n setNarrow: (narrow?: ServerNarrow[]) => void,\n setPage: (page: number) => void,\n getAllCategories: () => Promise<FastCategory[]>\n setCollection: (id: string) => void\n setState: (newState: SetStateProps) => void\n setFlag:(flags:string[])=>void\n setSearchWithinSearch: (query: string) => void,\n setSegments: (segments: string[]) => void,\n setCustomSort:(customSortSettings:CustomSortSettings)=>void,\n setIsAutocomplete:(isAutocomplete:boolean)=>void,\n setVariationId:(variationId: string | null)=>void,\n}\n\nexport const FastState = React.createContext({} as FastStateProps)\nexport const FastStateFunctions = React.createContext({} as FastStateFunctionsProps)\n\nexport const useFastStateFunctions = () => {\n return useContext(FastStateFunctions);\n}\n\nexport const useFastState = () => {\n return useContext(FastState)\n}"]}
|
|
@@ -78,6 +78,9 @@ type FastStateAction = {
|
|
|
78
78
|
} | {
|
|
79
79
|
type: 'setCustomSort';
|
|
80
80
|
payload: CustomSortSettings;
|
|
81
|
+
} | {
|
|
82
|
+
type: 'setVariationId';
|
|
83
|
+
payload: string | null;
|
|
81
84
|
};
|
|
82
85
|
export declare function fastStateReducer(state: FastStateProps, action: FastStateAction): FastStateProps | {
|
|
83
86
|
results: {
|
|
@@ -440,6 +443,7 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
|
|
|
440
443
|
flag?: string[] | undefined;
|
|
441
444
|
custom_sort_settings?: CustomSortSettings | undefined;
|
|
442
445
|
isAutocomplete?: boolean | undefined;
|
|
446
|
+
variation_id?: string | null | undefined;
|
|
443
447
|
} | {
|
|
444
448
|
narrow: Narrow[];
|
|
445
449
|
isReady: boolean;
|
|
@@ -462,5 +466,6 @@ export declare function fastStateReducer(state: FastStateProps, action: FastStat
|
|
|
462
466
|
flag?: string[] | undefined;
|
|
463
467
|
custom_sort_settings?: CustomSortSettings | undefined;
|
|
464
468
|
isAutocomplete?: boolean | undefined;
|
|
469
|
+
variation_id?: string | null | undefined;
|
|
465
470
|
};
|
|
466
471
|
export {};
|
|
@@ -72,6 +72,8 @@ export function fastStateReducer(state, action) {
|
|
|
72
72
|
return Object.assign(Object.assign({}, state), { flag: action.payload });
|
|
73
73
|
case 'setCustomSort':
|
|
74
74
|
return Object.assign(Object.assign({}, state), { custom_sort_settings: action.payload });
|
|
75
|
+
case 'setVariationId':
|
|
76
|
+
return Object.assign(Object.assign({}, state), { variation_id: action.payload });
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/reducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/reducer.ts"],"names":[],"mappings":"AAqCA,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,uCA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AAC,cAAc,CAAC,CAAC;YAEtE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;aAClC;YAED,uCAAW,KAAK,KAAE,cAAc,EAAE,QAAQ,IAAC;SAC9C;QACD,KAAK,mBAAmB,CAAC,CAAA;YACrB,uCAAW,KAAK,KAAE,cAAc,EAAE,MAAM,CAAC,OAAO,IAAC;SACpD;QAED,KAAK,iBAAiB,CAAC,CAAC;YACpB,uCAAW,KAAK,KAAE,YAAY,EAAE,MAAM,CAAC,OAAO,IAAC;SAClD;QAED,KAAK,uBAAuB,CAAC,CAAC;YAC1B,uCAAW,KAAK,KAAE,kBAAkB,EAAE,MAAM,CAAC,OAAO,IAAC;SACxD;QACD,KAAK,SAAS;YACV,uCAAW,KAAK,KAAE,IAAI,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5C,KAAK,eAAe;YAChB,uCAAW,KAAK,KAAE,oBAAoB,EAAE,MAAM,CAAC,OAAO,IAAE;QAE5D,KAAK,gBAAgB;YACjB,uCAAW,KAAK,KAAE,YAAY,EAAE,MAAM,CAAC,OAAO,IAAE;KAEvD;AACL,CAAC","sourcesContent":["import {CustomSortSettings, FastStateProps, IsLoading} from \"./context\";\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\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 for (const product of newProducts) {\n if(!products?.find(x => x.id === product.id)) {\n return {\n ...state,\n results: {...state.results, isNoResults: false, ...action.payload.results, products: [...products, ...newProducts]}\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 }\n}\n\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { autocompleteProps, AutocompleteReasoningResponse } from "../@types/autocomplete";
|
|
2
2
|
export declare const Autocomplete: {
|
|
3
|
-
getAutocompleteReasoning: ({ uuid, storeID, siteKey, cdn, withAttributes, term, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, market_context }: autocompleteProps) => Promise<AutocompleteReasoningResponse>;
|
|
3
|
+
getAutocompleteReasoning: ({ uuid, storeID, siteKey, cdn, withAttributes, term, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, market_context, variation_id }: autocompleteProps) => Promise<AutocompleteReasoningResponse>;
|
|
4
4
|
};
|
|
@@ -3,7 +3,7 @@ import { getInternalURL } from "../utils/getInternalURL";
|
|
|
3
3
|
import { getUseCacheSetting } from "../utils/getCacheSettings";
|
|
4
4
|
const BASE_URL = "https://internal-v3joil6oqa-uc.a.run.app";
|
|
5
5
|
export const Autocomplete = {
|
|
6
|
-
getAutocompleteReasoning: ({ uuid, storeID, siteKey, cdn, withAttributes, term, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, market_context }) => {
|
|
6
|
+
getAutocompleteReasoning: ({ uuid, storeID, siteKey, cdn, withAttributes, term, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, market_context, variation_id }) => {
|
|
7
7
|
var internal_url = getInternalURL();
|
|
8
8
|
if (internal_url == "") {
|
|
9
9
|
internal_url = BASE_URL;
|
|
@@ -15,7 +15,7 @@ export const Autocomplete = {
|
|
|
15
15
|
const params = Object.assign(Object.assign({ site_key: siteKey,
|
|
16
16
|
// UUID: uuid,
|
|
17
17
|
// store_id: storeID,
|
|
18
|
-
cdn_cache_key: cdn, q: term }, (!use_cache ? { m: 1 } : {})), { with_product_attributes: withAttributes, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, market_context: market_context || undefined });
|
|
18
|
+
cdn_cache_key: cdn, q: term }, (!use_cache ? { m: 1 } : {})), { with_product_attributes: withAttributes, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, market_context: market_context || undefined, variation_id: variation_id || undefined });
|
|
19
19
|
params["segments"] = JSON.stringify(segments) || undefined;
|
|
20
20
|
return API.get({
|
|
21
21
|
url: `${internal_url}/search/autocomplete_reasoning`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/services/autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAG5D,MAAM,CAAC,MAAM,YAAY,GAAG;IACpB,wBAAwB,EAAE,CAAC,EACD,IAAI,EAAE,OAAO,EAAC,OAAO,EAAE,GAAG,EACxB,cAAc,EAAE,IAAI,EAAE,QAAQ,EAChC,iBAAiB,EAAC,qBAAqB,EAAC,kBAAkB,EAAC,kBAAkB,EAAC,2BAA2B,EAAC,gBAAgB,EAC1H,cAAc,
|
|
1
|
+
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/services/autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAG5D,MAAM,CAAC,MAAM,YAAY,GAAG;IACpB,wBAAwB,EAAE,C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,SAAS,EAC3C,YAAY,EAAE,YAAY,IAAI,SAAS,GAE1C,CAAC;QAED,MAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QACpE,OAAO,GAAG,CAAC,GAAG,CAAgC;YAC1C,GAAG,EAAE,GAAG,YAAY,gCAAgC;YACpD,MAAM;SACT,CAAC,CAAC;IACP,CAAC;CACJ,CACJ","sourcesContent":["import {API} from \"./API\";\nimport {getInternalURL} from \"../utils/getInternalURL\";\nimport {autocompleteProps, AutocompleteReasoningResponse, AutocompleteResults} from \"../@types/autocomplete\";\nimport {getUseCacheSetting} from \"../utils/getCacheSettings\";\n\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\n\n\nexport const Autocomplete = {\n getAutocompleteReasoning: ({\n uuid, storeID,siteKey, cdn\n , withAttributes, term, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n market_context, variation_id\n }: autocompleteProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n q: term,\n ...(!use_cache ? { m: 1 } : {}),\n with_product_attributes: withAttributes,\n st: JSON.stringify(segments)||undefined,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n market_context: market_context || undefined,\n variation_id: variation_id || undefined\n\n };\n\n (params as any)[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<AutocompleteReasoningResponse>({\n url: `${internal_url}/search/autocomplete_reasoning`,\n params,\n });\n },\n }\n;"]}
|
|
@@ -28,7 +28,9 @@ export const LandingPage = {
|
|
|
28
28
|
: undefined,
|
|
29
29
|
visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('"[', "[").replaceAll(']"', "]"),
|
|
30
30
|
m: 1,
|
|
31
|
-
merchandising_rules: type == 1
|
|
31
|
+
merchandising_rules: type == 1 && merchandisingRules && Object.keys(merchandisingRules).length > 0
|
|
32
|
+
? JSON.stringify(merchandisingRules)
|
|
33
|
+
: undefined,
|
|
32
34
|
ids_only: idsOnly ? 1 : undefined,
|
|
33
35
|
};
|
|
34
36
|
const res = yield fastSimonGet(BASE_URL, "landing_page_editor", params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"landingPage.js","sourceRoot":"","sources":["../../src/services/landingPage.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAM,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"landingPage.js","sourceRoot":"","sources":["../../src/services/landingPage.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAM,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAoD/D,MAAM,QAAQ,GAAG,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,mCAAI,iDAAiD,CAAC;AAkB5G,MAAM,CAAC,MAAM,WAAW,GAAG;IACnB,WAAW,EAAE,CAAO,EACpB,IAAI,EACJ,OAAO,EACP,WAAW,EACX,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,WAAW,EACpB,MAAM,GAAG,IAAI,EACb,MAAM,EACN,eAAe,EACf,qBAAqB,GAAG,SAAS,EACjC,wBAAwB,EACxB,IAAI,EACJ,mBAAmB,EACnB,kBAAkB,EACl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AC;IACzE,CAAC,CAAA;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAgB,EAAE,gBAAyB,EAAE,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type {SortBy} from \"../@types/sortBy\";\nimport type {Narrow, ServerNarrow} from \"@fast-simon/utilities\";\nimport {API, fastSimonGet} from \"./API\";\nimport {FacetsParser, ServerFacet} from \"@fast-simon/utilities\"\nimport {AncestorCategory} from \"../@types/categories\";\nimport {EditorProduct} from \"../@types/editorProduct\";\ninterface LandingPageRequest {\n uuid: string;\n storeID: string;\n landingPage: string\n type: number\n page?: number\n sortBy?: SortBy\n facets?: boolean\n narrow?: Narrow\n productsPerPage?: number\n withProductAttributes?: boolean\n searchWithinResultsQuery?: string\n idsOnly?: boolean\n}\n\ninterface LandingPageFacetsOnly extends Omit<LandingPageRequest, \"facets\"> {\n avoid_tag_prefixes?: string\n}\n\ninterface LandingPageServerResponseFacetsOnly {\n total_results: number\n term: string\n narrow?: ServerNarrow\n facets_completed: true\n facets: ServerFacet[],\n}\n\ninterface LandingPageServerResponseAll {\n items: EditorProduct[]\n alternatives?: string[]\n facets_completed: boolean\n narrow?: ServerNarrow[]\n p: number\n total_p: number\n total_results: number\n term: string\n lp_slug: string\n title: string\n index_page: number\n banner_html: string\n banner_html_mobile: string\n facets: ServerFacet[]\n sort_by: SortBy\n avoid_tag_prefixes?: string\n cms_number_found?: number\n within_search_results_for?: string,\n ancestor_categories?: AncestorCategory[]\n}\n\nconst BASE_URL = import.meta.env.VITE_SERVING_BASE_URL ?? \"https://internal-v3joil6oqa-uc.a.run.app/search\";\n\ninterface LandingPageResponse {\n items: EditorProduct[]\n facets_completed: boolean\n narrow?: Narrow[]\n p: number\n total_p: number\n isp_quick_view_mode: number\n related_results: boolean\n total_results: number\n lp_slug: string\n title: string\n facets: ServerFacet[]\n sort_by: SortBy\n avoid_tag_prefixes?: string\n}\n\nexport const LandingPage = {\n landingPage: async ({\n uuid,\n storeID,\n landingPage,\n page = 1,\n sortBy = \"relevency\",\n facets = true,\n narrow,\n productsPerPage,\n withProductAttributes = undefined,\n searchWithinResultsQuery,\n type,\n visualMerchandising,\n merchandisingRules,\n idsOnly,\n }: any) => {\n const params: Record<string, any> = {\n UUID: uuid,\n store_id: storeID,\n facets_required: facets ? 1 : 0,\n products_per_page: productsPerPage,\n narrow: JSON.stringify(narrow),\n lp: landingPage,\n page_num: page,\n type: type,\n with_product_attributes: withProductAttributes,\n search_within_search: searchWithinResultsQuery\n ? searchWithinResultsQuery\n : undefined,\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', \"[\").replaceAll(']\"', \"]\"),\n m: 1,\n merchandising_rules:\n type == 1 && merchandisingRules && Object.keys(merchandisingRules).length > 0\n ? JSON.stringify(merchandisingRules)\n : undefined,\n ids_only: idsOnly ? 1 : undefined,\n };\n const res = await fastSimonGet<LandingPageResponse>(\n BASE_URL,\n \"landing_page_editor\",\n params\n );\n return {\n data: res,\n getFacets: async () =>\n res?.facets_completed\n ? transformFacetsOnlyData(\n res.facets,\n res.avoid_tag_prefixes\n )\n : await LandingPage.landingPageFacetsOnly({\n uuid,\n storeID,\n landingPage,\n page,\n narrow,\n type,\n productsPerPage,\n searchWithinResultsQuery,\n withProductAttributes,\n visualMerchandising,\n merchandisingRules,\n }),\n };\n },\n\n landingPageFacetsOnly: async ({\n uuid,\n storeID,\n landingPage,\n page = 1,\n narrow,\n type,\n productsPerPage,\n searchWithinResultsQuery,\n withProductAttributes = false,\n visualMerchandising,\n merchandisingRules\n }: any) => {\n const data = await fastSimonGet<LandingPageServerResponseAll>(\n BASE_URL,\n \"landing_page_editor\",\n {\n UUID: uuid,\n store_id: storeID,\n facets_required: 2,\n products_per_page: productsPerPage,\n narrow: JSON.stringify(narrow),\n type: type,\n lp: landingPage,\n page_num: page ?? 1,\n with_product_attributes: withProductAttributes,\n search_within_search: searchWithinResultsQuery\n ? searchWithinResultsQuery\n : undefined,\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', \"[\").replaceAll(']\"', \"]\"),\n merchandising_rules: merchandisingRules\n ? JSON.stringify(merchandisingRules)\n : undefined,\n m: 1,\n }\n );\n return transformFacetsOnlyData(data.facets, data.avoid_tag_prefixes);\n },\n};\n\nexport const transformFacetsOnlyData = (r: ServerFacet[], avoidTagPrefixes?: string) => new FacetsParser().parseFacets(r, avoidTagPrefixes ? avoidTagPrefixes.split(\",\") : []);"]}
|
|
@@ -7,7 +7,7 @@ export declare const FullTextSearch: {
|
|
|
7
7
|
getFacets: () => Promise<import("@fast-simon/utilities").Facet[]>;
|
|
8
8
|
}>;
|
|
9
9
|
fullTextFacetsOnly: ({ uuid, storeID, narrow, page, productsPerPage, withAttributes, collectionID, searchWithinSearch, visualMerchandising, query }: any) => Promise<import("@fast-simon/utilities").Facet[]>;
|
|
10
|
-
getReasoningFullTextSearch: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context }: fullTextSearchProps) => Promise<FullTextServerResponseAll>;
|
|
11
|
-
getReasoningFullTextSearchProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context }: fullTextSearchProps) => Promise<FullTextServerResponseAll>;
|
|
10
|
+
getReasoningFullTextSearch: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context, variation_id }: fullTextSearchProps) => Promise<FullTextServerResponseAll>;
|
|
11
|
+
getReasoningFullTextSearchProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context, variation_id }: fullTextSearchProps) => Promise<FullTextServerResponseAll>;
|
|
12
12
|
};
|
|
13
13
|
export declare const transformFacetsOnlyData: (r: ServerFacet[], avoidTagPrefixes?: string) => import("@fast-simon/utilities").Facet[];
|
package/dist/services/search.js
CHANGED
|
@@ -63,7 +63,7 @@ export const FullTextSearch = {
|
|
|
63
63
|
const res = yield fastSimonGet(BASE_URL, '/search/full_text_search_editor', params);
|
|
64
64
|
return transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes);
|
|
65
65
|
}),
|
|
66
|
-
getReasoningFullTextSearch: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context }) => {
|
|
66
|
+
getReasoningFullTextSearch: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context, variation_id }) => {
|
|
67
67
|
var _a;
|
|
68
68
|
var internal_url = getInternalURL();
|
|
69
69
|
if (internal_url == "") {
|
|
@@ -76,7 +76,7 @@ export const FullTextSearch = {
|
|
|
76
76
|
const params = Object.assign(Object.assign({ site_key: siteKey,
|
|
77
77
|
// UUID: uuid,
|
|
78
78
|
// store_id: storeID,
|
|
79
|
-
cdn_cache_key: cdn, facets_required: facetRequired, q: term, page_num: page, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, custom_sort_settings: JSON.stringify(custom_sort_settings), with_product_analytics: with_product_analytics ? true : undefined, market_context: market_context || undefined });
|
|
79
|
+
cdn_cache_key: cdn, facets_required: facetRequired, q: term, page_num: page, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, custom_sort_settings: JSON.stringify(custom_sort_settings), with_product_analytics: with_product_analytics ? true : undefined, market_context: market_context || undefined, variation_id: variation_id || undefined });
|
|
80
80
|
if (getLSVectorSearchOn()) {
|
|
81
81
|
params["hybrid_search_settings"] = (_a = getLSVectorSearchDict()) !== null && _a !== void 0 ? _a : undefined;
|
|
82
82
|
}
|
|
@@ -86,7 +86,7 @@ export const FullTextSearch = {
|
|
|
86
86
|
params,
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
|
-
getReasoningFullTextSearchProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context }) => {
|
|
89
|
+
getReasoningFullTextSearchProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, withAttributes, recent, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context, variation_id }) => {
|
|
90
90
|
var _a;
|
|
91
91
|
var internal_url = getInternalURL();
|
|
92
92
|
if (internal_url == "") {
|
|
@@ -99,7 +99,7 @@ export const FullTextSearch = {
|
|
|
99
99
|
const params = Object.assign(Object.assign({ site_key: siteKey,
|
|
100
100
|
// UUID: uuid,
|
|
101
101
|
// store_id: storeID,
|
|
102
|
-
cdn_cache_key: cdn, facets_required: facetRequired, q: term, page_num: page, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, ids_only: 1, custom_sort_settings: JSON.stringify(custom_sort_settings), market_context: market_context || undefined });
|
|
102
|
+
cdn_cache_key: cdn, facets_required: facetRequired, q: term, page_num: page, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, ids_only: 1, custom_sort_settings: JSON.stringify(custom_sort_settings), market_context: market_context || undefined, variation_id: variation_id || undefined });
|
|
103
103
|
if (getLSVectorSearchOn()) {
|
|
104
104
|
params["hybrid_search_settings"] = (_a = getLSVectorSearchDict()) !== null && _a !== void 0 ? _a : undefined;
|
|
105
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/services/search.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAG7D,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG;IACtB,iBAAiB,EAAE,CAAO,EACM,IAAI,EACJ,OAAO,EACP,aAAa,EACb,MAAM,EACN,IAAI,EACJ,eAAe,EACf,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACT,EAAE,EAAE;QAElC,MAAM,MAAM,GAAwB;YAChC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,OAAO;YACjB,eAAe,EAAE,CAAC;YAClB,CAAC,EAAE,kBAAkB,IAAI,KAAK;YAC9B,QAAQ,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,CAAC;YACnB,uBAAuB,EAAE,cAAc;YACvC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC9B,iBAAiB,EAAE,eAAe;YAClC,oBAAoB,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,UAAU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CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,EACzC,2BAA2B,EAAC,2BAA2B,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,EAC3D,gBAAgB,EAAC,gBAAgB,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,EACrC,QAAQ,EAAC,CAAC,EACV,oBAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,EACzD,cAAc,EAAE,cAAc,IAAI,SAAS,GAC9C,CAAC;QAGF,IAAG,mBAAmB,EAAE,EACxB;YACI,MAAM,CAAC,wBAAwB,CAAC,GAAG,MAAA,qBAAqB,EAAE,mCAAE,SAAS,CAAC;SACzE;QACD,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QAC3D,OAAO,GAAG,CAAC,GAAG,CAA4B;YACtC,GAAG,EAAE,GAAG,YAAY,0BAA0B;YAC9C,MAAM;SACT,CAAC,CAAC;IAEP,CAAC;CACJ,CACJ;AACD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAgB,EAAE,gBAAyB,EAAE,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {CategoryNavigationResponse} from \"../@types/categoriesNavigation\";\nimport {API, fastSimonGet} from \"./API\";\nimport {FacetsParser, ServerFacet} from \"@fast-simon/utilities\"\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../@types/results\";\nimport {getLSVectorSearchDict, getLSVectorSearchOn} from \"../utils/getLSVectorSearch\";\nimport {getInternalURL} from \"../utils/getInternalURL\";\nimport {getUseCacheSetting} from \"../utils/getCacheSettings\";\n\n\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\n\nexport const FullTextSearch = {\n getFullTextSearch: async ({\n uuid,\n storeID,\n facetRequired,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n query,\n searchWithinSearch,\n visualMerchandising,\n lastProduct\n }: any) => {\n\n const params: Record<string, any> = {\n UUID: uuid,\n store_id: storeID,\n facets_required: 1,\n q: searchWithinSearch || query,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrow),\n products_per_page: productsPerPage,\n visual_merchandising: !searchWithinSearch ? JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']') : undefined\n };\n if(lastProduct) {\n params['last_product'] = lastProduct\n }\n const res = await API.post<CategoryNavigationResponse>({url: BASE_URL+'/search/full_text_search_editor', data: params, config: {headers: {'content-type': 'text/plain'}}});\n return {\n data: res,\n getFacets: async () => (res?.facets_completed ? transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes) : await FullTextSearch.fullTextFacetsOnly({ uuid,\n storeID,\n facetRequired,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n searchWithinSearch,\n visualMerchandising,\n lastProduct,\n query})\n )\n };\n },\n fullTextFacetsOnly: async ({\n uuid,\n storeID,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n collectionID,\n searchWithinSearch,\n visualMerchandising,\n query\n }: any) => {\n\n const params: Record<string, any> = {\n UUID: uuid,\n store_id: storeID,\n facets_required: 2,\n q: query,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrow),\n products_per_page: productsPerPage,\n search_within_search: searchWithinSearch,\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']')\n };\n\n const res = await fastSimonGet<CategoryNavigationResponse>(BASE_URL, '/search/full_text_search_editor', params);\n\n return transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes);\n },\n getReasoningFullTextSearch: ({\n uuid, storeID, siteKey,cdn,\n facetRequired, narrowBy, page,\n productsPerPage, term, sortBy\n , withAttributes, recent, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, with_product_analytics, market_context\n }: fullTextSearchProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params: Record<string, any> = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n q: term,\n page_num: page,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n with_product_analytics: with_product_analytics ? true : undefined,\n market_context: market_context || undefined\n };\n\n\n if(getLSVectorSearchOn())\n {\n params[\"hybrid_search_settings\"] = getLSVectorSearchDict()??undefined;\n }\n params[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<FullTextServerResponseAll>({\n url: `${internal_url}/search/full_text_search_reasoning`,\n params,\n });\n\n },\n getReasoningFullTextSearchProductsIds: ({\n uuid, storeID, siteKey,cdn,\n facetRequired, narrowBy, page,\n productsPerPage, term, sortBy\n , withAttributes, recent, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, market_context\n }: fullTextSearchProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params: Record<string, any> = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n q: term,\n page_num: page,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n ids_only:1,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n market_context: market_context || undefined\n };\n\n\n if(getLSVectorSearchOn())\n {\n params[\"hybrid_search_settings\"] = getLSVectorSearchDict()??undefined;\n }\n params[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<FullTextServerResponseAll>({\n url: `${internal_url}/search/full_text_search`,\n params,\n });\n\n },\n }\n;\nexport const transformFacetsOnlyData = (r: ServerFacet[], avoidTagPrefixes?: string) => new FacetsParser().parseFacets(r, avoidTagPrefixes ? avoidTagPrefixes.split(\",\") : []);"]}
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/services/search.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,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,SAAS,CAAC;SACzE;QACD,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QAC3D,OAAO,GAAG,CAAC,GAAG,CAA4B;YACtC,GAAG,EAAE,GAAG,YAAY,0BAA0B;YAC9C,MAAM;SACT,CAAC,CAAC;IAEP,CAAC;CACJ,CACJ;AACD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAgB,EAAE,gBAAyB,EAAE,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import {CategoryNavigationResponse} from \"../@types/categoriesNavigation\";\nimport {API, fastSimonGet} from \"./API\";\nimport {FacetsParser, ServerFacet} from \"@fast-simon/utilities\"\nimport {fullTextSearchProps, FullTextServerResponseAll} from \"../@types/results\";\nimport {getLSVectorSearchDict, getLSVectorSearchOn} from \"../utils/getLSVectorSearch\";\nimport {getInternalURL} from \"../utils/getInternalURL\";\nimport {getUseCacheSetting} from \"../utils/getCacheSettings\";\n\n\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\n\nexport const FullTextSearch = {\n getFullTextSearch: async ({\n uuid,\n storeID,\n facetRequired,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n query,\n searchWithinSearch,\n visualMerchandising,\n lastProduct\n }: any) => {\n\n const params: Record<string, any> = {\n UUID: uuid,\n store_id: storeID,\n facets_required: 1,\n q: searchWithinSearch || query,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrow),\n products_per_page: productsPerPage,\n visual_merchandising: !searchWithinSearch ? JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']') : undefined\n };\n if(lastProduct) {\n params['last_product'] = lastProduct\n }\n const res = await API.post<CategoryNavigationResponse>({url: BASE_URL+'/search/full_text_search_editor', data: params, config: {headers: {'content-type': 'text/plain'}}});\n return {\n data: res,\n getFacets: async () => (res?.facets_completed ? transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes) : await FullTextSearch.fullTextFacetsOnly({ uuid,\n storeID,\n facetRequired,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n searchWithinSearch,\n visualMerchandising,\n lastProduct,\n query})\n )\n };\n },\n fullTextFacetsOnly: async ({\n uuid,\n storeID,\n narrow,\n page,\n productsPerPage,\n withAttributes,\n collectionID,\n searchWithinSearch,\n visualMerchandising,\n query\n }: any) => {\n\n const params: Record<string, any> = {\n UUID: uuid,\n store_id: storeID,\n facets_required: 2,\n q: query,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrow),\n products_per_page: productsPerPage,\n search_within_search: searchWithinSearch,\n visual_merchandising: JSON.stringify(visualMerchandising).replaceAll('\"[', '[').replaceAll(']\"', ']')\n };\n\n const res = await fastSimonGet<CategoryNavigationResponse>(BASE_URL, '/search/full_text_search_editor', params);\n\n return transformFacetsOnlyData(res.facets, res.avoid_tag_prefixes);\n },\n getReasoningFullTextSearch: ({\n uuid, storeID, siteKey,cdn,\n facetRequired, narrowBy, page,\n productsPerPage, term, sortBy\n , withAttributes, recent, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, with_product_analytics, market_context, variation_id\n }: fullTextSearchProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params: Record<string, any> = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n q: term,\n page_num: page,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n with_product_analytics: with_product_analytics ? true : undefined,\n market_context: market_context || undefined,\n variation_id: variation_id || undefined\n };\n\n\n if(getLSVectorSearchOn())\n {\n params[\"hybrid_search_settings\"] = getLSVectorSearchDict()??undefined;\n }\n params[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<FullTextServerResponseAll>({\n url: `${internal_url}/search/full_text_search_reasoning`,\n params,\n });\n\n },\n getReasoningFullTextSearchProductsIds: ({\n uuid, storeID, siteKey,cdn,\n facetRequired, narrowBy, page,\n productsPerPage, term, sortBy\n , withAttributes, recent, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, market_context, variation_id\n }: fullTextSearchProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params: Record<string, any> = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n q: term,\n page_num: page,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n ids_only:1,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n market_context: market_context || undefined,\n variation_id: variation_id || undefined\n };\n\n\n if(getLSVectorSearchOn())\n {\n params[\"hybrid_search_settings\"] = getLSVectorSearchDict()??undefined;\n }\n params[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<FullTextServerResponseAll>({\n url: `${internal_url}/search/full_text_search`,\n params,\n });\n\n },\n }\n;\nexport const transformFacetsOnlyData = (r: ServerFacet[], avoidTagPrefixes?: string) => new FacetsParser().parseFacets(r, avoidTagPrefixes ? avoidTagPrefixes.split(\",\") : []);"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { smartCollectionsProps, smartCollectionsResults } from "../@types/categories";
|
|
2
2
|
export declare const SmartCollections: {
|
|
3
|
-
getSmartCollections: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context }: smartCollectionsProps) => Promise<smartCollectionsResults>;
|
|
4
|
-
getSmartCollectionsProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context }: smartCollectionsProps) => Promise<smartCollectionsResults>;
|
|
3
|
+
getSmartCollections: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context, variation_id }: smartCollectionsProps) => Promise<smartCollectionsResults>;
|
|
4
|
+
getSmartCollectionsProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context, variation_id }: smartCollectionsProps) => Promise<smartCollectionsResults>;
|
|
5
5
|
};
|
|
@@ -3,7 +3,7 @@ import { getInternalURL } from "../utils/getInternalURL";
|
|
|
3
3
|
import { getUseCacheSetting } from "../utils/getCacheSettings";
|
|
4
4
|
const BASE_URL = "https://internal-v3joil6oqa-uc.a.run.app";
|
|
5
5
|
export const SmartCollections = {
|
|
6
|
-
getSmartCollections: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context }) => {
|
|
6
|
+
getSmartCollections: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, with_product_analytics, market_context, variation_id }) => {
|
|
7
7
|
var internal_url = getInternalURL();
|
|
8
8
|
if (internal_url == "") {
|
|
9
9
|
internal_url = BASE_URL;
|
|
@@ -15,14 +15,14 @@ export const SmartCollections = {
|
|
|
15
15
|
const params = Object.assign(Object.assign({ site_key: siteKey,
|
|
16
16
|
// UUID: uuid,
|
|
17
17
|
// store_id: storeID,
|
|
18
|
-
cdn_cache_key: cdn, facets_required: facetRequired, category_id: categoryID, page_num: page !== null && page !== void 0 ? page : 1, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, custom_sort_settings: JSON.stringify(custom_sort_settings), with_product_analytics: with_product_analytics ? true : undefined, market_context: market_context || undefined });
|
|
18
|
+
cdn_cache_key: cdn, facets_required: facetRequired, category_id: categoryID, page_num: page !== null && page !== void 0 ? page : 1, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, custom_sort_settings: JSON.stringify(custom_sort_settings), with_product_analytics: with_product_analytics ? true : undefined, market_context: market_context || undefined, variation_id: variation_id || undefined });
|
|
19
19
|
params["segments"] = JSON.stringify(segments) || undefined;
|
|
20
20
|
return API.get({
|
|
21
21
|
url: `${internal_url}/categories_navigation_reasoning`,
|
|
22
22
|
params,
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
|
-
getSmartCollectionsProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context }) => {
|
|
25
|
+
getSmartCollectionsProductsIds: ({ uuid, storeID, siteKey, cdn, facetRequired, narrowBy, page, productsPerPage, sortBy, withAttributes, categoryID, recent, rec, searchWithinSearch, segments, disable_semantics, disable_merchandising, disable_strategies, disable_turbolinks, disable_merchandising_rules, disable_antonyms, custom_sort_settings, market_context, variation_id }) => {
|
|
26
26
|
var internal_url = getInternalURL();
|
|
27
27
|
if (internal_url == "") {
|
|
28
28
|
internal_url = BASE_URL;
|
|
@@ -34,7 +34,7 @@ export const SmartCollections = {
|
|
|
34
34
|
const params = Object.assign(Object.assign({ site_key: siteKey,
|
|
35
35
|
// UUID: uuid,
|
|
36
36
|
// store_id: storeID,
|
|
37
|
-
cdn_cache_key: cdn, facets_required: facetRequired, category_id: categoryID, page_num: page !== null && page !== void 0 ? page : 1, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, ids_only: 1, custom_sort_settings: JSON.stringify(custom_sort_settings), market_context: market_context || undefined });
|
|
37
|
+
cdn_cache_key: cdn, facets_required: facetRequired, category_id: categoryID, page_num: page !== null && page !== void 0 ? page : 1, with_product_attributes: withAttributes, narrow: JSON.stringify(narrowBy), products_per_page: productsPerPage, sort_by: sortBy, sp: recent }, (!use_cache ? { m: 1 } : {})), { search_within_search: searchWithinSearch, st: JSON.stringify(segments) || undefined, disable_semantics: disable_semantics ? 1 : 0, disable_merchandising: disable_merchandising ? 1 : 0, disable_strategies: disable_strategies ? 1 : 0, disable_turbolinks: disable_turbolinks ? 1 : 0, disable_merchandising_rules: disable_merchandising_rules ? 1 : 0, disable_antonyms: disable_antonyms ? 1 : 0, ids_only: 1, custom_sort_settings: JSON.stringify(custom_sort_settings), market_context: market_context || undefined, variation_id: variation_id || undefined });
|
|
38
38
|
params["segments"] = JSON.stringify(segments) || undefined;
|
|
39
39
|
return API.get({
|
|
40
40
|
url: `${internal_url}/categories_navigation`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartCollections.js","sourceRoot":"","sources":["../../src/services/smartCollections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAG5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IACxB,mBAAmB,EAAE,CAAC,EACI,IAAI,EAAE,OAAO,EAAC,OAAO,EAAE,GAAG,EAC1B,aAAa,EAAE,QAAQ,EAAE,IAAI,EAC7B,eAAe,EAAE,MAAM,EACrB,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,QAAQ,EACvE,iBAAiB,EAAC,qBAAqB,EAAC,kBAAkB,EAAC,kBAAkB,EAAC,2BAA2B,EAAC,gBAAgB,EAC1H,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"smartCollections.js","sourceRoot":"","sources":["../../src/services/smartCollections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAG5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IACxB,mBAAmB,EAAE,CAAC,EACI,IAAI,EAAE,O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C,YAAY,EAAE,YAAY,IAAI,SAAS,GAE1C,CAAC;QAED,MAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QACpE,OAAO,GAAG,CAAC,GAAG,CAA0B;YACpC,GAAG,EAAE,GAAG,YAAY,wBAAwB;YAC5C,MAAM;SACT,CAAC,CAAC;IACP,CAAC;CACJ,CACJ","sourcesContent":["import {API} from \"./API\";\nimport {smartCollectionsProps, smartCollectionsResults} from \"../@types/categories\";\nimport {getInternalURL} from \"../utils/getInternalURL\";\nimport {getUseCacheSetting} from \"../utils/getCacheSettings\";\n\nconst BASE_URL = \"https://internal-v3joil6oqa-uc.a.run.app\";\n\n\nexport const SmartCollections = {\n getSmartCollections: ({\n uuid, storeID,siteKey, cdn,\n facetRequired, narrowBy, page,\n productsPerPage, sortBy\n , withAttributes, categoryID, recent, rec, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, with_product_analytics, market_context, variation_id\n }: smartCollectionsProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n category_id: categoryID,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n st: JSON.stringify(segments)||undefined,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n with_product_analytics: with_product_analytics ? true : undefined,\n market_context: market_context || undefined,\n variation_id: variation_id || undefined\n\n };\n\n (params as any)[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<smartCollectionsResults>({\n url: `${internal_url}/categories_navigation_reasoning`,\n params,\n });\n },\n getSmartCollectionsProductsIds: ({\n uuid, storeID,siteKey, cdn,\n facetRequired, narrowBy, page,\n productsPerPage, sortBy\n , withAttributes, categoryID, recent, rec, searchWithinSearch, segments,\n disable_semantics,disable_merchandising,disable_strategies,disable_turbolinks,disable_merchandising_rules,disable_antonyms,\n custom_sort_settings, market_context, variation_id\n }: smartCollectionsProps) => {\n var internal_url=getInternalURL();\n if(internal_url==\"\")\n {\n internal_url=BASE_URL;\n }\n\n // Cache setting: Controls whether 'm' param is added to request\n // When true (default): omit 'm' - backend uses cache for faster responses\n // When false: add 'm: 1' - backend forces fresh data (useful for debugging)\n const use_cache = getUseCacheSetting();\n\n const params = {\n site_key:siteKey,\n // UUID: uuid,\n // store_id: storeID,\n cdn_cache_key: cdn,\n facets_required: facetRequired,\n category_id: categoryID,\n page_num: page ?? 1,\n with_product_attributes: withAttributes,\n narrow: JSON.stringify(narrowBy),\n products_per_page: productsPerPage,\n sort_by: sortBy,\n sp: recent,\n ...(!use_cache ? { m: 1 } : {}),\n search_within_search: searchWithinSearch,\n st: JSON.stringify(segments)||undefined,\n disable_semantics:disable_semantics?1:0,\n disable_merchandising:disable_merchandising?1:0,\n disable_strategies:disable_strategies?1:0,\n disable_turbolinks:disable_turbolinks?1:0,\n disable_merchandising_rules:disable_merchandising_rules?1:0,\n disable_antonyms:disable_antonyms?1:0,\n ids_only:1,\n custom_sort_settings:JSON.stringify(custom_sort_settings),\n market_context: market_context || undefined,\n variation_id: variation_id || undefined\n\n };\n\n (params as any)[\"segments\"] = JSON.stringify(segments) || undefined;\n return API.get<smartCollectionsResults>({\n url: `${internal_url}/categories_navigation`,\n params,\n });\n },\n }\n;"]}
|