"use strict";exports.id=9117,exports.ids=[9117],exports.modules={65345:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var i=r(16689),n=r.n(i),s=r(52182),o=r(98668),c=r(68687),l=r(41123),u=r(20997),f=e([l]);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}l=(f.then?(await f)():f)[0];let p=[{value:"productByName",label:"Product Name",onChange:e=>e.sort((e,t)=>e.name.localeCompare(t.name))},{value:"productByPrice",label:"Price",onChange:e=>e.sort((e,t)=>e.offers.lowPrice-t.offers.lowPrice)}],__WEBPACK_DEFAULT_EXPORT__=function(e){let{productIds:t,products:r,isOpen:a,handleProductsComparison:i}=(0,s.S)(),[f,d]=n().useState(null),[m,y]=n().useState({currentTarget:{},preventDefault:()=>{}}),P=n().useMemo(()=>r.map(e=>{let{id:t,sku:r,gtin:a,unitMultiplier:i,name:n,brand:s,isVariantOf:o,image:c,additionalProperty:l,offers:{offers:[{price:u,priceWithTaxes:p,listPrice:d,seller:m,quantity:y,listPriceWithTaxes:P}]}}=e;return{id:t,price:u,priceWithTaxes:p,listPrice:d,listPriceWithTaxes:P,seller:m,quantity:f===t?1:0,itemOffered:{sku:r,name:n,gtin:a,image:c,brand:s,isVariantOf:o,additionalProperty:l,unitMultiplier:i}}}).filter(e=>e.quantity>0),[r,f]),b=(0,c.Q)(P);return n().useEffect(()=>{f&&b.onClick(m)},[f,m]),(0,l.n)(t,a,function(e){let t=e.products.map(e=>{let t=e.skuSpecifications.map(e=>({field:e.field.name,values:e.values.map(e=>e.name)}));return{slug:e.slug,sku:e.sku,name:e.name,gtin:e.gtin,id:e.id,unitMultiplier:e.unitMultiplier,brand:{name:e.brand.name,brandName:e.brand.name},isVariantOf:{productGroupID:e.isVariantOf.productGroupID,name:e.isVariantOf.name,skuVariants:e.isVariantOf.skuVariants},image:e.image,offers:{lowPrice:e.offers.lowPrice,lowPriceWithTaxes:e.offers.lowPriceWithTaxes,offers:e.offers.offers.map(e=>({availability:e.availability,price:e.price,listPrice:e.listPrice,listPriceWithTaxes:e.listPriceWithTaxes,priceWithTaxes:e.priceWithTaxes,quantity:e.quantity,seller:{identifier:e.seller.identifier}}))},additionalProperty:e.additionalProperty.map(e=>({propertyID:e.propertyID,name:e.name,value:e.value,valueReference:e.valueReference})),advertisement:e.advertisement,hasSpecifications:e.hasSpecifications,skuSpecifications:t}});i(t)}),u.jsx(o.Z,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({handleProductToBuy:d,setPendingEvent:y,sortOptions:[...p]},e))};a()}catch(e){a(e)}})},29117:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.r(t),r.d(t,{default:()=>i.Z});var i=r(65345),n=e([i]);i=(n.then?(await n)():n)[0],a()}catch(e){a(e)}})},41123:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{n:()=>useProductsSelected});var i=r(25487),n=r(52693),s=r(97358),o=r(16689),c=e([n]);n=(c.then?(await c)():c)[0];let l=i.cD,useProductsSelected=(e,t,r)=>{let{channel:a,locale:i}=(0,s.kP)(),c=(0,o.useMemo)(()=>{if(!a)throw Error("useProductsSelected: 'channel' from session is an empty string.");return{productIds:e}},[a,i,e]);return(0,n.aM)(l,c,{doNotRun:t,onSuccess:e=>r(e)})};a()}catch(e){a(e)}})}};