import{b as e,e as t,c as i}from"./p-1b562ffa.js";import"./p-06444484.js";function o(i,o){return{klevuModifierId:"sendMerchandisingViewEvent",onResult:(n,r)=>{var s,d,a,c;if(!r.params){return n}const{id:u,abtest:l}=r.params;if(r.klevuFunctionId!=="categoryMerchandising"||!u){return n}const v=(s=r.queries)===null||s===void 0?void 0:s.find((e=>{var t,i;return Boolean((i=(t=e.settings)===null||t===void 0?void 0:t.query)===null||i===void 0?void 0:i.categoryPath)}));const g=(c=(a=(d=v===null||v===void 0?void 0:v.settings)===null||d===void 0?void 0:d.query)===null||a===void 0?void 0:a.categoryPath)!==null&&c!==void 0?c:"unknown";const f=n.queriesById(u);if(!f){return n}e.categoryMerchandisingView({categoryTitle:i,klevuCategory:g,products:f.records,pageStartsFrom:f.meta.offset,abTestId:l===null||l===void 0?void 0:l.abTestId,abTestVariantId:l===null||l===void 0?void 0:l.abTestVariantId,activeFilters:t(f),override:o});return n}}}const n={id:"categoryMerchandising",searchTerm:"*",limit:24};function r(e,t,...o){const r=Object.assign(Object.assign({},n),t);const s={id:r.id,typeOfRequest:i.CategoryNavigation,settings:Object.assign({query:{categoryPath:e,term:r.searchTerm}},r)};return{klevuFunctionId:"categoryMerchandising",queries:[s],modifiers:o,params:Object.assign(Object.assign({},r),{category:e})}}export{r as c,o as s};
//# sourceMappingURL=p-33229f10.js.map