import"./p-c2e91ee8.js";import{f as n,g as i}from"./p-d0bfb1d8.js";var e=undefined&&undefined.__awaiter||function(n,i,e,o){function t(n){return n instanceof e?n:new e((function(i){i(n)}))}return new(e||(e=Promise))((function(e,r){function c(n){try{d(o.next(n))}catch(n){r(n)}}function f(n){try{d(o["throw"](n))}catch(n){r(n)}}function d(n){n.done?e(n.value):t(n.value).then(c,f)}d((o=o.apply(n,i||[])).next())}))};function o(o){return{klevuModifierId:"personalisation",modifyAfter:(t,r)=>e(this,void 0,void 0,(function*(){var e;const c=Array.from(t);for(const c of t){if(!c.settings){c.settings={}}c.settings.personalisation={enablePersonalisation:true,fields:o===null||o===void 0?void 0:o.fields};let t=[];if(o===null||o===void 0?void 0:o.lastClickedProductIds){t=o.lastClickedProductIds.map((n=>({id:n})))}else if(r.klevuFunctionId==="categoryMerchandising"&&((e=r.params)===null||e===void 0?void 0:e.category)){const{category:i}=r.params;t=n.getCategoryPersonalisationIds(i).map((n=>({id:n})))}else{t=n.getLastClickedLatestsFirst().map((n=>({id:n})))}c.settings.context={recentObjects:[{typeOfRecord:i.Product,records:t}]}}return c}))}}export{o as p};
//# sourceMappingURL=p-cad738c9.js.map