1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,945140,(e,t,r)=>{(function(){"use strict";function e(e){for(var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r={speed:500,minDuration:250,maxDuration:1500,cancelOnUserAction:!0,element:window,horizontal:!1,onComplete:void 0,passive:!0,offset:0},i=Object.keys(r),a=0;a<i.length;a++){var s=i[a];void 0!==t[s]&&(r[s]=t[s])}!r.cancelOnUserAction&&r.passive&&(r.passive=!1,t.passive&&console&&console.warn('animated-scroll-to:\n "passive" was set to "false" to prevent errors, as using "cancelOnUserAction: false" doesn\'t work with passive events.')),e instanceof HTMLElement&&(e=t.element&&t.element instanceof HTMLElement?r.horizontal?e.getBoundingClientRect().left+t.element.scrollLeft-t.element.getBoundingClientRect().left:e.getBoundingClientRect().top+t.element.scrollTop-t.element.getBoundingClientRect().top:r.horizontal?(window.scrollX||document.documentElement.scrollLeft)+e.getBoundingClientRect().left:(window.scrollY||document.documentElement.scrollTop)+e.getBoundingClientRect().top),e+=r.offset,r.isWindow=r.element===window;var l=null,n=0,o=null;r.isWindow?r.horizontal?(l=window.scrollX||document.documentElement.scrollLeft,n=window.scrollY||document.documentElement.scrollTop,o=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth)-window.innerWidth):(l=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft,o=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight):r.horizontal?(l=r.element.scrollLeft,o=r.element.scrollWidth-r.element.clientWidth):(l=r.element.scrollTop,o=r.element.scrollHeight-r.element.clientHeight),e>o&&(e=o);var d=e-l;if(0===d){r.onComplete&&"function"==typeof r.onComplete&&r.onComplete();return}var c=Math.abs(Math.round(d/1e3*r.speed));c<r.minDuration?c=r.minDuration:c>r.maxDuration&&(c=r.maxDuration);var u=Date.now(),m=null,p=null,g={passive:r.passive};r.cancelOnUserAction?(p=function(){x(),cancelAnimationFrame(m)},window.addEventListener("keydown",p,g),window.addEventListener("mousedown",p,g)):(p=function(e){e.preventDefault()},window.addEventListener("scroll",p,g)),window.addEventListener("wheel",p,g),window.addEventListener("touchstart",p,g);var x=function(){window.removeEventListener("wheel",p,g),window.removeEventListener("touchstart",p,g),r.cancelOnUserAction?(window.removeEventListener("keydown",p,g),window.removeEventListener("mousedown",p,g)):window.removeEventListener("scroll",p,g)},h=function(){var t=Date.now()-u,i=t/c-1,a=Math.round(l+d*(i*i*i+1)),s=function(e){r.isWindow?r.horizontal?r.element.scrollTo(e,n):r.element.scrollTo(n,e):r.horizontal?r.element.scrollLeft=e:r.element.scrollTop=e};t<c&&a!==e?(s(a),m=requestAnimationFrame(h)):(s(e),cancelAnimationFrame(m),x(),r.onComplete&&"function"==typeof r.onComplete&&r.onComplete())};m=requestAnimationFrame(h)}t.exports&&(t.exports=e,r=t.exports),r.default=e}).call(e.e)},189257,e=>{"use strict";let t=(0,e.i(205270).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],189257)},377216,e=>{"use strict";let t=(0,e.i(205270).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],377216)},131464,e=>{"use strict";let t=(0,e.i(205270).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
1],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],131464)},909725,e=>{"use strict";let t=(0,e.i(205270).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],909725)},341597,e=>{"use strict";var t=e.i(391398),r=e.i(435642),i=e.i(620147),a=e.i(307932);let s="ds-price",l={s:{integer:"font-bold text-[15px] leading-[20px]",decimals:"font-bold text-[9.675px] leading-[20px]",currency:"font-normal text-80 leading-[18px]",original:"text-80 leading-200"},m:{integer:"font-bold text-400 leading-[28px]",decimals:"font-bold text-[12.9px] leading-[28px]",currency:"font-normal text-80 leading-[18px]",original:"text-80 leading-200"},l:{integer:"font-bold text-[22px] leading-[30px]",decimals:"font-bold text-[12.9px] leading-[30px]",currency:"font-normal text-80 leading-[18px]",original:"text-100 leading-300"}};e.s(["Price",0,({price:e,currency:n,originalPrice:o=null,saleStyle:d=null,discountBadge:c=null,size:u="m",isApproximate:m=!1,className:p,"data-test":g=s})=>{let{ts:x}=(0,r.default)(),h=l[u],f=(0,i.usePriceAndDecimals)(e),v=(0,i.useSalePrice)(o),y=(0,i.useCurrencySymbol)(n);if(null==f.integer)return null;let b=!!Number(f.decimals),C=!!(null==d?void 0:d.backgroundColor)&&"transparent"!==d.backgroundColor;return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-start gap-50",p),"data-test":g,children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-100",children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-baseline gap-25 rounded-small",{"px-50":C}),style:{color:(null==d?void 0:d.textColor)??"var(--grey-90)",backgroundColor:(null==d?void 0:d.backgroundColor)??"transparent"},"data-test":"ds-price-chip",children:[m&&(0,t.jsx)("span",{className:"font-semibold text-80 leading-[18px]","data-test":"ds-price-approx",children:x("product:semicaliber")}),(0,t.jsxs)("span",{className:"notranslate whitespace-nowrap",translate:"no",children:[(0,t.jsx)("span",{className:h.integer,"data-test":"ds-price-integer",children:f.integer}),b&&(0,t.jsx)("sup",{className:h.decimals,"data-test":"ds-price-decimals",children:f.decimals})]}),(0,t.jsx)("span",{className:h.currency,"data-test":"ds-price-currency",children:y})]}),null!=v&&null!=o&&o!==e&&(0,t.jsx)("span",{className:(0,a.cn)("notranslate whitespace-nowrap text-grey-70 line-through",h.original),translate:"no","data-test":"ds-price-original",children:`${v} ${y}`})]}),c&&(0,t.jsxs)("div",{className:"inline-flex items-center gap-50 whitespace-nowrap rounded-small px-[6px] font-semibold text-80 leading-[18px]",style:{backgroundColor:c.backgroundColor,color:c.textColor},"data-test":"ds-price-badge",children:[c.icon&&(0,t.jsx)("img",{alt:"","aria-hidden":"true",src:c.icon,width:16,height:16}),(0,t.jsx)("span",{children:c.text}),c.trailingIcon&&(0,t.jsx)("img",{alt:c.trailingIconLabel??"",src:c.trailingIcon,width:33,height:16})]})]})}],341597)},849921,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(222062);let a={xs:1,sm:2,md:4,lg:8,xl:16,xxl:32,xxxl:64};var s=e.i(307932);let l={xs:"",sm:"xs",md:"sm",lg:"ml",xl:"lg",xxl:"xl",xxxl:"2xl"},n={row:{"":"flex-row",xs:"xs:flex-row",sm:"sm:flex-row",ml:"ml:flex-row",lg:"lg:flex-row",xl:"xl:flex-row","2xl":"2xl:flex-row"},column:{"":"flex-col",xs:"xs:flex-col",sm:"sm:flex-col",ml:"ml:flex-col",lg:"lg:flex-col",xl:"xl:flex-col","2xl":"2xl:flex-col"}},o={center:{"":"items-center",xs:"xs:items-center",sm:"sm:items-center",ml:"ml:items-center",lg:"lg:items-center",xl:"xl:items-center","2xl":"2xl:items-center"},stretch:{"":"items-stretch",xs:"xs:items-stretch",sm:"sm:items-stretch",ml:"ml:items-stretch",lg:"lg:items-stretch",xl:"xl:items-stretch","2xl":"2xl:items-stretch"},"flex-start":{"":"items-start",xs:"xs:items-start",sm:"sm:items-start",ml:"ml:items-start",lg:"lg:items-start",xl:"xl:items-start","2xl":"2xl:items-start"},"flex-end":{"":"items-end",xs:"xs:items-end",sm:"sm:items-end",ml:"ml:items-end",lg:"lg:items-end",xl:"xl:items-end","2xl":"2xl:items-end"}},d={center:{"":"justify-center",xs:"xs:justify-center",sm:"sm:justify-center",ml:"ml:justify-center",lg:"lg:justify-center",xl:"xl:justify-center","2xl":"2xl:justify-center"},"flex-start":{"":"justify-start",xs:"xs:justify-start",sm:"sm:justify-start",ml:"ml:justify-start",lg:"lg:justify-start",xl:"xl:justify-start","2xl":"2xl:justify-start"},"flex-end":{"":"justify-end",xs:"xs:justify-end",sm:"sm:justify-end",ml:"ml:justify-end",lg:"lg:justify-end",xl:"xl:justify-end","2xl":"2xl:justify-end"},"space-between":{"":"justify-between",xs:"xs:justify-between",sm:"sm:justify-between",ml:"ml:justify-between",lg:"lg:justify-between",xl:"xl:justify-between","2xl":"2xl:justify-between"}},c={25:{"":"gap-25",xs:"xs:gap-25",sm:"sm:gap-25",ml:"ml:gap-25",lg:"lg:gap-25",xl:"xl:gap-25","2xl":"2xl:gap-25"},50:{"":"gap-50",xs:"xs:gap-50",sm:"sm:gap-50",ml:"ml:gap-50",lg:"lg:gap-50",xl:"xl:gap-50","2xl":"2xl:gap-50"},100:{"":"gap-100",xs:"xs:gap-100",sm:"sm:gap-100",ml:"ml:gap-100",lg:"lg:gap-100",xl:"xl:gap-100","2xl":"2xl:gap-100"},150:{"":"gap-150",xs:"xs:gap-150",sm:"sm:gap-150",ml:"ml:gap-150",lg:"lg:gap-150",xl:"xl:gap-150","2xl":"2xl:gap-150"},200:{"":"gap-200",xs:"xs:gap-200",sm:"sm:gap-200",ml:"ml:gap-200",lg:"lg:gap-200",xl:"xl:gap-200","2xl":"2xl:gap-200"},250:{"":"gap-250",xs:"xs:gap-250",sm:"sm:gap-250",ml:"ml:gap-250",lg:"lg:gap-250",xl:"xl:gap-250","2xl":"2xl:gap-250"},300:{"":"gap-300",xs:"xs:gap-300",sm:"sm:gap-300",ml:"ml:gap-300",lg:"lg:gap-300",xl:"xl:gap-300","2xl":"2xl:gap-300"},400:{"":"gap-400",xs:"xs:gap-400",sm:"sm:gap-400",ml:"ml:gap-400",lg:"lg:gap-400",xl:"xl:gap-400","2xl":"2xl:gap-400"},500:{"":"gap-500",xs:"xs:gap-500",sm:"sm:gap-500",ml:"ml:gap-500",lg:"lg:gap-500",xl:"xl:gap-500","2xl":"2xl:gap-500"},600:{"":"gap-600",xs:"xs:gap-600",sm:"sm:gap-600",ml:"ml:gap-600",lg:"lg:gap-600",xl:"xl:gap-600","2xl":"2xl:gap-600"},700:{"":"gap-700",xs:"xs:gap-700",sm:"sm:gap-700",ml:"ml:gap-700",lg:"lg:gap-700",xl:"xl:gap-700","2xl":"2xl:gap-700"},800:{"":"gap-800",xs:"xs:gap-800",sm:"sm:gap-800",ml:"ml:gap-800",lg:"lg:gap-800",xl:"xl:gap-800","2xl":"2xl:gap-800"}},u={100:{"":"mt-100",xs:"xs:mt-100",sm:"sm:mt-100",ml:"ml:mt-100",lg:"lg:mt-100",xl:"xl:mt-100","2xl":"2xl:mt-100"},200:{"":"mt-200",xs:"xs:mt-200",sm:"sm:mt-200",ml:"ml:mt-200",lg:"lg:mt-200",xl:"xl:mt-200","2xl":"2xl:mt-200"},300:{"":"mt-300",xs:"xs:mt-300",sm:"sm:mt-300",ml:"ml:mt-300",lg:"lg:mt-300",xl:"xl:mt-300","2xl":"2xl:mt-300"},400:{"":"mt-400",xs:"xs:mt-400",sm:"sm:mt-400",ml:"ml:mt-400",lg:"lg:mt-400",xl:"xl:mt-400","2xl":"2xl:mt-400"},500:{"":"mt-500",xs:"xs:mt-500",sm:"sm:mt-500",ml:"ml:mt-500",lg:"lg:mt-500",xl:"xl:mt-500","2xl":"2xl:mt-500"}
1,600:{"":"mt-600",xs:"xs:mt-600",sm:"sm:mt-600",ml:"ml:mt-600",lg:"lg:mt-600",xl:"xl:mt-600","2xl":"2xl:mt-600"},700:{"":"mt-700",xs:"xs:mt-700",sm:"sm:mt-700",ml:"ml:mt-700",lg:"lg:mt-700",xl:"xl:mt-700","2xl":"2xl:mt-700"},800:{"":"mt-800",xs:"xs:mt-800",sm:"sm:mt-800",ml:"ml:mt-800",lg:"lg:mt-800",xl:"xl:mt-800","2xl":"2xl:mt-800"}},m={100:{"":"mb-100",xs:"xs:mb-100",sm:"sm:mb-100",ml:"ml:mb-100",lg:"lg:mb-100",xl:"xl:mb-100","2xl":"2xl:mb-100"},200:{"":"mb-200",xs:"xs:mb-200",sm:"sm:mb-200",ml:"ml:mb-200",lg:"lg:mb-200",xl:"xl:mb-200","2xl":"2xl:mb-200"},300:{"":"mb-300",xs:"xs:mb-300",sm:"sm:mb-300",ml:"ml:mb-300",lg:"lg:mb-300",xl:"xl:mb-300","2xl":"2xl:mb-300"},400:{"":"mb-400",xs:"xs:mb-400",sm:"sm:mb-400",ml:"ml:mb-400",lg:"lg:mb-400",xl:"xl:mb-400","2xl":"2xl:mb-400"},500:{"":"mb-500",xs:"xs:mb-500",sm:"sm:mb-500",ml:"ml:mb-500",lg:"lg:mb-500",xl:"xl:mb-500","2xl":"2xl:mb-500"},600:{"":"mb-600",xs:"xs:mb-600",sm:"sm:mb-600",ml:"ml:mb-600",lg:"lg:mb-600",xl:"xl:mb-600","2xl":"2xl:mb-600"},700:{"":"mb-700",xs:"xs:mb-700",sm:"sm:mb-700",ml:"ml:mb-700",lg:"lg:mb-700",xl:"xl:mb-700","2xl":"2xl:mb-700"},800:{"":"mb-800",xs:"xs:mb-800",sm:"sm:mb-800",ml:"ml:mb-800",lg:"lg:mb-800",xl:"xl:mb-800","2xl":"2xl:mb-800"}},p={"":"w-full [&>*]:shrink-0 [&>*]:grow [&>*]:basis-0",xs:"xs:w-full xs:[&>*]:shrink-0 xs:[&>*]:grow xs:[&>*]:basis-0",sm:"sm:w-full sm:[&>*]:shrink-0 sm:[&>*]:grow sm:[&>*]:basis-0",ml:"ml:w-full ml:[&>*]:shrink-0 ml:[&>*]:grow ml:[&>*]:basis-0",lg:"lg:w-full lg:[&>*]:shrink-0 lg:[&>*]:grow lg:[&>*]:basis-0",xl:"xl:w-full xl:[&>*]:shrink-0 xl:[&>*]:grow xl:[&>*]:basis-0","2xl":"2xl:w-full 2xl:[&>*]:shrink-0 2xl:[&>*]:grow 2xl:[&>*]:basis-0"},g={"":"w-auto [&>*]:shrink [&>*]:grow-0 [&>*]:basis-auto",xs:"xs:w-auto xs:[&>*]:shrink xs:[&>*]:grow-0 xs:[&>*]:basis-auto",sm:"sm:w-auto sm:[&>*]:shrink sm:[&>*]:grow-0 sm:[&>*]:basis-auto",ml:"ml:w-auto ml:[&>*]:shrink ml:[&>*]:grow-0 ml:[&>*]:basis-auto",lg:"lg:w-auto lg:[&>*]:shrink lg:[&>*]:grow-0 lg:[&>*]:basis-auto",xl:"xl:w-auto xl:[&>*]:shrink xl:[&>*]:grow-0 xl:[&>*]:basis-auto","2xl":"2xl:w-auto 2xl:[&>*]:shrink 2xl:[&>*]:grow-0 2xl:[&>*]:basis-auto"};function x(e,t){let r=[];return e.direction&&r.push(n[e.direction][t]),e.align&&r.push(o[e.align][t]),e.justify&&r.push(d[e.justify][t]),null!=e.spacing&&r.push(c[e.spacing][t]),null!=e.spaceBefore&&r.push(u[e.spaceBefore][t]),null!=e.spaceAfter&&r.push(m[e.spaceAfter][t]),!0===e.isFullWidth?r.push(p[t]):!1===e.isFullWidth&&r.push(g[t]),r}let h=e=>{var i;let{breakpoints:n,direction:o,spacing:d,isFullWidth:c,justify:u,align:m,spaceBefore:p,spaceAfter:g,children:h,...f}=e;if(!r.Children.count(h))return null;let v={direction:o,spacing:d,isFullWidth:c,justify:u,align:m,spaceBefore:p,spaceAfter:g},y=(i=n)?Object.keys(i).sort((e,t)=>a[e]-a[t]):[],b=["flex"],C=n.xs,w=C?{...v,...C}:v;for(let e of(b.push(...x(w,"")),y)){if("xs"===e)continue;let t=n[e];if(!t)continue;let r=l[e];b.push(...x(t,r))}return(0,t.jsx)("div",{className:(0,s.cn)(b),...f,children:h})};e.s(["Stack",0,e=>{let{breakpoints:r,...a}=e;return r?(0,t.jsx)(h,{breakpoints:r,...a}):(0,t.jsx)(i.default,{...a})}],849921)},718557,e=>{"use strict";var t=e.i(292905),r=e.i(285700),i=e.i(134276),a=e.i(957744),s=e.i(526625),l=e.i(767411),n=e.i(627888);e.s(["useBulkAddToCartMutation",0,()=>{let e=(0,r.useQueryClient)(),{addToCart:o,createCart:d}=(0,l.useEcommerceTracking)();return(0,t.useMutation)({mutationFn:async({products:e})=>(await i.default.createCartApi()).addProductsToCart({products:e}),onSuccess:(e,t)=>{var r;let{products:i}=t,a=(null==(r=e.data)?void 0:r.items)||{};(0,n.trackBulkCartAddition)({products:i,cartItems:a,source:i[0].source??void 0,getQuantity:e=>e.quantity??0,addToCart:o,createCart:d})},onSettled:(t,r)=>{e.invalidateQueries({queryKey:[a.cartQueryKeyPrefix]}),e.invalidateQueries({queryKey:(0,s.getCartReviewQueryKey)()})}})}])},991134,920166,e=>{"use strict";var t=e.i(292905),r=e.i(694819),i=e.i(853127),a=e.i(952097),s=e.i(125541),l=e.i(578764),n=e.i(277183),o=e.i(406376),d=e.i(435642),c=e.i(134276),u=e.i(809452),m=e.i(305580),p=e.i(624345);e.s(["useChangeLanguageMutation",0,()=>{let e=(0,a.useAnalyticsApplicationEvents)(),{ts:g}=(0,d.default)(),{router:x}=(0,l.useRouting)(),{tenant:h}=(0,i.useConfiguration)(),[f,v]=(0,n.default)(),{notify:y}=(0,o.default)(),b=async e=>{await Promise.resolve(v(m.Cookie.CORRECT_LOCALE,(0,s.getCorrectLocale)(e))),await Promise.resolve(v(m.Cookie.USER_SELECTED_LANGUAGE,e));let t=(0,s.getUrlWithLanguagePrefix)(x.asPath,h,e);await x.replace(x.asPath,t,{locale:e,shallow:!0})};return(0,t.useMutation)({mutationFn:async({language:e})=>
1{if(!(0,s.isSupportedLanguage)(e,h))throw Error("not_supported");await b(e);let t=await c.default.createUserProfileApi(),r=await t.changeLanguage();return(0,u.returnOrThrowApiResponse)(r)},onMutate:()=>({oldLocale:f[m.Cookie.CORRECT_LOCALE]}),meta:{...(0,r.doNotShowErrorSnackbar)("all")},onError:(e,t,r)=>{(null==r?void 0:r.oldLocale)&&b(null==r?void 0:r.oldLocale),y(g("common:clientErrors.fallbackError"),"error"),p.kibanaLogger.warning("fallbackNotification - ChangeLanguageMutation",{error:e,variables:t,context:r})},onSuccess:(t,r)=>{e.languageChanged(r.language.split("-")[0]),x.reload()}})}],991134);var g=e.i(191788),x=e.i(590884),h=e.i(458962),f=e.i(954858);e.s(["useThemeWithSync",0,()=>{let{theme:e,setTheme:t,resolvedTheme:r,systemTheme:i,mounted:a}=(0,x.useTheme)();return(0,g.useEffect)(()=>{if(a&&e){let t=e===f.ThemePreference.System?r:e;(0,h.syncThemeToCookie)(t)}},[e,a,r]),{theme:e,setTheme:(0,g.useCallback)(e=>{t(e)},[t]),resolvedTheme:r,systemTheme:i,mounted:a}}],920166)},576435,e=>{"use strict";var t=e.i(292905),r=e.i(285700),i=e.i(417969),a=e.i(134276),s=e.i(17911),l=e.i(318363),n=e.i(852393),o=e.i(75210),d=e.i(370898),c=e.i(132330),u=e.i(246589),m=e.i(467840),p=e.i(719648);e.s(["useFavoriteRecipeMutation",0,()=>{let e=(0,r.useQueryClient)();return(0,t.useMutation)({mutationFn:async({favorite:e,recipeId:t})=>{let r=await a.default.createChefApi(i.default.createDefaultApiConfig());return await r.setFavoriteRecipe1({favorite:e,recipeId:t})},onMutate:async({recipeId:t,favorite:r})=>{let i=(0,d.getRecipeDetailQueryKey)(t),a=(0,u.getRecipeHeaderQueryKey)(t);await e.cancelQueries({queryKey:[o.CHEF_QUERY_KEY_PREFIX,n.CHEF_RECIPE_CARDS_QUERY_KEY_PREFIX]}),await e.cancelQueries({queryKey:i}),await e.cancelQueries({queryKey:a}),await e.cancelQueries({queryKey:[m.BASE_QUERY_SLUG]}),await e.cancelQueries({queryKey:[o.CHEF_QUERY_KEY_PREFIX,p.CHEF_RECIPE_CAROUSEL_QUERY_KEY]});let s=e.getQueriesData({queryKey:[o.CHEF_QUERY_KEY_PREFIX,n.CHEF_RECIPE_CARDS_QUERY_KEY_PREFIX]});e.setQueriesData({queryKey:[o.CHEF_QUERY_KEY_PREFIX,n.CHEF_RECIPE_CARDS_QUERY_KEY_PREFIX]},e=>e?e.map(e=>e.recipeId===t?{...e,favorites:{...e.favorites,favorite:r}}:e):e);let l=e.getQueryData(i);l&&e.setQueryData(i,{...l,isFavorite:r});let c=e.getQueryData(a);c&&e.setQueryData(a,{...c,favorites:{...c.favorites,favorite:r}});let g=e.getQueriesData({queryKey:[o.CHEF_QUERY_KEY_PREFIX,p.CHEF_RECIPE_CAROUSEL_QUERY_KEY]});e.setQueriesData({queryKey:[o.CHEF_QUERY_KEY_PREFIX,p.CHEF_RECIPE_CAROUSEL_QUERY_KEY]},e=>e?{...e,recipes:e.recipes.map(e=>e.id===t?{...e,favorites:{...e.favorites,favorite:r}}:e)}:e);let x=e.getQueriesData({queryKey:[m.BASE_QUERY_SLUG]});return e.setQueriesData({queryKey:[m.BASE_QUERY_SLUG]},e=>e?{...e,pages:e.pages.map(e=>{var i,a;return{...e,data:{...e.data,recipes:null==(a=e.data)||null==(i=a.recipes)?void 0:i.map(e=>e.id===t?{...e,isFavorite:r}:e)}}})}:e),{previousRecipeCards:s,previousMealDetail:l,mealDetailQueryKey:i,previousRecipeHeader:c,recipeHeaderQueryKey:a,previousRecipeCarousel:g,previousRecipeTypes:x}},onError:(t,r,i)=>{if(null==i?void 0:i.previousRecipeCards)for(let[t,r]of i.previousRecipeCards)e.setQueryData(t,r);if((null==i?void 0:i.previousMealDetail)&&i.mealDetailQueryKey&&e.setQueryData(i.mealDetailQueryKey,i.previousMealDetail),(null==i?void 0:i.previousRecipeHeader)&&i.recipeHeaderQueryKey&&e.setQueryData(i.recipeHeaderQueryKey,i.previousRecipeHeader),null==i?void 0:i.previousRecipeCarousel)for(let[t,r]of i.previousRecipeCarousel)e.setQueryData(t,r);if(null==i?void 0:i.previousRecipeTypes)for(let[t,r]of i.previousRecipeTypes)e.setQueryData(t,r)},onSuccess:async(t,r)=>{var i,a,s,n,o;let d=e.getQueriesData({predicate:e=>{var t;return!!Array.isArray(e.queryKey)&&(null==(t=e.queryKey)?void 0:t[0])===l.InspirationQueryKeyValue}});if(!d.length)return;let c=d[0],u=c[0],m=c[1];if(!m)return;let p=(null==(i=m.data)?void 0:i.favoriteRecipes)??[];if(r.favorite){let e=((null==(n=m.data)?void 0:n.recommendedRecipes)??[]).find(e=>e.id===r.recipeId)??((null==(o=m.data)?void 0:o.newRecipes)??[]).find(e=>e.id===r.recipeId);e&&(p=[...p,e])}else p=p.filter(e=>e.id!==r.recipeId);let g=e=>e.map(e=>e.id===r.recipeId?{...e,isFavorite:r.favorite}:e);e.setQueryData(u,{...m,data:{...m.data,favoriteRecipes:p,recommendedRecipes:g((null==(a=m.data)?void 0:a.recommendedRecipes)??[]),newRecipes:g((null==(s=m.data)?void 0:s.newRecipes
1)??[])}})},onSettled:(t,r,{recipeId:i})=>{e.invalidateQueries({queryKey:(0,s.getFavoriteRecipesQueryKey)()}),e.invalidateQueries({queryKey:(0,c.getNavigationRecipesQueryKey)()}),e.invalidateQueries({queryKey:(0,d.getRecipeDetailQueryKey)(i)}),e.invalidateQueries({queryKey:(0,u.getRecipeHeaderQueryKey)(i)}),e.invalidateQueries({queryKey:[m.BASE_QUERY_SLUG]}),e.invalidateQueries({queryKey:[o.CHEF_QUERY_KEY_PREFIX,p.CHEF_RECIPE_CAROUSEL_QUERY_KEY]})}})}])},759692,e=>{"use strict";var t=e.i(292905),r=e.i(285700),i=e.i(134276),a=e.i(570482);e.s(["useHideClaimAnnouncementMutation",0,()=>{let e=(0,r.useQueryClient)();return(0,t.useMutation)({mutationFn:async e=>(await i.default.createAnnouncementApi()).disableWarrantyNotification(e),onSuccess:()=>{e.invalidateQueries({queryKey:(0,a.getClaimAnnouncementQueryKey)()})}})}])},762509,e=>{"use strict";var t=e.i(292905),r=e.i(285700),i=e.i(149138),a=e.i(426291),s=e.i(134276);e.s(["useShoppingListMutation",0,()=>{let e=(0,r.useQueryClient)();return(0,t.useMutation)({mutationFn:async({name:e,source:t})=>{let r=await s.default.createShoppingListsCartApi();return e?r.createShoppingListFromCart({name:e,source:t}):r.updateShoppingListFromCart(t)},onSuccess:()=>{e.invalidateQueries({queryKey:[i.shoppingListComponentQueryKeyPrefix]}),e.invalidateQueries({queryKey:[a.shoppingListsPreviewKeyPrefix]})}})}])},367914,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276),a=e.i(809452);let s=()=>["cartNextBestOffer"],l=async e=>{let t=r.default.createDefaultApiConfig(e),s=await i.default.createGoodsUpsellStripApi(t),l=await s.getNextBestOfferUpsell();return(0,a.returnOrThrowApiResponse)(l).data};e.s(["getCartNextBestOfferQueryKey",0,s,"useCartNextBestOfferQuery",0,e=>(0,t.useQuery)({queryKey:s(),queryFn:()=>l(),enabled:e})])},852393,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276),a=e.i(75210);let s="recipe-cards",l=e=>[a.CHEF_QUERY_KEY_PREFIX,s,[...e].sort((e,t)=>e-t)],n=async(e,t)=>(await i.default.createRecipeCardControllerApi(r.default.createDefaultApiConfig(t))).getRecipeCardInfos(e);e.s(["CHEF_RECIPE_CARDS_QUERY_KEY_PREFIX",0,s,"getChefRecipeCards",0,n,"getChefRecipeCardsQueryKey",0,l,"useChefRecipeCardsQuery",0,e=>(0,t.useQuery)({queryKey:l(e),queryFn:()=>n(e),enabled:e.length>0,staleTime:6e5})])},719648,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276),a=e.i(75210);let s="recipe-carousel",l=e=>[a.CHEF_QUERY_KEY_PREFIX,s,e],n=async(e,t)=>(await i.default.createChefRecipeCarouselControllerApi(r.default.createDefaultApiConfig(t))).getRecipeCarouselForSubtype(e);e.s(["CHEF_RECIPE_CAROUSEL_QUERY_KEY",0,s,"getChefRecipeCarousel",0,n,"getChefRecipeCarouselQueryKey",0,l,"useChefRecipeCarouselQuery",0,e=>(0,t.useQuery)({queryKey:l(e),queryFn:()=>n(e),staleTime:6e5})])},75210,e=>{"use strict";e.s(["CHEF_DEFAULT_PAGE_LIMIT",0,24,"CHEF_QUERY_KEY_PREFIX",0,"chef","chefSharingImage",0,"/images/social/chef2.jpg"])},17911,e=>{"use strict";e.i(838266),e.i(75210),e.i(417969),e.i(134276),e.s(["getFavoriteRecipesQueryKey",0,()=>["chef-favorite-recipes"]])},306214,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276),a=e.i(75210);let s=e=>[a.CHEF_QUERY_KEY_PREFIX,"ingredient-selection",e],l=async(e,t)=>{let a=r.default.createDefaultApiConfig(t);return(await i.default.createChefIngredientsSelectionApi(a)).getInitialSelection(e)};e.s(["getIngredientSelection",0,l,"getIngredientSelectionQueryKey",0,s,"useIngredientSelectionQuery",0,e=>(0,t.useQuery)({queryKey:s(e),queryFn:()=>e?l(e):null,enabled:!!e})])},318363,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276);let a=16,s="chef-inspiration-recipes",l=async(e=a,t)=>{let s=await i.default.createChefApi(r.default.createDefaultApiConfig(t));return await s.getRecipeInspiration3(e)},n=(e=a)=>[s,{limit:e}];e.s(["InspirationQueryKeyValue",0,s,"getInspirationRecipesQueryKey",0,n,"useInspirationRecipesQuery",0,(e=a)=>(0,t.useQuery)({queryKey:n(e),queryFn:e=>l(e.queryKey[1].limit)})])},370898,e=>{"use strict";var t=e.i(809452),r=e.i(893930),i=e.i(417969),a=e.i(134276),s=e.i(75210);let l=e=>[s.CHEF_QUERY_KEY_PREFIX,"recipe-detail",e],n=async(e,r)=>{let s=i.default.createDefaultApiConfig(r),l=await a.default.createChefApi(s),n=await l.getRecipeMetadata(e);return(0,t.returnOrThrowApiResponse)(n).data};e.s(["getRecipeDetail",0,n,"getRecipeDetailQueryKey",0,l,"useRecipeDetailQuery",0,e=>(0,r.useQuery)({queryKey:l(e),queryFn:()=>e?n(e):null,enabled:!!e})])},246589,e=>{"use strict";var t=e.i(893930),r=e.i(844066),i=e.i(417969),a=e.i(134276),s=e.i(75210);let l=e=>[s.CHEF_QUERY_KEY_PREFIX,"recipe-header",e],n=async(e,t)=>{let s,l=await a.default.createChefRecipeHeaderControllerApi(i.default.createDefaultApiConfig(t));return{id:(s=await l.getRecipeHeaderForSubtypeAndId(r.ComponentSubtype.ChefRecipe,e)).id??0,slug:s.slug,title:s.title,imageUrls:s.imageUrls,details:s.details,favorites:s.favorites,author:s.author??null,videoUrl:s.videoUrl??null,averageRating:s.averageRating??null,ratingCount:s.ratingCount??0,userRating:s.userRating??null}};e.s(["getRecipeHeader",0,n,"getRecipeHeaderQueryKey",0,l,"useRecipeHeaderQuery",0,e=>(0,t.useQuery)({queryKey:l(e),queryFn:()=>n(e),enabled:!!e})])},467840,e=>{"use strict";e.i(838266),e.i(75210),e.i(417969),e.i(134276),e.s(["BASE_QUERY_SLUG",0,"chef-recipes"])},440823,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276);let a=async({addressId:e},t)=>{let a=await i.default.createDeliveryApi(r.default.createDefaultApiConfig(t));return e?await a.getNearestDeliveryPointFromAddressLocation(e):null};e.s(["useNearestDeliveryPointQuery",0,e=>(0,t.useQuery)({queryKey:["nearestDeliveryPoint",e],queryFn:e=>a(e.queryKey[1]),enabled:!!e.addressId})])},132330,930844,e=>{"use strict";var t=e.i(893930),r=e.i(134276),i=e.i(417969);e.s(["STALE_TIME",0,18e5],930844);let a=()=>["navigationRecipes"],s=async e=>{let t=await r.default.createNewAPINavigationV4Api(i.default.createNoCacheApiConfig(e));return await t.getRecipes()};e.s(["getNavigationRecipesQueryKey",0,a,"useNavigationRecipesQuery",0,()=>(0,t.useQuery)({queryKey:a(),queryFn:()=>s(),staleTime:18e5})],132330)},2677,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276),a=e.i(12422),s=e.i(543791);let l=e=>["products",e],n=async(e,t)=>{let l=r.default.createDefaultApiConfig(t),[n,o,d,c,u,m]=await Promise.all([i.default.createNewAPIProductsApi(l),i.default.createNewAPIProductStockApi(l),i.default.createNewAPIProductPricesApi(l),i.default.createNewAPIProductCategoriesApi(l),i.default.createNewAPIProductUserDataApi(l),i.default.createNewAPIProductRatingsApi(l)]),p=e.productIds,[g,x,h,f,v,y]=await Promise.all([(0,s.fetchInChunks)(p,e=>n.getProducts(e)),(0,s.fetchInChunks)(p,e=>o.getProductsStocks(e)),(0,s.fetchInChunks)(p,e=>d.getProductsPrices(e)),(0,s.fetchInChunks)(p,e=>c.getProductsCategories(e)),(0,s.fetchInChunks)(p,e=>u.getProductsUserData(e)),(0,s.fetchInChunks)(p,e=>m.getProductsRatings(e))]);return{products:p.reduce((t,r)=>{let i=g.find(e=>e.id===r),s=x.find((0,a.findByProductId)(r)),l=h.find((0,a.findByProductId)(r)),n=f.find((0,a.findByProductId)(r)),o=v.find((0,a.findByProductId)(r)),d=y.find((0,a.findByProductId)(r)),c=(e.impressions??[]).find((0,a.findByProductId)(r));return s&&l&&n&&o&&i?[...t,{product:i,stock:s,prices:l,categories:n,userData:o,rating:d,impression:c}]:t},[])}};e.s(["getProductsData",0,n,"getProductsQueryKey",0,l,"useProductsQuery",0,e=>(0,t.useQuery)({queryKey:l(e),queryFn:({queryKey:e})=>n(e[1]),enabled:!!e.productIds.length})])},779835,e=>{"use strict";var t=e.i(893930),r=e.i(417969),i=e.i(134276);let a=async(e,t,a)=>(await i.default.createOpeningHoursTimeslotsApi(r.default.createDefaultApiConfig(a))).getShoppingStartDeliveryInformation(t,e),s=(e,t)=>["shopping-start-delivery-info",e,t];e.s(["getShoppingStartDeliveryInfo",0,a,"getShoppingStartDeliveryInfoQueryKey",0,s,"useShoppingStartDeliveryInfoQuery",0,(e,r,i)=>(0,t.useQuery)({queryKey:s(e,r),queryFn:e=>a(e.queryKey[1]),...i})])},377819,39158,e=>{"use strict";var t=e.i(456298),r=e.i(893930),i=e.i(851928);let a=async({query:e,companyId:t,limit:r},a)=>(0,i.whispererQueryTemplate)(i=>i.getAutocomplete(e,"whisperer",void 0,void 0,t,void 0,void 0,void 0,r??void 0,void 0),a);e.s(["MIN_WHISPERER_QUERY_LENGTH",0,2,"useWhispererQuery",0,e=>(0,r.useQuery)({queryKey:["whisperer",e],queryFn:e=>a(e.queryKey[1]),enabled:e.query.length>=2&&!!e.companyId,staleTime:0,gcTime:12e4,placeholderData:t.keepPreviousData,refetchOnMount:!1})],377819);var s=e.i(391398),l=e.i(874487),n=e.i(738056),o=e.i(9776),d=e.i(893688),c=e.i(277183),u=e.i(794060),m=e.i(263329),p=e.i(148103),g=e.i(193541);let x=({title:e,text:t,isInverted:r})=>e||t?(0,s.jsxs)(s.Fragment,{children:[e&&(0,s.jsx)(p.BodyText,{inverted:r,className:"mb-50 font-semibold text-[color:var(--color-text-tooltip)]","data-test":g.TooltipDataTest.contentTitle,size:"xs",children:e}),t&&(0,s.jsx)(p.BodyText,{inverted:r,className:"text-[color:var(--color-text-tooltip)]","data-test":g.TooltipDataTest.contentText,size:"xs",children:t})]}):null;e.s(["TutorialTooltip",0,({title:e,text:t,children:r,cookieName:i,invalidUrls:a,hideCloseButtonOnDesktop:p,type:g,isBouncing:h,isGlobalEventDisabled:f,scrollHide:v,zIndex:y=1100,isEnabled:b=!0,afterHide:C,usePortal:w=!0,hidesBatchedDeviceType:T=!1})=>{let[j,S]=(0,c.default)(),{user:N}=(0,u.default)(),{innerWidth:E}
1=(0,o.useBreakpoints)(),I=(0,l.useHideTutorial)(),k=E>=d.L_WIDTH?n.TutorialType.Desktop:n.TutorialType.Mobile,_=(e||t)&&(i&&!j[i]||!!N)&&!(null==a?void 0:a.includes(window.location.pathname)),A=()=>{C&&C(),T&&I(k),!N&&i&&S(i,!0)};return _?(0,s.jsx)(m.ConditionedTooltip,{disableMouseEvents:!0,visible:b,afterHide:A,content:_&&(0,s.jsx)(x,{isInverted:"light"!==g,text:t,title:e}),globalEventOff:f?void 0:"click",onClose:A,place:"bottom",hideCloseButtonOnDesktop:p,type:g,isBouncing:h,scrollHide:v??!0,zIndex:y,usePortal:w,children:r}):(0,s.jsx)(s.Fragment,{children:r})}],39158)},495850,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i=(0,r.createContext)(void 0);i.displayName="CartVisibilityContext",e.s(["CartVisibilityContextProvider",0,({children:e})=>{let[a,s]=(0,r.useState)(!1),l=(0,r.useMemo)(()=>({isCartVisible:a,setIsCartVisible:s}),[a]);return(0,t.jsx)(i.Provider,{value:l,children:e})},"useCartVisibilityContext",0,()=>{let e=(0,r.useContext)(i);if(!e)throw Error("Use useCartVisibilityContext only inside CartVisibilityContextProvider");return e}])},874487,738056,e=>{"use strict";var t,r,i=e.i(391398),a=e.i(191788),s=e.i(9776),l=e.i(893688),n=e.i(794060),o=((t={}).Desktop="desktop",t.Mobile="mobile",t.AiAssistant="ai-assistant",t.ShoppingListCollaboration="shopping-list-collaboration",t),d=((r={}).ShoppingLists="shopping-lists",r.DesktopDelivery="desktop-tooltip-delivery",r.DesktopProfile="desktop-tooltip-profile",r.MobileDelivery="mobile-tooltip-delivery",r.MobileProfile="mobile-tooltip-profile",r.AiAssistant="ai-assistant-tooltip",r.ShoppingListCollaboration="shopping-list-collaboration-tooltip",r);e.s(["TooltipType",()=>d,"TutorialType",()=>o],738056);var c=e.i(893930),u=e.i(417969),m=e.i(449386);class p extends m.BaseAPI{async shouldShowTutorialsOfTypesToUserRaw(e,t){if(null==e.types)throw new m.RequiredError("types",'Required parameter "types" was null or undefined when calling shouldShowTutorialsOfTypesToUser().');let r={types:e.types.join(m.COLLECTION_FORMATS.csv)},i=await this.request({path:"/api/v3/tutorial/should-show",method:"GET",headers:{},query:r},t);return new m.JSONApiResponse(i)}async shouldShowTutorialsOfTypesToUser(e,t){return(await this.shouldShowTutorialsOfTypesToUserRaw({types:e},t)).value()}}let g=async(e,t)=>new p(u.default.createNoCacheApiConfig(t)).shouldShowTutorialsOfTypesToUser(e);var x=e.i(134276);let h=async(e,t)=>(await x.default.createTutorialControllerApi(u.default.createNoCacheApiConfig(t))).getTutorial(e);var f=e.i(371502),v=e.i(578764),y=e.i(277183),b=e.i(305580);let C="-tooltip",w=(0,a.createContext)(void 0),T=(0,a.createContext)(null),j=e=>{switch(e){case d.DesktopDelivery:case d.MobileDelivery:return b.Cookie.TUTORIAL_TOOLTIP_DELIVERY;case d.DesktopProfile:case d.MobileProfile:return b.Cookie.TUTORIAL_TOOLTIP_PROFILE;case d.ShoppingListCollaboration:return b.Cookie.TUTORIAL_TOOLTIP_SHOPPING_LIST_COLLABORATION;default:return}},S=({enabled:e,device:t,children:r})=>{let{tutorials:s,slug:l}=N(t,e),n=(0,a.useMemo)(()=>({tutorials:s,invalidUrls:[],cookieName:j(l)}),[s,l]);return(0,i.jsx)(w.Provider,{value:n,children:r})},N=(e,t=!0)=>{let r,i=(0,a.useContext)(T);if(null===i)throw Error("Use useTutorialFlag only inside TutorialContextProvider");let{user:s}=(0,n.default)(),[l]=(0,y.default)(),o=t?i.flags[`${e}${C}`]:void 0,d=(null==o?void 0:o.show)?o.tutorial:null,u=j(d),{data:m}=(r=!s&&u&&l[u]?null:d,(0,c.useQuery)({queryKey:["tutorialContent",{slug:r??null}],queryFn:()=>h(r),enabled:!!r})),p=(0,a.useMemo)(()=>m?(m.pages||[]).reduce((e,{type:t,title:r,text:i})=>(null!==t&&(e[t]={title:r,text:i}),e),{}):null,[m]);return{show:!!(null==o?void 0:o.show),slug:(null==m?void 0:m.slug)??null,tutorials:p,hide:i.hideType}},E=()=>void 0;w.displayName="TutorialContext",e.s(["TutorialContextProvider",0,({isEmbed:e=!1,children:t})=>{let{user:r}=(0,n.default)(),{innerWidth:d}=(0,s.useBreakpoints)(),{routes:u,router:m}=(0,v.useRouting)(),p=d>=l.L_WIDTH?o.Desktop:o.Mobile,x=(e=>{let{innerWidth:t}=(0,s.useBreakpoints)(),{routes:r,router:i}=(0,v.useRouting)(),n=(0,f.useIsAssistantEnabled)(),d=t>=l.L_WIDTH?o.Desktop:o.Mobile,c=r.orderSuccess.page!==i.pathname,u=!e&&n;return(0,a.useMemo)(()=>{let e=[];return c&&e.push(d),u&&e.push(o.AiAssistant),e},[d,u,c])})(e),{resolved:h,hideSlug:y}=((e,t)=>{let r,[i,s]=(0,a.useState)({}),[l,n]=(0,a.useState)({identityKey:t,slugs:[]});(0,a.useEffect)(()=>{s({}),n({identityKey:t,slugs:[]})},[t]);let o=l.identityKey===t?l.slugs:[],d=o.join(","),u=e.filter(e=>!(e in i)&&!o.includes(e)).join(",");(0,a.useEffect)(()=>{!d&&u&&n({identityKey:t,slugs:u.split(",")})},[u,d,t]);let{data:m,isError:p}=(r={types:o,identityKey:t},(0,c.useQuery)({queryKey:(({types:e,identityKey:t})=>["shouldShowTutorials",{types:[...e].sort(),identityKey:t}])(r),queryFn:e=>g(e.queryKey[1].types),enabled:r.types.length>0})),x=null==m?void 0:m.tutorials;return(0,a.useEffect)(()=>{d&&(x||p)&&(s(e=>{let t={...e};
1return d.split(",").forEach(e=>{e in t||(t[e]=(null==x?void 0:x[e])??{show:!1,tutorial:null})}),t}),n({identityKey:t,slugs:[]}))},[x,p,d,t]),{resolved:i,hideSlug:(0,a.useCallback)(e=>{s(t=>({...t,[e]:{show:!1,tutorial:null}}))},[])}})((0,a.useMemo)(()=>x.map(e=>`${e}${C}`),[x]),(null==r?void 0:r.id)?String(r.id):"anonymous"),b=(0,a.useMemo)(()=>({flags:h,hideType:e=>y(`${e}${C}`)}),[h,y]);return(0,i.jsx)(T.Provider,{value:b,children:(0,i.jsx)(S,{enabled:u.orderSuccess.page!==m.pathname,device:p,children:t})})},"useHideTutorial",0,()=>{var e;return(null==(e=(0,a.useContext)(T))?void 0:e.hideType)??E},"useTutorialContext",0,()=>{let e=(0,a.useContext)(w);if(!e)throw Error("Use useTutorialContext only inside TutorialContextProvider");return e},"useTutorialFlag",0,N],874487)},554207,e=>{"use strict";var t=e.i(886297),r=e.i(671569);e.s(["usePrecalculateCategoryProducts",0,(e,i=!1)=>{let{cart:a}=(0,t.useCartContext)();return null==e?void 0:e.map(e=>{var t,s,l,n;let o=(null==a||null==(s=a.items)||null==(t=s[e.product.id])?void 0:t.isLastMinute)??i,d=(null==a||null==(n=a.items)||null==(l=n[e.product.id])?void 0:l.quantity)??0;return{...e,pricing:(0,r.calculateProductPricing)(e.prices,o,d)}})}])},641997,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(307932);let a={xs:"w-100 h-100",xtiny:"w-150 h-150",tiny:"w-200 h-200",smaller:"w-250 h-250",small:"w-300 h-300",medium:"w-350 h-350",normal:"w-400 h-400",big:"w-500 h-500",bigger:"w-600 h-600",biggest:"w-700 h-700",large:"w-800 h-800",larger:"w-950 h-950"},s=({children:e,size:r="normal",backgroundColor:s,borderColor:l,color:n,className:o,style:d,...c})=>(0,t.jsx)("span",{className:(0,i.cn)(["inline-flex shrink-0 items-center justify-center rounded-full",a[r],l&&"border border-solid",o]),style:{backgroundColor:s||"var(--white)",...l&&{borderColor:l},...n&&{color:n},...d},...c,children:e}),l=r.default.memo(s);e.s(["Circle",0,s,"default",0,l])},288505,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(730943),a=e.i(672998),s=e.i(307932),l=e.i(641997),n=e.i(821874),o=e.i(467065),d=e.i(435642),c=e.i(488891);let u=` 2 @keyframes floating-sheet-slide-up { 3 from { transform: translateY(100%); opacity: 0; } 4 to { transform: translateY(0); opacity: 1; } 5 } 6 @keyframes floating-sheet-backdrop-fade-in { 7 from { opacity: 0; } 8 to { opacity: 1; } 9 } 10`;e.s(["FloatingSheet",0,({open:e,onClose:m,children:p,ariaLabel:g,footer:x,dataTest:h,desktopMaxWidthClassName:f})=>{let{ts:v}=(0,d.default)(),y=(0,c.useIsMobile)();if((0,r.useEffect)(()=>{if(!e)return;let t=e=>{e.key===a.Keys.ESC&&m()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,m]),!e)return null;let b=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:u}),y&&(0,t.jsx)("div",{"aria-hidden":"true",className:"fixed inset-0 z-[1000] cursor-default bg-black/40",style:{animation:"floating-sheet-backdrop-fade-in 0.2s ease-out"},onClick:m,onKeyDown:m}),(0,t.jsxs)("div",{className:(0,s.cn)("fixed z-[1001]",y?"right-0 bottom-0 left-0 flex max-h-[100dvh] flex-col rounded-t-large bg-grey-20":(0,s.cn)("right-300 bottom-300 w-[calc(100vw-32px)]",f??"max-w-[480px]")),style:{animation:"floating-sheet-slide-up 0.3s ease-out",...y?{paddingBottom:"env(safe-area-inset-bottom)"}:{}},children:[!y&&(0,t.jsx)("button",{type:"button",className:"-top-250 -right-250 absolute z-[10] cursor-pointer border-none bg-transparent p-0","data-test":o.ModalDataTests.modalCloseButton,"aria-label":v("common:close"),onClick:m,children:(0,t.jsx)(l.Circle,{className:"border-1 border-primary bg-primary",size:"big",children:(0,t.jsx)(n.default.IconCloseX,{height:20,width:20,className:"[&_path]:fill-grey-70 dark:[&_path]:fill-grey-40"})})}),y&&(0,t.jsx)("div",{className:"relative h-800 shrink-0",children:(0,t.jsx)("button",{type:"button",className:"-translate-y-1/2 absolute top-1/2 right-150 z-[10] cursor-pointer border-none bg-transparent p-0","data-test":o.ModalDataTests.modalCloseButton,"aria-label":v("common:close"),onClick:m,children:(0,t.jsx)(l.Circle,{className:"border-1 border-primary bg-primary",size:"big",children:(0,t.jsx)(n.default.IconCloseX,{height:20,width:20,className:"[&_path]:fill-grey-70 dark:[&_path]:fill-grey-40"})})})}),(0,t.jsxs)("div",{role:"dialog","aria-modal":"false","aria-label":g,"data-test":h,className:(0,s.cn)("relative flex flex-col bg-grey-20 dark:border dark:border-grey-30",y?"min-h-0 flex-1 overflow-hidden rounded-t-large":"max-h-[calc(100vh-64px)] overflow-y-auto rounded-large shadow-[0_8px_32px_rgba(0,0,0,0.2)]"),children:[(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col",y?"min-h-0 flex-1 overflow-y-auto":"min-h-0"),children:p}),y&&x&&(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"-top-300 pointer-events-none absolute right-0 left-0 h-300 bg-gradient-to-t from-grey-20 to-transparent"}),(0,t.jsx)("div",{className:"bg-grey-20 px-200 pt-150 pb-200",children:x})]})]})]})]}),C=document.getElementById(o.REACT_PORTAL_ID);return C?(0,i.createPortal)(b,C):b}])},941043,e=>{"use strict";var t=e.i(391398),r=e.i(558021),i=e.i(959809),a=e.i(711633);e.s(["HookCheckbox",0,({rule:e,name:s,...l})=>{let{register:n,watch:o,formState:{errors:d}}=(0,r.useFormContext)(),c=o(s),u=(0,i.getFieldErrorMessage)(null==d?void 0:d[s]);return(0,t.jsx)(a.Checkbox,{...l,...n(s,null==e?void 0:e.getRule()),checked:!!c,message:u,validationType:u?"negative":"none"})}])},235543,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconBookmark",a=r.default.memo(({color:e,width:r=16,height:a=20,...s})=>(0,t.jsx)("svg",{"aria-hidden":"true","data-test":i,height:a,viewBox:"0 0 16 20",width:r,fill:"none",xmlns:"http://www.w3.org/2000/svg",...s,children:(0,t.jsx)("path",{clipRule:"evenodd",d:"M3 2C2.73478 2 2.48043 2.10536 2.29289 2.29289C2.10536 2.48043 2 2.73478 2 3V17.0568L7.41876 13.1863C7.76646 12.9379 8.23354 12.9379 8.58124 13.1863L14 17.0568V3C14 2.73478 13.8946 2.48043 13.7071 2.29289C13.5196 2.10536 13.2652 2 13 2H3ZM0.87868 0.87868C1.44129 0.31607 2.20435 0 3 0H13C13.7956 0 14.5587 0.316071 15.1213 0.87868C15.6839 1.44129 16 2.20435 16 3
10V19C16 19.3746 15.7907 19.7178 15.4576 19.8892C15.1245 20.0606 14.7236 20.0315 14.4188 19.8137L8 15.2289L1.58124 19.8137C1.27642 20.0315 0.87549 20.0606 0.542418 19.8892C0.209347 19.7178 0 19.3746 0 19V3C0 2.20435 0.31607 1.44129 0.87868 0.87868Z",fill:e||"var(--color-icon-primary)",fillRule:"evenodd"})}));e.s(["default",0,a,"iconBookmarkDataTest",0,i])},412919,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconBookmarkFilled",a=r.default.memo(({color:e,width:r=16,height:a=20,...s})=>(0,t.jsx)("svg",{"aria-hidden":"true","data-test":i,height:a,viewBox:"0 0 16 20",width:r,fill:"none",xmlns:"http://www.w3.org/2000/svg",...s,children:(0,t.jsx)("path",{d:"M0.87868 0.87868C1.44129 0.31607 2.20435 0 3 0H13C13.7956 0 14.5587 0.316071 15.1213 0.87868C15.6839 1.44129 16 2.20435 16 3V19C16 19.3746 15.7907 19.7178 15.4576 19.8892C15.1245 20.0606 14.7236 20.0315 14.4188 19.8137L8 15.2289L1.58124 19.8137C1.27642 20.0315 0.87549 20.0606 0.542418 19.8892C0.209347 19.7178 0 19.3746 0 19V3C0 2.20435 0.31607 1.44129 0.87868 0.87868Z",fill:e||"var(--color-icon-primary)"})}));e.s(["default",0,a,"iconBookmarkFilledDataTest",0,i])},578280,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconDarkMode",a=r.default.memo(({color:e,className:r,...a})=>(0,t.jsx)("svg",{"aria-hidden":"true",className:r,"data-test":i,height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...a,children:(0,t.jsx)("path",{d:"M20.824 14.232a.6.6 0 0 0-.626-.14 8.053 8.053 0 0 1-10.29-10.29.6.6 0 0 0-.765-.768 9.128 9.128 0 0 0-3.436 2.174 9.252 9.252 0 0 0 13.085 13.085 9.127 9.127 0 0 0 2.174-3.437.6.6 0 0 0-.142-.624Z",fill:e||"#1C2529"})}));e.s(["default",0,a,"iconDarkModeDataTest",0,i])},911204,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconInfo",a=r.default.memo(({color:e,...r})=>(0,t.jsx)("svg",{"aria-hidden":"true","data-test":i,height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",...r,children:(0,t.jsx)("path",{d:"M13 1C6.38 1 1 6.38 1 13s5.38 12 12 12 12-5.38 12-12S19.62 1 13 1zm1.85 19H11.1v-9.4h3.76zM13 9.5c-1.33 0-2-.58-2-1.74 0-.59.16-1.03.48-1.31.31-.3.82-.44 1.52-.44.7 0 1.2.15 1.53.45.32.29.48.73.48 1.3 0 1.16-.67 1.73-2.01 1.73z",fill:e||"var(--color-icon-primary)"})}));e.s(["default",0,a,"iconInfoDataTest",0,i])},150151,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconLightMode",a=r.default.memo(({color:e,className:r,...a})=>(0,t.jsx)("svg",{"aria-hidden":"true",className:r,"data-test":i,height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...a,children:(0,t.jsx)("path",{d:"M12 3c.452 0 .818.366.818.818v1.637a.818.818 0 1 1-1.636 0V3.818c0-.452.366-.818.818-.818ZM12 7.46a4.539 4.539 0 1 0 0 9.079 4.539 4.539 0 0 0 0-9.078ZM6.812 5.655a.818.818 0 1 0-1.157 1.157l1.17 1.17A.818.818 0 1 0 7.98 6.823L6.812 5.655ZM3 12c0-.452.366-.818.818-.818h1.637a.818.818 0 1 1 0 1.636H3.818A.818.818 0 0 1 3 12ZM7.981 17.176a.818.818 0 0 0-1.157-1.157l-1.169 1.169a.818.818 0 1 0 1.157 1.157l1.17-1.169ZM12 17.727c.452 0 .818.367.818.819v1.636a.818.818 0 1 1-1.636 0v-1.636c0-.452.366-.819.818-.819ZM17.176 16.019a.818.818 0 0 0-1.157 1.157l1.169 1.169a.818.818 0 0 0 1.157-1.157l-1.169-1.17ZM17.727 12c0-.452.367-.818.819-.818h1.636a.818.818 0 1 1 0 1.636h-1.636a.818.818 0 0 1-.819-.818ZM18.345 6.812a.818.818 0 1 0-1.157-1.157l-1.169 1.169a.818.818 0 1 0 1.157 1.157l1.169-1.169Z",fill:e||"#1C2529"})}));e.s(["default",0,a,"iconLightModeDataTest",0,i])},487498,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconSearch",a=r.default.memo(({color:e,height:r=17,width:a=17,...s})=>(0,t.jsx)("svg",{"aria-hidden":"true","data-test":i,height:r,viewBox:"0 0 24 24",width:a,xmlns:"http://www.w3.org/2000/svg",...s,children:(0,t.jsx)("path",{clipRule:"evenodd",d:"M15.7321 14.3182H14.9907L14.7279 14.065C15.8541 12.7518 16.436 10.9603 16.1169 9.05624C15.6758 6.44869 13.4984 4.36639 10.8706 4.04749C6.90061 3.55974 3.55948 6.89891 4.04751 10.8665C4.36661 13.4928 6.45012 15.6689 9.05921 16.1098C10.9644 16.4287 12.757 15.8471 14.0709 14.7216L14.3243 14.9842V15.7252L18.313 19.7116C18.6978 20.0961 19.3266 20.0961 19.7114 19.7116C20.0962 19.327 20.0962 18.6986 19.7114 18.314L15.7321 14.3182ZM10.101 14.3182C7.76405 14.3182 5.87763 12.4329 5.87763 10.0974C5.87763 7.76184 7.76405 5.87653 10.101 5.87653C12.4379 5.87653 14.3243 7.76184 14.3243 10.0974C14.3243 12.4329 12.4379 14.3182 10.101 14.3182Z",fill:e||"var(--color-icon-primary)",fillRule:"evenodd"})}));e.s(["default",0,a,"iconSearchDataTest",0,i])},720731,e=>{"use strict";var t=e.i(391398),r=e.i(191788);let i="IconSystemMode",a=r.default.memo(({color:e,className:r,...a})=>(0,t.jsx)("svg",{"aria-hidden":"true",className:r,"data-test":i,height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...a,children:(0,t.jsx)("path",{clipRule:"evenodd",d:"M11.308 4.416a7.616 7.616 0 0 0 0 15.168V4.416ZM3 12a9 9 0 1 1 18 0 9 9 0 0 1-18 0Z",fill:e||"#1C2529",fillRule:"evenodd"})}));e.s(["default",0,a,"iconSystemModeDataTest",0,i])},855354,e=>{e.v({bannerFade:"bannerItem-module__V4bIGW__bannerFade",bannerItemAnimation:"bannerItem-module__V4bIGW__bannerItemAnimation"})},360458,817664,350322,e=>{"use strict";var t=e.i(391398),r=e.i(307932),i=e.i(191788),a=e.i(730943),s=e.i(672998),l=e.i(435642),n=e.i(641997),o=e.i(467065),d=e.i(897323),c=e.i(389364);let u="modal-close-class";e.s(["MODAL_CLOSE_CLASS",0,u],817664);let m=({size:e="l",style:a,children:s,hideModal:l,className:n,side:m,isInPortal:p=!1})=>{let g=(0,i.useRef)(null);return(0,c.default)(g,e=>{var t,r;if(p)return;let i=null==(t=e.target)?void 0:t.classList,a=null==i?void 0:i.toString(),s=a&&o.BANNED_CLASS_NAMES.some(e=>a.indexOf(e)>=0),n=(0,d.clickedOnScrollbar)(e.clientX);(null==(r=document.getElementById("usercentrics-cmp-ui"))?void 0:r.contains(e.target))||s||n||!l||l(e)}),(0,i.useEffect)(()=>
10{if(!p||!l)return;let e=e=>{var t,r,i;let a=e.target,s=null==a||null==(t=a.classList)?void 0:t.toString();if(!(s&&o.BANNED_CLASS_NAMES.some(e=>s.includes(e)))&&!a.closest('[data-ignore-outside-click="true"]')){if(null==(r=g.current)?void 0:r.contains(a)){e.stopPropagation(),(null==(i=a.classList)?void 0:i.contains(u))&&l(e);return}l(e)}};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[p,l]),(0,i.useEffect)(()=>{var e;null==(e=g.current)||e.focus()},[]),(0,t.jsx)("div",{className:(0,r.cn)(["relative w-full max-w-full overflow-x-hidden border border-secondary bg-primary shadow-[0_8px_8px_-8px_rgba(0,0,0,0.1)] md:overflow-x-visible","s"===e&&"md:max-w-[440px]","m"===e&&"md:max-w-[600px]","l"===e&&"md:max-w-[850px]","xl"===e&&"md:max-w-[960px]","auto"===e&&"w-auto md:max-w-none","ml:rounded-medium","product_detail_modal","left"===m&&"animate-[slideIn_0.5s]",n]),"data-test":"modal-body",ref:g,style:a,tabIndex:-1,children:s})};var p=e.i(736556),g=e.i(686298),x=e.i(789812);let h='a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"], [role="link"], [role="button"]',f=(e,t)=>{let{active:r,initialFocusRef:a,returnFocusOnDeactivate:l=!0,skipKeysForTrap:n,onSkipKeyPressed:o}=t,d=(0,i.useRef)(null);return(0,i.useEffect)(()=>{r&&(d.current=document.activeElement)},[r]),(0,i.useEffect)(()=>{let t;if(!r)return;let i=e.current;if(!i)return;(null==a?void 0:a.current)&&(t=setTimeout(()=>{(null==a?void 0:a.current)&&a.current.focus()},50));let c=e=>{if(null==n?void 0:n.includes(e.key)){e.preventDefault(),null==o||o(e);return}if(e.key!==s.Keys.TAB)return;let t=(0,x.getFocusableElements)(i,h);if(0===t.length)return;let r=t[0],a=t[t.length-1],l=document.activeElement;e.shiftKey&&l===r?(e.preventDefault(),a.focus()):e.shiftKey||l!==a||(e.preventDefault(),r.focus())};return document.addEventListener("keydown",c),()=>{if(t&&clearTimeout(t),document.removeEventListener("keydown",c),l&&d.current){let e=d.current;setTimeout(()=>{null==e||e.focus()},0)}}},[r,e,a,l,n,o]),{focusFirstElement:(0,i.useCallback)(()=>{let t=(0,x.getFocusableElements)(e.current,h);return t.length>0&&(t[0].focus(),!0)},[e])}};e.s(["FOCUSABLE_ELEMENTS_SELECTOR",0,h,"useFocusTrap",0,f],350322);var v=e.i(821874);e.s(["default",0,({className:e,closable:d=!0,enableOnClickOutside:c=!0,fixed:x,hideModal:h,children:y,modalType:b,open:C,side:w,size:T,style:j,isInPortal:S=!1,...N})=>{let{enableScroll:E,disableScroll:I}=(0,p.useScrollLock)(),{ts:k}=(0,l.default)(),{restorePageData:_}=(0,g.useGeneralTracking)(),A=(0,i.useRef)(null);f(A,{active:C,returnFocusOnDeactivate:!0}),(0,i.useEffect)(()=>{C?I():E()},[C]);let R=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),"PRODUCT_DETAIL_MODAL"===b&&_(),null==h||h(e)},[b,_,h]);if(!C)return null;let P=(0,t.jsx)("div",{className:(0,r.cn)("Modal__overlay",null==b?void 0:b.toLowerCase(),{Modal__product:"PRODUCT_DETAIL_MODAL"===b},"fixed top-0 right-0 bottom-0 left-0 z-[1001] h-full w-full cursor-default overflow-y-scroll bg-[rgba(0,0,0,0.5)]","PRODUCT_DETAIL_MODAL"===b&&"[-webkit-overflow-scrolling:touch]"),id:"modalOverlay",ref:A,onKeyDown:e=>e.key===s.Keys.ESC&&d&&R(e),role:"dialog","aria-modal":"true",tabIndex:0,...N,children:(0,t.jsx)("div",{className:(0,r.cn)("u-flex-center",u,"min-h-full sm:py-[50px]"),children:(0,t.jsxs)(m,{className:e,hideModal:c?R:void 0,side:w,size:T,style:j,isInPortal:S,children:[y,(0,t.jsx)("button",{type:"button",className:(0,r.cn)("bg-transparent",u,{hidden:!d},"absolute top-100 right-100 z-[100] h-[40px] w-[40px] cursor-pointer overflow-hidden p-0","md:-top-250 md:-right-250 md:size-600",x&&"fixed","left"===w&&"animate-[showIn_0.8s]"),"data-test":o.ModalDataTests.modalCloseButton,onClick:e=>{e.preventDefault(),R(e)},children:(0,t.jsx)(n.Circle,{"aria-label":k("common:close"),className:(0,r.cn)(u,"border-1 border-primary bg-primary"),size:"big",children:(0,t.jsx)(v.default.IconCloseX,{height:20,width:20,className:(0,r.cn)(u,"[&_path]:fill-grey-70 dark:[&_path]:fill-grey-40")})})})]})})});if(S&&1){let e=document.getElementById(o.REACT_PORTAL_ID);if(e)return(0,a.createPortal)(P,e);
10console.warn(`Portal container with id "${o.REACT_PORTAL_ID}" not found. Falling back to normal rendering.`)}return P}],360458)},508062,e=>{"use strict";var t=e.i(391398),r=e.i(821874),i=e.i(750436),a=e.i(252921),s=e.i(148103),l=e.i(790117),n=e.i(720533),o=e.i(307932),d=e.i(632938),c=e.i(970503),u=e.i(574537);let m={60:"size-[60px]",64:"size-[64px]"};e.s(["ProductRow",0,({amount:e,imageUrl:p,name:g,textualAmount:x,unit:h,unitPrice:f,children:v,productLink:y,availabilityReason:b,imageGrayscale:C=!1,availabilityReasonDataTest:w,nameDataTest:T,imageDataTest:j,imageSize:S=64})=>{let N=(0,d.useCdn)(),E=(0,c.default)(),I=(0,u.default)(),k=(0,t.jsx)(n.ForceTheme,{light:!0,className:(0,o.cn)(["flex shrink-0 items-center justify-center rounded-small bg-grey-20 p-50",m[S],C&&"grayscale"]),children:p?(0,t.jsx)("img",{alt:"string"==typeof g?g:"",className:"size-full object-contain mix-blend-multiply","data-test":j,src:N(p,{width:2*S,height:2*S}),srcSet:E(p,{width:2*S,height:2*S})}):(0,t.jsx)(r.default.IconCart,{color:"var(--color-icon-tertiary)",height:24,width:24})}),_=(0,t.jsx)("span",{className:"min-w-0 truncate text-100 text-primary leading-300","data-test":T,children:g});return(0,t.jsxs)(t.Fragment,{children:[y?(0,t.jsx)(a.default,{"aria-label":y.ariaLabel,className:"contents cursor-pointer",onClick:y.onClick,to:y.to,children:k}):k,(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-100",children:[e>0&&(0,t.jsxs)(l.Caption,{as:"span",className:"inline-flex shrink-0 items-center rounded-small bg-grey-20 px-50 text-grey-80",children:[e,"x"]}),y?(0,t.jsx)(a.default,{ref:y.impressionRef??void 0,"aria-label":y.ariaLabel,className:"min-w-0 cursor-pointer truncate text-primary no-underline hover:no-underline",onClick:y.onClick,to:y.to,children:_}):_]}),(0,t.jsxs)("div",{className:"flex items-center gap-100",children:[x&&(0,t.jsx)("span",{className:"text-80 text-secondary leading-150",children:x}),x&&h&&(0,t.jsx)("div",{className:"h-[12px] w-px shrink-0 rounded-full bg-grey-30"}),h&&(0,t.jsx)("span",{className:"text-80 text-secondary leading-150",children:I.formatPricePerUnit(f,h)})]}),b?(0,t.jsxs)("div",{className:"mt-25 flex items-center gap-50","data-test":w,children:[(0,t.jsx)(i.default,{className:"shrink-0 [&_path]:fill-grey-70 dark:[&_path]:fill-grey-20",height:"16px",width:"16px"}),(0,t.jsx)(s.BodyText,{as:"span",color:"secondary",size:"xs",children:b})]}):v]})]})}])},661525,e=>{"use strict";var t=e.i(391398),r=e.i(38002),i=e.i(141850),a=e.i(896938);e.s(["ProductRowCounter",0,({centered:e,"data-test":s,onRemoved:l,alwaysExpanded:n,size:o,maxAmountOverride:d})=>{var c;let{count:u,data:m}=(0,i.useProductCardContext)(),{changeQuantity:p}=(0,a.useProductCardActions)(),g=(null==m||null==(c=m.stock)?void 0:c.maxAvailableAmount)??99,x=null!=d?Math.min(g,d):g;return(0,t.jsx)(r.ProductCardCounter,{alwaysExpanded:n,centered:e,"data-test":s,initialValue:u,maximumValue:x,size:o,onQuantityChange:(e,t)=>
10{var r;return 0===e&&(null==l||l()),p(e,(null==m||null==(r=m.prices)?void 0:r.saleId)??void 0,t)}})}])},467531,e=>{e.v({deliveryRestriction:"rohTooltip-module__4svB9a__deliveryRestriction",showing:"rohTooltip-module__4svB9a__showing",slotReservation:"rohTooltip-module__4svB9a__slotReservation",soldout:"rohTooltip-module__4svB9a__soldout",supplyInteruptionsBadge:"rohTooltip-module__4svB9a__supplyInteruptionsBadge",tooltip:"rohTooltip-module__4svB9a__tooltip",tooltipWrapper:"rohTooltip-module__4svB9a__tooltipWrapper"})},538849,e=>{"use strict";var t,r=e.i(391398),i=e.i(307932),a=e.i(191788),s=e.i(625691),l=e.i(995161),n=e.i(772054),o=e.i(435642);let d=e=>{let{ts:t}=(0,o.default)();return(0,r.jsx)("button",{className:"tooltip__close",onClick:e.hideTooltip,"aria-label":t("common:aria.close"),type:"button",children:"Ã"})},c=({isShowing:e,placement:t="top",duration:a,easing:s,delay:o,width:c="100%",className:u,...m})=>{let p=(0,n.default)();return(0,r.jsxs)("div",{className:(0,i.cn)("tooltip__container",t,u,{isShowing:e}),style:{transition:`all ${a}ms ${s} ${o}ms`,width:c},children:[p&&(0,l.isTouchOnly)()&&(0,r.jsx)(d,{hideTooltip:m.hideTooltip}),m.children]})};var u=e.i(498505),m=e.i(467531),p=((t=p||{}).top="top",t.bottom="bottom",t.left="left",t.right="right",t);e.s(["default",0,({delay:e=0,easing:t="ease-in-out",duration:d=180,width:p,wrapperClassName:g,placement:x="top",handleMouseEnter:h,content:f,children:v,timeout:y,loading:b=!1,disabled:C=!1,showCloseButton:w,...T})=>{let j=(0,n.default)(),{ts:S}=(0,o.default)(),[N,E]=(0,a.useState)(!1),[I,k]=(0,a.useState)(0),_=(0,a.useRef)(null),A=(0,a.useRef)(null);(0,a.useEffect)(()=>{!b&&_.current&&k(_.current.offsetHeight)},[f]),b&&(f=(0,r.jsx)(s.default,{inverse:!0}));let R=e=>{var t,r;C||N||E(!0),e.preventDefault(),null==(t=e.stopPropagation)||t.call(e),null==(r=e.stopImmediatePropagation)||r.call(e),y&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>E(!1),3e3))},P=()=>E(!1);return(0,r.jsxs)("div",{className:(0,i.cn)(m.default.tooltipWrapper,N&&m.default.showing,"tooltip__wrapper",g),onClick:R,onKeyUp:(0,u.getOnKeyUpCallback)(R),onMouseEnter:()=>{null==h||h(),C||E(!0)},onMouseLeave:P,role:"button",tabIndex:0,...T,children:[!C&&(0,r.jsx)("div",{className:(0,i.cn)(m.default.tooltip,"tooltip"),children:(0,r.jsxs)(c,{delay:e,duration:d,easing:t,hideTooltip:()=>E(!1),isShowing:N,placement:x,width:p||"",children:[(0,r.jsx)("div",{className:"tooltip__content",style:{height:I?`${I}px`:void 0},children:(0,r.jsx)("div",{ref:_,children:f})}),w&&(0,r.jsx)("button",{type:"button",className:(0,i.cn)("button",{closeTouchOnly:j&&(0,l.isTouchOnly)()}),onClick:P,"aria-label":S("common:aria.close"),children:"Ã"})]})}),v]})}],538849)},47489,e=>{"use strict";var t=e.i(391398),r=e.i(641956),i=e.i(421785);e.s(["ModalButtons",0,({cancelLabel:e,confirmLabel:a,handleCancel:s,handleConfirm:l})=>{let n=e&&s;return(0,t.jsxs)("div",{className:"mt-500 flex flex-row items-center justify-center gap-100 px-200",children:[n&&(0,t.jsx)(r.default,{"data-test":i.ShoppingListModalsDataTest.exitModalButton,onClick:s,type:"secondary",children:e}),(0,t.jsx)(r.default,{className:"w-[360px] max-[768px]:flex-[2_1_auto]","data-test":i.ShoppingListModalsDataTest.createNewButton,onClick:l,children:a})]})}])},289076,e=>{"use strict";var t=e.i(391398),r=e.i(342218),i=e.i(191788),a=e.i(435642),s=e.i(47489),l=e.i(421785),n=e.i(14922);e.s(["default",0,({handleClose:e,handleCreateList:o,name:d,title:c})=>{let u=(0,i.useRef)(null),{t:m}=(0,a.default)();(0,i.useEffect)(()=>{var e;null==(e=u.current)||e.focus()},[]);let[p,g]=(0,i.useState)(d??"");return(0,t.jsxs)("div",{className:"m-500","data-test":l.ShoppingListModalsDataTest.createNewListModal,ref:u,tabIndex:0,role:"dialog","aria-modal":"true",children:[(0,t.jsx)(r.Title,{className:"mb-300 text-center","data-test":l.ShoppingListModalsDataTest.createNewTitle,size:"m",children:c??m("shoppingLists:modal.title")}),(0,t.jsx)(n.NewListInput,{handleEditValue:e=>{g(e)},value:p}),(0,t.jsx)(s.ModalButtons,{cancelLabel:m("shoppingLists:modal.cancel"),confirmLabel:m("shoppingLists:modal.create"),handleCancel:e,handleConfirm:()=>
10o(p)})]})}])},896421,e=>{"use strict";var t=e.i(391398),r=e.i(307932),i=e.i(109445);e.s(["SkeletonImage",0,({width:e,height:a,aspectRatio:s,isRounded:l=!1,className:n,style:o,...d})=>{let c={...o,...e&&{width:`${e}px`},...a&&{height:`${a}px`},...s&&{aspectRatio:String(s)}};return(0,t.jsx)("div",{className:(0,r.cn)([i.skeletonClassNames,l&&"rounded-[50%]",n]),style:c,...d})}])},81869,e=>{"use strict";var t=e.i(720288),r=e.i(225857),i=e.i(578764),a=e.i(893930),s=e.i(134276),l=e.i(417969);let n=async e=>{let t=l.default.createDefaultApiConfig(e),r=await s.default.createAffiliateApi(t);return await r.getAffiliate()};var o=e.i(927623),d=e.i(853127);e.s(["useMobileAppUrl",0,()=>{let e,s=(0,t.default)(),{homeUrl:l,appDynamicLink:c,appStoreUrl:u,googlePlayUrl:m}=(0,d.useConfiguration)(),{cjEvent:p,tduId:g,referralCode:x}=(()=>{let e,{router:t}=(0,i.useRouting)(),{tduid:r,cjevent:s,referralCode:l}=t.query,{data:d}=(e=!s||!r,(0,a.useQuery)({queryKey:["affiliate"],queryFn:()=>n(),enabled:!!e}));return{cjEvent:(null==d?void 0:d.affiliateProvider)===o.AffiliateRequestAffiliateProviderEnum.Cj?null==d?void 0:d.referer:s,tduId:(null==d?void 0:d.affiliateProvider)===o.AffiliateRequestAffiliateProviderEnum.TradeDoubler?null==d?void 0:d.referer:r,referralCode:l}})(),{router:h}=(0,i.useRouting)(),f=p||g||x,v=e=>{let t=l+h.asPath.split("?")[0],i=(0,r.setUrlParams)(t,{cjevent:p,tduid:g,referralCode:x});return e&&f?(0,r.setUrlParams)(e,{deep_link_value:i}):e},y=v(f?c:u),b=v(f?c:m);return y&&(s.isiPhone||s.isiPad)&&(e=y),b&&(s.isAndroid||s.isAndroidTablet)&&(e=b),{appUrlOnPlatformDevices:e,appStoreUrl:y,googlePlayUrl:b}}],81869)},263329,e=>{"use strict";var t=e.i(391398),r=e.i(92684);e.s(["ConditionedTooltip",0,({children:e,content:i,...a})=>i?(0,t.jsx)(r.Tooltip,{content:i,...a,children:e}):(0,t.jsx)(t.Fragment,{children:e})])},952097,280970,635089,e=>{"use strict";var t,r=e.i(281476),i=e.i(110879),a=e.i(782829),s=((t={}).Closed="CLOSED",t.Installed="INSTALLED",t);e.s(["SmartBannerCloseType",()=>s],280970);let l={[s.Closed]:14,[s.Installed]:14},n={smartbanner:"Smartbanner",creativeInstall:"Install our app",creativeClose:"Install our app (Close Button)"};e.s(["REOPEN_PERIOD",0,l,"SmartBannerDataGtm",0,n,"SmartBannerDataTests",0,{buttonInstall:"smartBanner-install",buttonClose:"smartBanner-close"},"TOTAL_STAR",0,5],635089),e.s(["useAnalyticsApplicationEvents",0,()=>(()=>{let{pushToDataLayer:e}=(0,r.useGtmContext)();return{languageChanged:t=>{e(i.GtmEventsFactory.languageChange(t))},chatOpened:t=>{e(i.GtmEventsFactory.chatOpened(t))},smartBannerViewed:()=>{e(i.GtmEventsFactory.viewPromotion([{name:n.smartbanner,location:a.GtmLocationFactory.header(),creative:n.creativeInstall}]))},smartBannerInstallBtnClicked:()=>{e(i.GtmEventsFactory.selectPromotion({name:n.smartbanner,location:a.GtmLocationFactory.header(),creative:n.creativeInstall}))},smartBannerCloseBtnClicked:()=>{e(i.GtmEventsFactory.selectPromotion({name:n.smartbanner,location:a.GtmLocationFactory.header(),creative:n.creativeClose}))}}})()],952097)},528448,e=>{"use strict";var t=e.i(927623),r=e.i(426242);let i=()=>{let{registerImpression:e,registerClick:i}=(0,r.useMetricBatchBuffer)();return{categoryClicked:(e,r)=>{i({component:{id:r.searchQuery,type:""===r.searchQuery?t.ComponentType.SearchRecommended:t.ComponentType.SearchWhisperer},item:{id:e.id.toString(),type:t.ItemType.Category,position:r.position},impressionId:void 0})},whispererProductViewed:r=>{var i;r.impression&&e({impressionId:(null==(i=r.impression)?void 0:i.impressionId)??void 0,productIds:[r.product.id],item:{id:r.product.id.toString(),type:t.ItemType.Suggestion}})},recipeClicked:(e,r)=>{i({component:{id:r.searchQuery,type:""===r.searchQuery?t.ComponentType.SearchRecommended:t.ComponentType.SearchWhisperer},item:{id:e.id.toString(),type:t.ItemType.Recipe,position:r.position},impressionId:void 0})},suggestionClicked:(e,r)=>{i({component:{id:r.searchQuery,type:""===r.searchQuery?t.ComponentType.SearchRecommended:t.ComponentType.SearchWhisperer},item:{id:e,type:t.ItemType.Suggestion,position:r.position},impressionId:void 0})},searchResultRecipeClicked:(e,r)=>{i({component:{id:r.searchQuery,type:t.ComponentType.ProductSlider},item:{id:e.id.toString(),type:t.ItemType.Recipe,position:r.position},impressionId:void 0})},searchResultRecipeButtonClicked:()=>{i({component:null,item:{id:"show-recipes",type:t.ItemType.Button},impressionId:void 0})},searchResultCategoryClicked:(e,r)=>{i({item:{id:e.id.toString(),type:t.ItemType.Category,position:r.position},impressionId:void 0})}}};var a=e.i(281476),s=e.i(110879),l=e.i(782829),n=e.i(997981),o=e.i(575590);e.s(["useAnalyticsSearchEvents",0,()=>{let e=(()=>{let{pushToDataLayer:e}=(0,a.useGtmContext)(),{mapProducts:t,mapProductsNew:r}=(0,n.useGtmProductInfoMappers)(),{whispererProductViewed:d}=i(),c=(0,o.useUniqsid)(),u=(t,i)=>{e(s.GtmEventsFactory.deprecated_viewItemList(i,r(t.products))),t.products.forEac
10h(e=>{d(e)}),e(s.GtmEventsFactory.searchSuggest(t.searchQuery,t.autocomplete.totalHits,t.autocomplete.totalCategoryHits,t.autocomplete.totalRecipeHits,t.autocomplete.source,{attributionToken:t.autocomplete.attributionToken??null,visitorId:c}))};return{whispererViewed:e=>{let t=l.GtmLocationFactory.whisperer(e.searchQuery);u(e,t)},whispererRecommendedViewed:e=>{u(e,l.GtmLocationFactory.whispererRecommended())},searchResultsViewed:(t,r,i,a,l,n,o)=>{e(s.GtmEventsFactory.search(t,r,i,a,l,n,{visitorId:c,offset:null==o?void 0:o.offset,orderBy:null==o?void 0:o.orderBy}))},searchProductsLoaded:(r,i)=>{let a=l.GtmLocationFactory.searchResults(r);e(s.GtmEventsFactory.deprecated_viewItemList(a,t(i)))}}})(),t=i();return{whispererViewed:e.whispererViewed,whispererRecommendedViewed:e.whispererRecommendedViewed,searchResultsViewed:e.searchResultsViewed,searchProductsLoaded:e.searchProductsLoaded,categoryClicked:t.categoryClicked,recipeClicked:t.recipeClicked,suggestionClicked:t.suggestionClicked,searchResultCategoryClicked:t.searchResultCategoryClicked,searchResultRecipeClicked:t.searchResultRecipeClicked,searchResultRecipeButtonClicked:t.searchResultRecipeButtonClicked}}],528448)},470561,e=>{"use strict";e.s(["CART_REVIEW_SUMMARY_DATA_TESTS",0,{wrapper:"cart-review-summary",wrapperMobile:"cart-review-summary-mobile",wrapperDesktop:"cart-review-summary-desktop",continueBtn:"cart-review-summary-button",priceDisplay:"cart-review-summary-price",itemCountBadge:"cart-review-summary-item-count",deliverySourceBadge:"cart-review-summary-delivery-source",freeDeliveryBadge:"cart-review-summary-free-delivery",premiumMessageBadge:"cart-review-summary-premium-message",validationMessage:"cart-review-summary-validation",validationTooltip:"cart-review-summary-validation-tooltip",totalPrice:"cart-review-summary-total-price",validationStandardPrice:"validation-message-standard-price",validationDeliveryPointPrice:"validation-message-delivery-point-price",blockingMessage:"cart-review-summary-blocking-message",startShoppingBtn:"cart-review-summary-start-shopping",segmentedProgressBar:"cart-review-segmented-progress",deliveryInfoButton:"cart-review-delivery-info-button",deliveryFeeSheet:"cart-review-delivery-fee-sheet",deliveryFeeSheetLoading:"cart-review-delivery-fee-sheet-loading"}])},140248,e=>{"use strict";var t=e.i(391398),r=e.i(927623),i=e.i(292905),a=e.i(285700),s=e.i(134276),l=e.i(957744),n=e.i(673552),o=e.i(138009),d=e.i(576983),c=e.i(632938),u=e.i(307932),m=e.i(179243),p=e.i(937569),g=e.i(578764),x=e.i(498505);let h=({type:e,iconUrl:i})=>{let a=(0,c.default)();return e===r.CartBannerType.Babyclub?(0,t.jsx)(p.default,{type:"babyClub",color:"var(--white)",circleSize:"smaller",className:"p-[2px]"}):e===r.CartBannerType.PremiumCartSavings||e===r.CartBannerType.PremiumMonthlySavings||e===r.CartBannerType.RemainingOrdersWithoutLimit?(0,t.jsx)(m.default,{width:24,height:24}):i?(0,t.jsx)("img",{src:a(i),alt:"",width:24,height:24,"data-test":"cart-review-promo-banner-icon"}):null};e.s(["CartReviewPromoBanners",0,()=>{var e;let c,{cart:m}=(0,d.default)(),{router:p}=(0,g.useRouting)(),{mutate:f}=(c=(0,a.useQueryClient)(),(0,i.useMutation)({mutationFn:async e=>(await s.default.createCartBannerControllerApi()).closePromoBanner(1,e),onSuccess:()=>{c.invalidateQueries({queryKey:[l.cartQueryKeyPrefix]})}})),v=(0,o.useGtmCartEvents)(),y=null==m||null==(e=m.cartBanners)?void 0:e.filter(e=>e.type!==r.CartBannerType.Essential);if(!(null==y?void 0:y.length))return null;let b=e=>()=>{e.link&&(v.promoBannerClicked(e.type),p.push(e.link))};return(0,t.jsxs)(t.Fragment,{children:[y.map(e=>{let r,i=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h,{type:e.type,iconUrl:e.icon}),(0,t.jsx)("div",{className:"flex-1 text-left text-80 text-grey-0 leading-200 [&_*]:text-left",dangerouslySetInnerHTML:{__html:e.message},"data-test":"cart-review-promo-banner-message"}),e.closable&&(0,t.jsx)("button",{type:"button",onClick:(r=e.type,e=>{e.stopPropagation(),f({type:r}),v.promoBannerClose(r)}),className:(0,u.cn)("flex items-center justify-center","h-250 w-250 shrink-0","cursor-pointer","hover:opacity-80"),"aria-label":"ZavÅÃt banner","data-test":"cart-review-promo-banner-close",children:(0,t.jsxs)("div",{className:"relative h-200 w-200",children:[(0,t.jsx)("div",{className:(0,u.cn)("absolute top-1/2 left-1/2","-translate-x-1/2 -translate-y-1/2","h-[2px] w-[14px]","rotate-45 bg-grey-60")}),(0,t.jsx)("div",{className:(0,u.cn)("absolute top-1/2 left-1/2","-translate-x-1/2 -translate-y-1/2","h-[2px] w-[14px]","-rotate-45 bg-grey-60")})]})})]});return(0,t.jsx)(n.default,{emit:v.promoBannerViewed(e.type),children:e.link?(0,t.jsx)("button",{type:"button",onClick:b(e),onKeyUp:(0,x.getOnKeyUpCallback)(b(e)),className:(0,u.cn)("flex w-full cursor-pointer items-center gap-100"),children:i}):(0,t.jsx)("div",{className:"flex items-center gap-100",children:i})},e.type)}),y.length>0&&(0,t.jsx)("div",{className:"h-10 w-full bg-alpha-white-10 sm:my-100 dark:bg-alpha-10"})]})}],140248)},84161,e=>{"use strict";var t=e.i(391398),r=e.i(307932),i=e.i(288505),a=e.i(740605),s=e.i(488891),l=e.i(435642),n=e.i(574537),o=e.i(342218),d=e.i(97902),c=e.i(470561);e.s(["DeliveryFeeInfoSheet",0,({onClose:e})=>{let{ts:u,t:m}=(0,l.default)(),p=(0,s.useIsMobile)(),g=(0,n.default)(),{priceLevels:x,freeOrderFrom:h,minimalOrderValue:f,isLoading:v,priceLevelsLoading:y}=(0,a.useDeliveryModalV2Data)(),b=!!(h&&f),C=x.length>0,w=u("cart:free"),T=(0,t.jsx)(d.Button,{variant:"primary",isFullWidth:!0,isLoading:!1,size:"l",onClick:e,children:(0,t.jsx)("span",{className:"font-semibold",children:u("cart:deliveryFeeAccept")})});return(0,t.jsx)(i.FloatingSheet,{open:!0,onClose:e,ariaLabel:u("delivery:deliveryModalV2.fees.heading"),dataTest:c.CART_REVIEW_SUMMARY_DATA_TESTS.deliveryFeeSheet,desktopMaxWidthClassName:"max-w-[400px]",footer
10:p?T:void 0,children:(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-150 px-300 pb-400",p?"pt-200":"pt-400"),children:[(0,t.jsx)(o.Title,{as:"h2",size:"m",children:u("delivery:deliveryModalV2.fees.heading")}),!b&&v&&(0,t.jsxs)("div",{className:"flex flex-col gap-50","aria-hidden":"true","data-test":c.CART_REVIEW_SUMMARY_DATA_TESTS.deliveryFeeSheetLoading,children:[(0,t.jsx)("div",{className:"h-[14px] w-full animate-pulse rounded-[4px] bg-grey-30"}),(0,t.jsx)("div",{className:"h-[14px] w-2/3 animate-pulse rounded-[4px] bg-grey-30"})]}),h&&f&&(0,t.jsxs)("div",{className:"text-left text-grey-60 text-m leading-250 [&_strong]:font-semibold [&_strong]:text-grey-90",children:[m("cart:deliveryFeeIntro",{free:h,min:f})," ",u("delivery:deliveryModalV2.fees.note")]}),!C&&y&&(0,t.jsx)("div",{className:"mt-100 flex flex-col gap-150","aria-hidden":"true",children:[0,1,2,3].map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100",children:[(0,t.jsx)("div",{className:"h-[16px] w-2/5 animate-pulse rounded-[4px] bg-grey-30"}),(0,t.jsx)("div",{className:"h-[16px] w-1/5 animate-pulse rounded-[4px] bg-grey-30"})]},e))}),C&&(0,t.jsxs)("div",{className:"mt-100 flex flex-col gap-100",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100",children:[(0,t.jsx)("span",{className:"font-semibold text-70 text-grey-60 uppercase tracking-wide",children:u("cart:deliveryFeeColCart")}),(0,t.jsx)("span",{className:"font-semibold text-70 text-grey-60 uppercase tracking-wide",children:u("cart:deliveryFeeColFee")})]}),(0,t.jsx)("ul",{className:"flex flex-col divide-y divide-grey-30",children:x.map((e,i)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-100 py-150",children:[(0,t.jsx)("span",{className:"text-m text-primary tabular-nums",children:e.priceLevelLabel}),(0,t.jsx)("span",{className:(0,r.cn)("font-bold text-m tabular-nums",0===e.deliveryPrice?"text-green-60":"text-primary"),children:0===e.deliveryPrice?w:e.maxDeliveryPrice>e.deliveryPrice?e.deliveryPriceLabel:Number.isInteger(e.deliveryPrice)?g.formatPriceWithFractionDigits(e.deliveryPrice,0):g.formatPrice(e.deliveryPrice)})]},e.priceLevelLabel||i))})]}),!b&&!C&&!v&&!y&&(0,t.jsx)("div",{className:"text-left text-grey-60 text-m leading-250",children:u("delivery:deliveryModalV2.fees.note")}),!p&&T]})})}])},658384,e=>{"use strict";var t=e.i(391398),r=e.i(821874),i=e.i(435642);e.i(340275);var a=e.i(139834),s=e.i(470561);e.s(["SegmentedDeliveryProgressBar",0,({message:e,segments:l,isComplete:n,onInfoClick:o})=>{let{ts:d}=(0,i.default)(),c=0,u=0,m=0;for(let e of l){let t=Math.max(e.targetAmount-m,1);u+=t,c+=e.fill/100*t,m=e.targetAmount}let p=u>0?Math.round(c/u*100):0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:"@keyframes segbar-check-in{from{transform:scale(0.3);opacity:0}to{transform:scale(1);opacity:1}}.segbar-check{animation:segbar-check-in 0.3s cubic-bezier(0.34,1.56,0.64,1)}@media(prefers-reduced-motion:reduce){.segbar-check{animation:none}}"}),(0,t.jsxs)("div",{className:"flex flex-col gap-100","data-test":s.CART_REVIEW_SUMMARY_DATA_TESTS.segmentedProgressBar,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100",children:["string"==typeof e?(0,t.jsx)("div",{className:"flex-1 font-semibold text-90 text-inverted leading-250",dangerouslySetInnerHTML:{__html:(0,a.sanitizeHtml)(e)}}):(0,t.jsx)("div",{className:"flex-1 font-semibold text-90 text-inverted leading-250",children:e}),(0,t.jsx)("button",{type:"button",onClick:o,"aria-label":d("delivery:deliveryModalV2.fees.heading"),"data-test":s.CART_REVIEW_SUMMARY_DATA_TESTS.deliveryInfoButton,className:"flex size-[20px] shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-grey-40 transition-colors hover:text-inverted",children:(0,t.jsx)(r.default.IconInfoLight,{width:20,height:20,color:"currentColor","aria-hidden":"true"})})]}),!n&&(0,t.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,t.jsx)("progress",{className:"sr-only",max:100,value:p,"aria-label":d("delivery:deliveryModalV2.fees.heading")}),(0,t.jsx)("div",{className:"flex min-h-[16px] items-center gap-50","aria-hidden":"true",children:l.map(e=>e.reached?(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-50",children:[(0,t.jsx)("div",{className:"h-[6px] flex-1 rounded-[2px] bg-green-40"}
10),(0,t.jsx)("span",{className:"segbar-check flex size-[16px] shrink-0 items-center justify-center rounded-[5px] bg-green-40",children:(0,t.jsx)(r.default.IconCheck,{width:13,height:13,color:"var(--green-80)","aria-hidden":"true"})})]},e.targetAmount):(0,t.jsx)("div",{className:"h-[6px] flex-1 overflow-hidden rounded-[2px] bg-alpha-white-20 dark:bg-alpha-10",children:e.isCurrent&&(0,t.jsx)("div",{className:"h-full rounded-[2px] bg-yellow-60 transition-[width] duration-200 ease-out motion-reduce:transition-none",style:{width:`${e.fill}%`}})},e.targetAmount))}),(0,t.jsx)("div",{className:"flex gap-50",children:l.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-25 overflow-x-clip whitespace-nowrap text-60",children:[(0,t.jsx)("span",{className:"shrink-0 text-grey-30",children:e.label}),(0,t.jsx)("span",{className:"shrink-0 font-bold text-inverted",children:e.formattedAmount})]},e.targetAmount))})]})]}),(0,t.jsx)("div",{className:"h-10 w-full bg-alpha-white-10 sm:my-100 dark:bg-alpha-10"})]})}])},417370,e=>{"use strict";var t=e.i(191788),r=e.i(853127),i=e.i(365149),a=e.i(435642),s=e.i(188989);e.s(["useActiveThreshold",0,(e,l)=>{let{t:n}=(0,a.default)(),{currencyCode:o}=(0,r.useConfiguration)(),{isFtu:d}=(0,s.useDeliveryFtuInfo)(),c=(0,t.useMemo)(()=>{let e=new Intl.NumberFormat("cs-CZ",{style:"currency",currency:o,minimumFractionDigits:0,maximumFractionDigits:2}),t="CZK"===o||"HUF"===o?1:100;return r=>e.format(Math.ceil(r*t)/t)},[o]),{totalPrice:u,minimalStandardOrderPrice:m,minimalDeliveryPointOrderPrice:p,deliveryPointEnabled:g}=e;if(d){if(u<m){let e=Math.max(m-u,0);return{type:i.ThresholdType.FREE_DELIVERY,targetAmount:m,progress:Math.min(u/m*100,100),remainingAmount:e,message:n("cart:ftuMinOrderProgress",{remainingAmount:c(e),minOrder:c(m)})}}return null}if(g&&u<p){let e=Math.max(p-u,0),t=c(e);return{type:i.ThresholdType.DELIVERY_POINT,targetAmount:p,progress:Math.min(u/p*100,100),remainingAmount:e,message:n("cart:remainingToDeliveryPoint",{remainingAmount:t})}}if(u<m){let e=Math.max(m-u,0),t=c(e);return{type:i.ThresholdType.HOME_DELIVERY,targetAmount:m,progress:Math.min(u/m*100,100),remainingAmount:e,message:n("cart:remainingToHomeDelivery",{remainingAmount:t})}}if(l&&(l.progress??0)<1){var x;let e=Math.round((l.progress??0)*100),t="string"==typeof l.message?l.message:(null==(x=l.message)?void 0:x.content)||"";return{type:i.ThresholdType.FREE_DELIVERY,targetAmount:0,progress:e,remainingAmount:0,message:t}}return null}])},188989,365149,e=>{"use strict";var t,r=e.i(853127),i=e.i(344643),a=e.i(354482),s=e.i(840358),l=e.i(720313);let n=[l.Region.DE,l.Region.AT,l.Region.RO,l.Region.HU],o=e=>n.includes(e);e.s(["isMinimumOrderDeliveryRegion",0,o,"useDeliveryFtuInfo",0,()=>{let{tenant:e}=(0,r.useConfiguration)(),{address:t}=(0,i.useDeliveryInfo)(),l=(0,a.useStartDeliveryInfo)(null==t?void 0:t.id),n=(0,s.getRegionByTenant)(e);return{isFtu:o(n)&&!!l.freeForFTU,hasFreeDelivery:!!l.freeForFTU,freeDeliveryAmount:l.freeOrderValueAmount,region:n,isMilestoneSetStable:!o(n)||!!l.isSettled}}],188989);var d=((t={}).DELIVERY_POINT="DELIVERY_POINT",t.HOME_DELIVERY="HOME_DELIVERY",t.FREE_DELIVERY="FREE_DELIVERY",t);e.s(["ThresholdType",()=>d],365149)},586489,e=>{"use strict";var t=e.i(574537),r=e.i(435642),i=e.i(720313),a=e.i(188989),s=e.i(365149);e.s(["useDeliverySegments",0,e=>{var l,n;let o,d,c,{ts:u}=(0,r.default)(),m=(0,t.default)(),{isFtu:p,hasFreeDelivery:g,freeDeliveryAmount:x,region:h}=(0,a.useDeliveryFtuInfo)(),f=h===i.Region.CZ,v=((o=[...((e,t,r,i,a)=>{let{totalPrice:l,minimalStandardOrderPrice:n,minimalDeliveryPointOrderPrice:o,deliveryPointEnabled:d,freeDeliveryRemainingAmount:c}=e,u=[];if(t&&n>0)return u.push({type:s.ThresholdType.FREE_DELIVERY,amount:n,label:a.home}),u;if(d&&o>0&&u.push({type:s.ThresholdType.DELIVERY_POINT,amount:o,label:a.point}),n>0&&u.push({type:s.ThresholdType.HOME_DELIVERY,amount:n,label:a.home}),r)return u;let m=c??0,p=i??0;return p<=0&&m>0&&(p=l+m),p>0&&u.push({type:s.ThresholdType.FREE_DELIVERY,amount:p,label:a.free}),u})(e,p,g,x,{free:u(f?"cart:free":"delivery:deliveryModalV2.factsList.freeDelivery"),point:u("delivery:deliveryModalV2.mode.point"),home:u(f?"delivery:deliveryModalV2.mode.home":"cart:minimumOrder")})]).sort((e,t)=>
10e.amount-t.amount),o.filter((e,t,r)=>0===t||e.amount>r[t-1].amount));return v.length?(l=e.totalPrice,n=e=>m.formatPriceWithFractionDigits(e,0),d=0,c=!1,v.map(e=>{let t=Math.max(e.amount-d,1),r=l>=e.amount,i=!r&&!c;i&&(c=!0);let a=0;return r?a=100:i&&(a=Math.min(Math.max((l-d)/t*100,0),100)),d=e.amount,{type:e.type,targetAmount:e.amount,formattedAmount:n(e.amount),label:e.label,reached:r,isCurrent:i,fill:a}})):null}])},93210,e=>{"use strict";var t=e.i(391398),r=e.i(360458),i=e.i(28607),a=e.i(558021),s=e.i(292905),l=e.i(134276),n=e.i(641997),o=e.i(342218),d=e.i(148103),c=e.i(790117),u=e.i(821874),m=e.i(97902),p=e.i(435642),g=e.i(970464),x=e.i(941043),h=e.i(252921),f=e.i(853127),v=e.i(794060);e.s(["AskForProductModal",0,({isOpen:e,onClose:y})=>{let{t:b,ts:C}=(0,p.default)(),{gdprUrl:w}=(0,f.useConfiguration)(),{isAuthenticated:T}=(0,v.default)(),j=(0,a.useForm)({defaultValues:{productSuggestion:"",consent:!1}}),{register:S,handleSubmit:N,reset:E,formState:{errors:I}}=j,{mutate:k,isPending:_,data:A,reset:R}=(0,s.useMutation)({mutationFn:async({suggestionPlainText:e,consentGiven:t})=>(await l.default.createProductUserSuggestionsApi()).suggestNewProduct1({suggestionPlainText:e,consentGiven:t})}),P=()=>{E({productSuggestion:"",consent:!1}),R(),y()};return e?(0,t.jsx)(r.default,{open:!0,hideModal:P,size:"m","aria-label":C("catalog:whisperer.suggestion.form.title"),isInPortal:!0,children:(0,t.jsx)("div",{className:"flex flex-col items-center gap-200 p-200 text-center md:p-500","data-test":g.NO_RESULT_TESTS.formWrapper,children:A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{backgroundColor:"var(--background-color-primary)",borderColor:"var(--color-icon-brand-new)",size:"large",children:(0,t.jsx)(u.default.IconCheckVector,{color:"var(--color-icon-brand-new)"})}),(0,t.jsx)(o.Title,{size:"m",as:"h3","data-test":g.NO_RESULT_TESTS.dataTitle,children:A.title}),(0,t.jsx)(d.BodyText,{size:"s","data-test":g.NO_RESULT_TESTS.dataMessage,children:A.message}),(0,t.jsx)(m.Button,{isFullWidth:!0,onClick:P,isLoading:!1,"data-test":g.NO_RESULT_TESTS.closeButton,children:C("common:close")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Title,{size:"m",as:"h3","data-test":g.NO_RESULT_TESTS.formTitle,children:C("catalog:whisperer.suggestion.form.title")}),(0,t.jsx)(a.FormProvider,{...j,children:(0,t.jsx)("form",{onSubmit:N(({productSuggestion:e,consent:t})=>k({suggestionPlainText:e,consentGiven:t})),className:"w-full",noValidate:!0,children:(0,t.jsxs)("div",{className:"flex flex-col gap-200",children:[(0,t.jsx)(i.default,{placeholder:C("catalog:whisperer.suggestion.form.hint"),...S("productSuggestion",{required:C("common:fields.required"),maxLength:{value:300,message:C("common:clientErrors.maxLength",{count:300})}}),"data-test":g.NO_RESULT_TESTS.input,errors:I,required:!0}),T&&(0,t.jsx)(x.HookCheckbox,{className:"text-left",id:"askForProductConsent",name:"consent","data-test":g.NO_RESULT_TESTS.consentCheckbox,label:C("catalog:whisperer.suggestion.form.consentLabel")}),(0,t.jsx)(c.Caption,{className:"text-left","data-test":g.NO_RESULT_TESTS.consentTerms,children:b("catalog:whisperer.suggestion.form.consentTerms",{components:{Link:(0,t.jsx)(h.default,{rel:"noopener noreferrer",tabIndex:0,target:"_blank",to:w,children:"privacy policy link"},"askForProductConsent__link")}})}),(0,t.jsx)(m.Button,{"data-test":g.NO_RESULT_TESTS.formButton,isFullWidth:!0,isSubmit:!0,isDisabled:_,children:C("catalog:whisperer.suggestion.form.buttonText")})]})})})]})})}):null}],93210)},62851,e=>{"use strict";e.s(["ProductDataTests",0,{productPriceDeposit:"deposit",productPriceDepositPackaging:"deposit-packaging",productRegularDiscount:"regular-discount",premiumDiscount:"premium-discount",badgeInCart:"badge-in-cart",productImage:"product-image"},"SearchDataTests",0,{titleWrapper:"search-results-title-wrapper",title:"search-results-title"},"WhispererDataTests",0,{productWrapper:"whisperer-product-wrapper",productLink:"whisperer-product-link",productName:"whisperer-product-name",onlyPremiumButton:"whisperer-product-only-premium",productImage:"whisperer-product-image",unavailableButton:"whisperer-unavailable-button",unavailableReason:"whisperer-unavailable-reason",deliveryInteruption:"whisperer-delivery-interuption",deliveryRestriction:"whisperer-delivery-restriction",productPrice:"whisperer-product-price",productOldPrice:"whisperer-product-old-price",productSponsored:"whisperer-product-sponsored",productMultipack:"whisperer-product-multipack",
10suggestedKeywords:"whisperer-suggested-keywords",keywordLink:"whisperer-keyword-link",whispererWrapper:"whisperer-wrapper",whispererSkeleton:"whisperer-skeleton",allProducts:"whisperer-products-all",allProductsBlockLink:"whisperer-products-all-block-link",productsHeader:"whisperer-products-header",categoriesHeader:"whisperer-categories-header",categoryLink:"whisperer-category-link",recipesHeader:"whisperer-recipes-header",allRecipesLink:"whisperer-recipes-all-link",recipeLink:"whisperer-recipe-link",tagList:"whisperer-tag-list",noResultsHeader:"whisperer-no-results-header",exclusivePrduct:"whisperer-exclusive-product",whispererInfobox:"whisperer-infobox",whispererInfoboxIcon:"whisperer-infobox-icon",whispererInfoboxButton:"whisperer-infobox-button",whispererInfoBoxLabel:"whisperer-infobox-label",whispererInfoBoxDescription:"whisperer-infobox-description",whispererInfoBoxTitle:"whisperer-infobox-title"}])},471314,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(538849),a=e.i(467531),s=e.i(435642),l=e.i(893930),n=e.i(134276);let o=async e=>{if(!e)return null;let t=await n.default.createGoodsDetailAndListApi();return(await t.getProductDeliveryInfo(e)).data};var d=e.i(307932);e.s(["default",0,({productId:e,label:n,onlyLabel:c=!1,tooltipPlacement:u="top",bigTextLabel:m=!1,...p})=>{let g,[x,h]=(0,r.useState)(""),{ts:f}=(0,s.default)(),[v,y]=(0,r.useState)(!1),{data:b,isError:C}=(g={enabled:v,productId:e},(0,l.useQuery)({queryKey:["product-delivery-restriction",g.productId],queryFn:e=>o(e.queryKey[1]),enabled:g.enabled&&!!g.productId}));(0,r.useEffect)(()=>{b&&h(b)},[b]),(0,r.useEffect)(()=>{C&&h(f("errors:noFetchData"))},[C]);let w=p["data-test"]??"delivery-restricton-label",T={...p,"data-test":w},j=(0,d.cn)("font-bold text-70 text-[var(--red-60)] leading-normal no-underline",!c&&"inline cursor-help border-[var(--red-60)] border-b-2 border-dotted",m&&"font-normal text-100");return c?(0,t.jsx)("div",{className:j,...T,children:n}):(0,t.jsx)(i.default,{content:(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:x}}),"data-test":"delivery-restriction-tooltip",handleMouseEnter:()=>!v&&y(!0),loading:!x,placement:u,wrapperClassName:a.default.deliveryRestriction,children:(0,t.jsx)("div",{className:j,...T,children:n})})}],471314)},514703,374360,389756,e=>{"use strict";var t=e.i(391398),r=e.i(148103);let i={ratingNumber:"rating-number",ratingStars:"rating-stars",ratingCount:"rating-count",starsCard:"stars-card",ratingSkeleton:"rating-skeleton"};e.s(["RATING_AUTOCLOSE_DELAY",0,2500,"RatingFlowDataTest",0,{ratingFlow:"rating-flow",ratingToggle:"rating-toggle",ratingDropdown:"rating-dropdown",ratingStar:e=>`rating-star-${e}`,ratingThankYou:"rating-thank-you"},"RatingStarsDataTest",0,i,"TOTAL_STARS",0,5],374360);var a=e.i(821874);let s=({filled:e,size:r})=>e?(0,t.jsx)(a.default.IconStar,{color:"var(--yellow-60)",height:r,width:r}):(0,t.jsx)(a.default.IconStarEmpty,{height:r,width:r});e.s(["RatingStar",0,s],389756),e.s(["RatingBar",0,({rating:e,ratingCount:a})=>(0,t.jsxs)("div",{className:"flex items-center",children:[!!e&&(0,t.jsx)(r.BodyText,{semiBold:!0,className:"mr-50","data-test":i.ratingNumber,size:"xs",children:e}),(0,t.jsx)("div",{className:"mr-50 flex items-center","data-test":i.ratingStars,children:[void 0,void 0,void 0,void 0,void 0].map((r,i)=>(0,t.jsx)(s,{filled:i<Math.round(e)},i))}),(0,t.jsxs)(r.BodyText,{color:"secondary","data-test":i.ratingCount,size:"xs",children:["(",a,")"]})]})],514703)},877587,e=>{"use strict";e.s(["SEARCH_FORM_IDENTIFIER",0,"data-search-active","SEARCH_PAGE_LIMIT",0,30,"SearchCatalogBodyDataTests",0,{wrapper:"searchCatalogBody-wrapper",catalogFilters:"searchCatalogBody-catalogFilters",inDrugstoreHeader:"searchCatalogBody-dg-header",otherCompanyItem:"searchCatalogBody-other-company-item",noResultsMaiaWrapper:"searchCatalogBody-no-results-maia"},"SearchDataTests",0,{searchButton:"header-search-button",logoDrugstore:"logo-drugstore",wrapper:"catalog-filters-wrapper",searchForm:"search-form",searchInput:"search-input"},"SearchNoResultsBannerDataTests",0,{wrapper:"search-no-results-banner-wrapper",content:"search-no-results-banner-content",askForProductButton:"search-no-results-ask-for-product",askMaiaButton:"search-no-results-ask-maia"},"SearchResultsWrapperDataTests",0,{wrapper:"searchCatalogBody-wrapper"},"SubcategoriesDataTests",0,{wrapper:"subcategories-wrapper"}])},756205,e=>{"use strict";e.s(["WHISPERER_ID",0,{header:"whisperer-products-header",keywords:"whisperer-suggested-keywords",wrapper:"whisperer"}])},445246,123555,899885,2751,511073,587627,e=>{"use strict";var t=e.i(307932);let r={wrapper:(0,t.cn)("absolute inset-x-0 top-full z-[12] mx-auto max-w-[98vw]","flex flex-col overflow-y-auto overflow-x-hidden","rounded-b-[16
10px] border border-primary bg-primary","leading-none shadow-[0_8px_16px_rgba(0,0,0,0.12)]","text-left [-webkit-overflow-scrolling:touch]","[&:empty]:hidden","md:right-0 md:left-auto md:w-[768px] md:translate-x-0","[&_.whispererProductLink]:block [&_.whispererProductLink]:no-underline"),wrapperMobileOverlay:(0,t.cn)("relative flex w-full max-w-none flex-1","sm:absolute sm:inset-x-0 sm:top-full sm:z-[12] sm:mx-auto sm:h-auto sm:max-w-[98vw] sm:flex-initial","flex flex-col overflow-x-hidden","sm:overflow-y-auto"),wrapperSticky:(0,t.cn)("max-h-[calc(100vh-64px)]","md:right-0 md:left-auto md:w-[768px] md:translate-x-0"),textStrikeThrough:(0,t.cn)("before:content-['\"'] after:content-['\"']","[&_s]:relative [&_s]:font-normal [&_s]:italic [&_s]:no-underline","[&_s]:px-[1px]",'[&_s]:after:absolute [&_s]:after:top-1/2 [&_s]:after:content-[""]',"[&_s]:after:left-0 [&_s]:after:h-[1px] [&_s]:after:w-full","[&_s]:after:bg-black")},i=({isMobileOverlay:e,isSticky:i})=>(0,t.cn)(!e&&r.wrapper,{[r.wrapperSticky]:!!i},{[r.wrapperMobileOverlay]:!!e});e.s(["getWhispererWrapperClassName",0,i,"whispererStyles",0,r],445246);var a=e.i(391398),s=e.i(962059),l=e.i(62851),n=e.i(252921);e.s(["default",0,({category:e,prefix:t,afterCategoryClick:r,title:i})=>{let o=(0,s.default)(),d=`${t??""}${e.link}`;return(0,a.jsx)(n.default,{className:"border-primary border-b no-underline","data-test":l.WhispererDataTests.categoryLink,onClick:()=>{r(),o.push(d)},to:d,children:(0,a.jsx)("div",{className:"whispererSuggestions relative flex flex-[0_0_auto] bg-primary px-[15px] py-[19px] text-100 text-primary hover:cursor-pointer hover:bg-secondary focus:bg-secondary",children:(0,a.jsx)("strong",{children:i})})},e.id)}],123555),e.i(771272);var o=e.i(656598),d=e.i(896421);let c=()=>(0,a.jsxs)("div",{className:"flex items-center gap-200 px-50 py-100",children:[(0,a.jsx)(d.SkeletonImage,{isRounded:!0,height:64,width:64}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-50",children:[(0,a.jsx)(o.SkeletonText,{}),(0,a.jsx)(o.SkeletonText,{shortText:!0})]}),(0,a.jsx)(d.SkeletonImage,{isRounded:!0,height:40,width:120})]}),u=()=>(0,a.jsx)("div",{className:"px-50 py-25",children:(0,a.jsx)(o.SkeletonText,{shortText:!0})});e.s(["WhispererComponentSkeleton",0,({isSticky:e,emptySearchQuery:t,isMobileOverlay:r})=>(0,a.jsx)("div",{"aria-busy":"true",className:i({isMobileOverlay:r,isSticky:e}),"data-test":l.WhispererDataTests.whispererSkeleton,id:"whisperer",children:(0,a.jsxs)("div",{className:"flex flex-col gap-200 p-200",children:[!t&&(0,a.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,a.jsx)(u,{}),(0,a.jsx)("div",{className:"mx-50 flex gap-50",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,a.jsx)(d.SkeletonImage,{isRounded:!0,height:32,width:90},t))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,a.jsx)(u,{}),(0,a.jsx)("div",{className:"flex flex-col divide-y divide-grey-30",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,a.jsx)(c,{},t))})]})]})})],899885);var m=e.i(191788),p=e.i(435642),g=e.i(333450);e.s(["TagList",0,({items:e,onClick:r,...i})=>{let{ts:s}=(0,p.default)(),l=(0,m.useRef)(null),n=(e=>{let[t,r]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let{current:t}=e;t&&r(t.scrollWidth>t.clientWidth)},[e]),t})(l),[o,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{d(!1)},[l]),(0,a.jsxs)("ul",{className:(0,t.cn)("mx-50 flex gap-50","max-sm:snap-x max-sm:snap-mandatory max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:overflow-y-hidden max-sm:scroll-smooth","lg:relative lg:overflow-visible",o?"lg:flex-wrap":"lg:flex-nowrap"),"data-test":"tag-list",ref:l,...i,children:[e.map((e,t)=>(0,a.jsx)("li",{"data-test":"search-suggest-tag",children:(0,a.jsx)(g.Chip,{onClick:r(e,t),size:"m",type:"brand",variant:"primaryLight",children:e})},t)),n&&!o&&(0,a.jsx)("li",{className:"absolute top-0 right-0",role:"presentation",children:(0,a.jsx)("div",{className:(0,t.cn)("hidden","after:-right-300 after:absolute after:top-auto after:z-0 after:h-full after:w-[calc(100%+100px)]","after:bg-[var(--background-color-primary)] after:bg-gradient-to-r","after:from-0% after:from-transparent after:to-25% after:to-[var(--background-color-primary)]","lg:relative lg:z-10 lg:block"),children:(0,a.jsx)(g.Chip,{onClick:()=>d(!0),size:"m",type:"brand",variant:"secondary",className:"relative z-10","data-test":"tag-list-show-all",children:s("common:buttons.showAll")})})})]})}],2751);var x=e.i(97902),h=e.i(148103),f=e.i(844066),v=e.i(508062),y=e.i(661525),b=e.i(377883),C=e.i(341597),w=e.i(574537),T=e.i(141850),j=e.i(29719),S=e.i(392077),N=e.i(345166),E=e.i(428324),I=e.i(471314),k=e.i(937569),_=e.i(251876),A=e.i(92684),R=e.i(911204),P=e.i(943253),D=e.i(999354),L=e.i(794060),B=e.i(28605),M=e.i(853127),F=e.i(578764),O=e.i(413694),U=e.i(132767),z=e.i(810686);let Q=({data:e,productListInfo:t,isDifferentiatedAssortments:r,handleRouteChange:i})=>{var s;let{t:n,ts:o}=(0,p.default)(),{router:d}=(0,F.useRouting)(),c=(0,w.default)(),{currencyCode:u}=(0,M.useConfiguration)(),{data:m}=(0,T.useProductCardContext)(),{xtraUser:g,user:Q}=(0,L.default)(),{xtraRoute:H}=(0,B.default)(),{product:K,stock:W,pricing:G,prices:q,impression:V,userData:Y}=e,{isLastMinute:$}=(0,D.default)(K.id),X=(0,O.canProductBeOrdered)(W),Z=!g&&K.premiumOnly,J=(0,U.showProductImageInGreyscale)({stock:W,prices:q}),ee=!!Q&&Y.favorite,et=K.premiumOnly||ee||!!K.countryOfOriginFlagIcon,{openM
10odal:er}=(0,j.useProductCardProductModal)({productId:K.id,isLastMinute:$,impressionId:(null==V?void 0:V.impressionId)??null,productListInfo:t,categoryType:f.CategoryType.Normal,slug:K.slug}),{ref:ei}=(0,E.useProductLinkImpression)(e,t),ea=(null==m?void 0:m.slug)??K.slug,es=ea?`/${(0,S.getBaseLink)(K.id,ea)}`:"#",el=null==m?void 0:m.prices,en=(null==m?void 0:m.badges.find(e=>e.position===f.ProductCardBadgePosition.Price))??null,eo=(null==el?void 0:el.salePrice)??(null==el?void 0:el.originalPrice)??G.finalPrice,ed=(null==el?void 0:el.salePrice)!=null?(null==el?void 0:el.originalPrice)??null:null,ec=null==(s=K.badges)?void 0:s.find(e=>"supply-interruptions"===e.type),eu=W.unavailabilityReason??o("product:currentlySoldOut"),em=K.textualAmount?`, ${K.textualAmount}`:"",ep=ee?`, ${o("common:aria.isFavorite")}`:"",eg=(null==el?void 0:el.unitPrice)??G.finalPricePerUnit,ex=K.unit?`, ${c.formatPricePerUnit(eg,K.unit)}`:"",eh=`${K.name}${em}, ${c.formatPrice(eo)}${ex}${ep}`,ef=X&&m?(0,a.jsx)(C.Price,{currency:(null==el?void 0:el.currency)??u??"","data-test":l.WhispererDataTests.productPrice,discountBadge:en,isApproximate:m.weightedItem,originalPrice:ed,price:eo,saleStyle:(null==el?void 0:el.salePriceStyle)??null,size:"s"}):null;return(0,a.jsxs)("div",{className:"flex flex-col gap-100 px-50 py-100 sm:flex-row sm:items-center sm:gap-200","data-test":l.WhispererDataTests.productWrapper,children:[(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-200 sm:flex-1",children:(0,a.jsxs)(v.ProductRow,{amount:0,imageDataTest:l.WhispererDataTests.productImage,imageGrayscale:J,imageSize:64,imageUrl:K.images[0],name:et?(0,a.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-50 align-middle",children:[K.premiumOnly&&(0,a.jsx)(k.default,{"aria-hidden":!0,backgroundColor:"var(--color-semantic-xtra-primary)",circleSize:"smaller",className:"shrink-0",height:24,type:"xtra",width:24}),(0,a.jsx)("span",{className:"truncate",children:K.name}),ee&&(0,a.jsx)(b.default,{className:"shrink-0",color:"var(--red-50)",fill:"var(--red-50)",height:12,width:12}),(0,_.getCountryOriginFlagIcon)(K.countryOfOriginFlagIcon,{width:13,height:10,className:"shrink-0"})]}):K.name,nameDataTest:l.WhispererDataTests.productName,productLink:{to:es,onClick:e=>{er(e),i()},ariaLabel:eh,impressionRef:ei},textualAmount:K.textualAmount||void 0,unit:K.unit,unitPrice:eg,children:[!X&&(0,a.jsx)(I.default,{onlyLabel:!0,"data-test":l.WhispererDataTests.unavailableReason,label:eu,productId:K.id}),r&&(0,a.jsx)(h.BodyText,{as:"span",className:"inline-flex w-fit rounded-small bg-brand-light px-50 font-semibold text-link-brand",color:"brand","data-test":l.WhispererDataTests.exclusivePrduct,size:"xs",children:n("product:exclusiveProductTag")}),!$&&ec&&(0,a.jsx)(I.default,{onlyLabel:!0,"data-test":l.WhispererDataTests.deliveryInteruption,label:ec.title,productId:K.id}),!ec&&W.deliveryRestriction&&(0,a.jsx)(I.default,{onlyLabel:!0,"data-test":l.WhispererDataTests.deliveryRestriction,label:W.deliveryRestriction,productId:K.id}),(null==V?void 0:V.impressionId)&&(0,a.jsxs)("div",{className:"flex items-center gap-50","data-test":l.WhispererDataTests.productSponsored,children:[(0,a.jsx)(A.Tooltip,{content:o("product:sponsoredTooltip"),children:(0,a.jsx)("button",{"aria-label":o("product:sponsoredTooltip"),className:"inline-flex cursor-help border-0 bg-transparent p-0",type:"button",children:(0,a.jsx)(R.default,{color:"var(--color-text-secondary)",height:13,width:13})})}),(0,a.jsx)(h.BodyText,{as:"span",color:"secondary",semiBold:!0,size:"xs",children:o("product:sponsored")})]})]})}),(0,a.jsxs)("div",{className:"flex flex-row-reverse items-center justify-between gap-300 sm:shrink-0 sm:flex-row sm:justify-end",children:[!X&&(0,a.jsx)(N.default,{popup:!0,className:"shrink-0 whitespace-nowrap font-semibold text-80 text-link-brand no-underline","data-test":l.WhispererDataTests.unavailableButton,defaultProductTab:z.ProductDetailTab.SIMILAR,product:e,productListInfo:t,children:o("product:findSimilar")}),X&&Z&&(0,a.jsx)(x.Button,{"data-gtm-link":"premium-promo-product_detail_exklusive","data-test":l.WhispererDataTests.onlyPremiumButton,isLoading:!1,size:"m",onClick:()=>{d.push(null==H?void 0:H.url()),i()},children:o("product:xtra.link")}),X&&!Z&&(0,a.jsxs)("div",{className:"relative h-[40px] w-[176px] shrink-0",children:[(0,a.jsx)(y.ProductRowCounter,{centered:!0}),(0,a.jsx)(P.ProductCardTooltip,{})]}),ef&&(0,a.jsx)("div",{className:"flex w-[132px] shrink-0 justify-start sm:w-[160px]",children:ef})]})]})};e.s(["default",0,e=>{var t;let r=(0,m.useRef)(null);return(0,a.jsx)(T.ProductCardContextProvider,{categoryType:f.CategoryType.Normal,impressionId:(null==(t=e.data.impression)?void 0:t.impressionId)??null,productCardRef:r,productId:e.data.product.id,productListInfo:e.productListInfo,children:(0,a.jsx)(Q,{...e})})}],511073);var H=e.i(23005),K=e.i(970464),W=e.i(849921),G=e.i(821874),q=e.i(641956),V=e.i(93210);e.s(["NoResult",0,({children:e})=>{let{ts:t}=(0,p.default)(),[r,i]=(0,m.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(H.Message,{type:"warning",content:(0,a.jsxs)(W.Stack,{direction:"row",justify:"space-between",align:"center","data-test":K.NO_RESULT_TESTS.wrapper,children:[(0,a.jsxs)(W.Stack,{direction:"column",children:[(0,a.jsx)("div",{children:e}),(0,a.jsx)(h.BodyText,{"data-test":K.NO_RESULT_TESTS.infoSubtitle,size:"m",children:t("catalog:whisperer.suggestion.info.subtitle")})]}),(0,a.jsx)(q.default,{onClick:()=>i(!0),icon:(0,a.jsx)(G.default.IconFeedbackBubble,{color:"var(--color-icon-inverted)"}),"data-test":K.NO_RESULT_TESTS.infoButton,children:t("catalog:whisperer.suggestion.info.buttonText")})]})}),(0,a.jsx)(V.AskForProductModal,{isOpen:r,onClose:()=>i(!1)})]})}],587627)},489944,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(252921),a=e.i(389364),s=e.i(435642),l=e.i(927623),n=e.i(817664),o=e.i(782829),d=e.i(581040),c=e.i(292819),u=e.i(605057),m=e.i(445246),p=e.i(123555),g=e.i(899885),x=e.i(290788),h=e.i(578764),f=e.i(528448),v=e.i(984876),y=e.i(62851),b=e.i(56928),C=e.i(148103),w=e.i(2751),T=e.i(793790),j=e.i(511073),S=e.i(428486),N=e.i(769272),E=e.i(587627),I=e.i(892953),k=e.i(573700),_=e.i(52925),A=e.i(970464),R=e.i(129590),P=e.i(686298);e.i(340275);var D=e.i(139834),L=e.i(350322),B=e.i(789812),M=e.i(756205),F=e.i(467065),O=e.i(340501),U=e.i(671638),z=e.i(844066);let Q=({title:e,id:r,"data-test":a,showAll:s})=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100 px-50 py-25",children:[(0,t.jsx)(C.BodyText,{as:"div",color:"secondary","data-test":a,id:r,semiBold:!0,size:"s",className:"first-letter:uppercase",children:e}),s&&(0,t.jsx)(i.default,{className:"shrink-0 whitespace-nowrap font-semibold text-80 text-link-brand no-underline hover:text-link-brand-hover hover:no-underline","data-test":s["data-test"],onClick:s.onClick,children:s.label})]});var H=e.i(821874),K=e.i(720533),W=e.i(852393);e.s(["default",0,({products:e,categories:G=[],recipes:q=[],loading:V,companies:Y=[],isSticky:$,isMobileOverlay:X,handleClose:Z,handleSubmitSearch:J,prefix:ee,searchQuery:et,hideMobileSearch:er,totalRecipeHits:e
10i,searchBoxRef:ea,source:es,clearSearchBox:el,suggestions:en=[],noResults:eo,fuzzy:ed,correction:ec,differentiatedAssortments:eu,banners:em,totalHits:ep})=>{let{t:eg,ts:ex}=(0,s.default)(),{router:eh,routes:ef}=(0,h.useRouting)(),ev=(0,f.useAnalyticsSearchEvents)(),{inDrugstore:ey,drugstoreCompanyId:eb}=(0,d.default)(),{getSearchUrl:eC}=(0,b.default)(),ew=(0,v.useCompaniesContext)(),{tabPanelMaxHeight:eT}=(0,k.useUIContext)(),{searchView:ej}=(0,P.useGeneralTracking)(),eS=(0,r.useRef)(null),eN=""===et,eE=ey?eb:ew.mainCompany.id,eI=Y.filter(e=>e.id!==eE),ek=(0,T.getSearchCorrection)(ec),e_=ek.query,eA=e_??et,eR=!eo&&!e_&&ed,eP=e.map(e=>e.product.id);(0,U.useProductCardsInfosLoading)({ids:eP,categoryType:z.CategoryType.Normal});let eD=q.slice(0,8).map(e=>e.id),{data:eL}=(0,W.useChefRecipeCardsQuery)(eD);if((0,r.useEffect)(()=>{!eN&&eP&&ej({type:"suggest",products:eP.length,categories:G.length,recipes:q.length,term:et})},[eP]),(0,r.useEffect)(()=>{let e=(0,B.createKeyboardNavigationHandler)(eS,{selector:L.FOCUSABLE_ELEMENTS_SELECTOR});return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,a.default)(X?{current:null}:ea,e=>{var t,r,i;let a=e.target.classList.contains(n.MODAL_CLOSE_CLASS),s=null==(t=document.getElementById(F.REACT_PORTAL_ID))?void 0:t.contains(e.target),l=null==(r=eS.current)?void 0:r.contains(e.target);(null==(i=ea.current)?void 0:i.contains(document.activeElement))||a||s||l||el(),a||s||l||Z()}),V)return(0,t.jsx)(g.WhispererComponentSkeleton,{emptySearchQuery:eN,isMobileOverlay:X,isSticky:!!$});let eB=()=>{Z(),null==er||er(),el()},eM=(e,t)=>{ev.categoryClicked(e,{searchQuery:eA,position:t+1}),eB()},eF=e=>t=>{t.preventDefault(),t.stopPropagation();let r=eC(eA,e,ee);eh.push(r),eB()};return(0,t.jsx)("div",{className:(0,m.getWhispererWrapperClassName)({isMobileOverlay:X,isSticky:$}),style:X?void 0:{maxHeight:`${eT+64}px`},"aria-label":ex("catalog:whisperer.title"),"data-gtm-section":"whisperer","data-test":y.WhispererDataTests.whispererWrapper,id:M.WHISPERER_ID.wrapper,children:(0,t.jsxs)("div",{className:"flex flex-col gap-200 p-200",ref:eS,children:[(null==eo?void 0:eo.askForProduct)&&(0,t.jsx)("div",{"data-test":y.WhispererDataTests.noResultsHeader,children:(0,t.jsx)(E.NoResult,{children:(0,t.jsx)(O.Subtitle,{"data-test":A.NO_RESULT_TESTS.infoTitle,size:"s",children:ex("catalog:whisperer.suggestion.info.title")})})}),ek.relaxation&&(0,t.jsx)(E.NoResult,{children:(0,t.jsxs)(C.BodyText,{semiBold:!0,className:"inline-block","data-test":y.WhispererDataTests.noResultsHeader,children:[eg("catalog:whisperer.correctedSearch")," ",(0,t.jsx)("span",{className:m.whispererStyles.textStrikeThrough,dangerouslySetInnerHTML:{__html:(0,D.sanitizeHtml)(ek.message)}})]})}),ek.keyword&&(0,t.jsx)(E.NoResult,{children:(0,t.jsxs)(C.BodyText,{semiBold:!0,className:"inline-block","data-test":y.WhispererDataTests.noResultsHeader,children:[eg("catalog:whisperer.correctedSearch")," ",(0,t.jsx)(I.Badge,{"data-test":y.WhispererDataTests.keywordLink,size:"l",type:"custom",customBgClassName:"bg-primary",customTextClassName:"text-primary",children:e_??""})]})}),eR&&(0,t.jsx)(E.NoResult,{children:(0,t.jsx)(C.BodyText,{semiBold:!0,className:"inline-block w-full text-center","data-test":y.WhispererDataTests.noResultsHeader,children:eg("catalog:whisperer.noResultsWildGuess")})}),!!(null==en?void 0:en.length)&&(0,t.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,t.jsx)(Q,{"data-test":y.WhispererDataTests.suggestedKeywords,id:M.WHISPERER_ID.keywords,title:ex("catalog:whisperer.suggestedKeywords")}),(0,t.jsx)(w.TagList,{"aria-labelledby":M.WHISPERER_ID.keywords,items:en,onClick:(e,t)=>()=>{ev.suggestionClicked(e,{searchQuery:eA,position:t}),eh.push(eC(e,eE??ew.mainCompany.id,ee)),eB()}})]}),e.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,t.jsx)(Q,{"data-test":y.WhispererDataTests.productsHeader,id:M.WHISPERER_ID.header,showAll:!eN&&ep>0?{"data-test":y.WhispererDataTests.allProducts,label:ex("catalog:whisperer.showProducts",{totalHits:ep}),onClick:eF(eE??ew.mainCompany.id)}:void 0,title:eN?ex("catalog:whisperer.pickedForYou"):ex("catalog:whisperer.searchedProducts")}),(0,t.jsx)("div",{"aria-labelledby":M.WHISPERER_ID.header,className:"flex flex-col divide-y divide-grey-30",children:e.map((e,r)=>{var i;return(0,t.jsx)(j.default,{data:e,handleRouteChange:eB,isDifferentiatedAssortments:!!(null==eu?void 0:eu.includes(e.product.id)),productListInfo:{itemPosition:r+1,listName:o.GtmLocationFactory.whisperer(et),source:{touchpoint:(i=!!eN,es===l.AutocompleteResponseSourceEnum.RealtimeSuggestion?x.GtmLocationName.WhispererRealtime:i?x.GtmLocationName.WhispererRecommended:x.GtmLocationName.Whisperer),id:void 0,favorite:e.userData.favorite,searchQuery:et}}},e.product.id)})})]}),!!(null==em?void 0:em.length)&&(0,t.jsx)("div",{className:"mb-200",children:(0,t.jsx)(_.default,{banners:em,slidesCount:A.WHISPERER_TRADE_SLIDES_COUNT,pageType:R.GtmPageType.Search,handleRouteChange:eB,mediumRectangleFormat:!0})}),eI.map(e=>(0,t.jsxs)(i.default,{"aria-label":`${ex("common:productsGenitive",{count:e.totalHits})} ${ex("catalog:whisperer.foundInOtherCompany",{context:e.id===eb?"drugstore":void 0})}`,className:"flex items-center gap-200 rounded-small border border-grey-30 bg-primary p-100 text-primary no-underline transition-colors hover:bg-secondary hover:text-primary hover:no-underline","data-test":ey?"whispererRohlik":"whispererBenu",onClick:eF(e.id),children:[(0,t.jsx)(K.ForceTheme,{light:!0,className:"flex h-[48px] w-[72px] shrink-0 items-center justify-center rounded-small bg-grey-20 px-100",children:(0,t.jsx)(N.default,{companyId:e.id,height:28,width:56})}),(0,t.jsxs)(C.BodyText,{as:"span",className:"min-w-0 flex-1",semiBold:!0,size:"s",children:[eg("common:productsGenitive",{count:e.totalHits})," ",eg("catalog:whisperer.foundInOtherCompany",{context:e.id===eb?"drugstore":void 0})]}),(0,t.jsx)(H.default.IconChevron,{className:"shrink-0",color:"var(--color-icon-secondary)",height:20,orientation:"right",width:20})]},`otherHits${e.id}`)),eo&&!ey&&G.map((e,r)=>(0,t.jsx)(p.default,{afterCategoryClick:()=>eM(e,r),category:e,prefix:ee,title:e.name},null==e?void 0:e.id)),!ey&&!!q.length&&(0,t.jsxs)("div",{className:"flex flex-col gap-50",children:[(0,t.jsx)(Q,{"data-test":y.WhispererDataTests.recipesHeader,showAll:eN?void 0:{"data-test":y.WhispererDataTests.allRecipesLink,label:ex("chef:whisperer.showAllRecipes",{totalHits:ei}),onClick:()=>{var e;eh.push(null==(e=ef.chefNavigation)?void 0:e.url({q:eA})),eB()}},title:ex("catalog:whisperer.searchedRecipes")}),(0,t.jsx)(u.BeltCarousel,{ariaLabel:ex("catalog:whisperer.searchedRecipes"),className:"-mx-100",contentClassName:"-ml-300",opts:{align:"start",containScroll:"keepSnaps",slidesToScroll:"auto"},children:((null==eL?void 0:eL.length)?eL:q.map(e=>({recipeId:e.id,name:e.name,slug:e.link.replace(/^.*\/chef\//,"").replace(/^\d+-/,""),image:{path:e.image||"",backgroundColor:null},favorites:{canBeFavorite:!0,favorite:e.isFavorite??!1},badges:[],details:[]}))).slice(0,8).map((e,r)=>{let i,a=q.find(t=>
10t.id===e.recipeId);return(0,t.jsx)(S.CarouselItem,{className:"w-[224px] basis-[224px] pl-300",children:(0,t.jsx)(c.RecipeCard,{className:"h-full min-w-[200px]",data:e,index:r,onClick:a?(i=r+1,()=>{ev.recipeClicked(a,{searchQuery:eA,position:i}),eB()}):eB})},e.recipeId)})})]}),!eo&&G.length>0&&(0,t.jsx)(Q,{"data-test":y.WhispererDataTests.categoriesHeader,title:ex("catalog:whisperer.searchedCategories")}),!eo&&G.slice(0,3).map((e,r)=>(0,t.jsx)(p.default,{afterCategoryClick:()=>eM(e,r),category:e,prefix:ee,title:eN?e.name:e.nameLong||e.name},e.id))]})})}],489944)},755148,84975,789267,e=>{"use strict";let t={card:"recipe-card",image:"recipe-card-image",imagePlaceholder:"recipe-card-image-placeholder",name:"recipe-card-name",details:"recipe-card-details",detailItem:"recipe-card-detail-item",badge:"recipe-card-badge",favoriteWrapper:"recipe-card-favorite",favoriteButton:"recipe-card-favorite-button",ingredientsButton:"recipe-card-ingredients-button",author:"recipe-card-author",authorAvatar:"recipe-card-author-avatar",ingredientsModal:"recipe-card-ingredients-modal",ingredientsModalTitle:"recipe-card-ingredients-modal-title",ingredientsModalLoading:"recipe-card-ingredients-modal-loading",ingredientsModalError:"recipe-card-ingredients-modal-error"};e.s(["RECIPE_CARD_DATA_TESTS",0,t,"RECIPE_CARD_GTM_BUTTONS",0,{openIngredientsModal:"recipe-open-ingredients-modal"}],755148);var r=e.i(391398),i=e.i(307932);e.s(["RecipeCardBadge",0,({badge:e,className:a})=>(0,r.jsx)("span",{"data-test":t.badge,className:(0,i.cn)("inline-flex items-center rounded-small px-50 py-25 font-normal text-80 leading-200",a),style:{color:e.textColor,backgroundColor:e.backgroundColor},children:e.text})],84975);var a=e.i(632938),s=e.i(192190);e.s(["RecipeCardDetails",0,({details:e})=>{let i=(0,a.useCdn)();return 0===e.length?null:(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-x-200 gap-y-50","data-test":t.details,children:e.map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-50 text-80 text-secondary leading-[18px]","data-test":t.detailItem,children:[e.icon&&(0,r.jsx)("img",{src:i(e.icon,{width:12,height:12,quality:s.ImageQuality.Average}),alt:"",width:12,height:12,"aria-hidden":"true"}),e.text]},e.text))})}],789267)},292819,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(927623),a=e.i(755148),s=e.i(84975),l=e.i(789267),n=e.i(983137),o=e.i(252921),d=e.i(578764),c=e.i(51633),u=e.i(720533),m=e.i(307932),p=e.i(235543),g=e.i(412919),x=e.i(576435),h=e.i(794060),f=e.i(435642),v=e.i(632938),y=e.i(970503),b=e.i(192190),C=e.i(97902),w=e.i(649511);let T=({recipeId:e,name:r,favorite:i})=>{let{user:s}=(0,h.default)(),{mutate:l,isPending:n}=(0,x.useFavoriteRecipeMutation)(),{ts:o}=(0,f.default)();return s?(0,t.jsx)(C.Button,{variant:"ghostNeutral",size:"s",icon:i?(0,t.jsx)(g.default,{}):(0,t.jsx)(p.default,{}),onClick:t=>{t.preventDefault(),l({recipeId:e,favorite:!i})},isLoading:n,"data-gtm-button":"toggle-favorite-recipe","data-test":a.RECIPE_CARD_DATA_TESTS.favoriteButton,"aria-label":o(i?"common:aria.removeFromFavorites":"common:aria.addToFavorite",{name:r}),className:"text-white"}):null};e.s(["RecipeCard",0,({data:e,className:p,index:g=0,size:x="default",onClick:h,gtmLink:f,belowAuthor:j})=>{var S;let N="compact"===x,{recipeId:E,image:I,name:k,slug:_,favorites:A,badges:R,details:P}=e,D=R.find(e=>e.position===i.RecipeCardBadgePosition.CtaButton),L=R.filter(e=>e.position===i.RecipeCardBadgePosition.Recipe),[B,M]=(0,r.useState)(!1),[F,O]=(0,r.useState)(!1),U=(0,v.useCdn)(),z=(0,y.useCdnSrcSet)(),{routes:Q}=(0,d.useRouting)(),H=!!I.path&&!B,K=null==(S=Q.recipeDetail)?void 0:S.url({recipeSlug:(0,c.buildIdSlug)(E,_)}),W=e.averageRating??null,G=e.ratingCount??0;return(0,t.jsxs)("article",{className:(0,m.cn)("flex flex-col gap-100 text-left",N?"min-w-[140px]":"min-w-[256px]",p),"data-test":a.RECIPE_CARD_DATA_TESTS.card,children:[(0,t.jsxs)("div",{className:"relative min-h-0 flex-auto",children:[(0,t.jsx)(o.default,{to:K,"data-gtm-link":f,onClickCapture:h,className:"group block h-full no-underline",children:(0,t.jsxs)(u.ForceTheme,{light:!0,className:"relative aspect-[5/4] h-full w-full overflow-hidden rounded-large",children:[H?(0,t.jsx)("img",{src:U(I.path,{width:375,height:300,fit:"cover",quality:b.ImageQuality.Better}),srcSet:z(I.path,{width:375,height:300,fit:"cover",quality:b.ImageQuality.Better}),alt:k,loading:0===g?"eager":"lazy",fetchPriority:0===g?"high":"auto",className:"absolute inset-0 h-full w-full object-cover transition-all duration-200 group-hover:scale-110","data-test":a.RECIPE_CARD_DATA_TESTS.image,onError:()=>M(!0)}):(0,t.jsx)("div",{className:(0,m.cn)("absolute inset-0",!I.backgroundColor&&"bg-grey-10"),style:I.backgroundColor?{backgroundColor:I.backgroundColor}:void 0,"data-test":a.RECIPE_CARD_DATA_TESTS.imagePlaceholder,"aria-label":k}),(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-large shadow-[inset_0_0_0_1px_var(--grey-20)] transition-colors group-hover:bg-alpha-20 dark:shadow-none"})]})}),L.length>0&&(0,t.jsx)("div",{className:"absolute top-100 right-100 flex flex-col items-end gap-50",children:L.map((e,r)=>(0,t.jsx)(s.RecipeCardBadge,{badge:e},e.text))}),A.canBeFavorite&&(0,t.jsx)("div",{className:"absolute top-100 left-100 rounded-medium bg-alpha-40","data-test":a.RECIPE_CARD_DATA_TESTS.favoriteWrapper,children:(0,t.jsx)(T,{recipeId:E,name:k,favorite:A.favorite??!1})}),D&&!N&&(0,t.jsx)(u.ForceTheme,{light:!0,className:"absolute right-100 bottom-100 z-10",children:(0,t.jsx)(C.Button,{isLoading:!1,onClick:()=>{O(!0)},icon:D.icon?(0,t.jsx)("img",{src:U(D.icon),alt:"",className:"h-[24px] w-[24px] brightness-0 invert"}):void 0,className:"border-transparent bg-brand font-semibold text-90 text-grey-0 leading-[22px] transition-colors duration-300 ease-out hover:bg-brand-dark active:bg-brand-light","data-gtm-button":a.RECIPE_CARD_GTM_BUTTONS.openIngredientsModal,"data-test":a.RECIPE_CARD_DATA_TESTS.ingredientsButton,children:D.text})})]}),D&&!N&&(0,t.jsx)(n.RecipeIngredientsModal,{details:P,name:k,onClose:()=>O(!1),open:F,recipeId:E}),(0,t.jsxs)("div",{className:(0,m.cn)("flex shrink-0 flex-col px-50",N?"min-h-[44px]":"min-h-[82px]"),children:[(0,t.jsx)(o.default,{to:K,"data-gtm-link":f,onClickCapture:h,className:"no-underline",children:(0,t.jsx)("h3",{className:"recipe-card-name m-0 line-clamp-2 font-semibold text-100 text-primary leading-[22px]","data-test":a.RECIPE_CARD_DATA_TESTS.name,children:k})}
10),!N&&(0,t.jsx)(l.RecipeCardDetails,{details:P}),!N&&(e.authorName||G>0)&&(0,t.jsxs)("div",{className:"flex items-center gap-50",children:[e.authorName&&(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-50","data-test":a.RECIPE_CARD_DATA_TESTS.author,children:[e.authorImage&&(0,t.jsx)("img",{src:U(e.authorImage,{width:40,height:40,fit:"cover"}),alt:"",className:"h-250 w-250 rounded-full object-cover","data-test":a.RECIPE_CARD_DATA_TESTS.authorAvatar}),(0,t.jsx)("span",{className:"min-w-0 truncate text-80 text-secondary leading-[18px]",children:e.authorName})]}),(0,t.jsx)(w.RecipeRatingCard,{averageRating:W,ratingCount:G,className:"ml-auto shrink-0"})]}),!N&&j]})]})}])},983137,938784,707724,954673,139788,e=>{"use strict";var t=e.i(391398),r=e.i(360458),i=e.i(435642),a=e.i(342218),s=e.i(307932),l=e.i(109445),n=e.i(789267),o=e.i(755148),d=e.i(191788),c=e.i(285700),u=e.i(325016),m=e.i(406376),p=e.i(306214),g=e.i(292905),x=e.i(417969),h=e.i(134276),f=e.i(886297),v=e.i(435872),y=e.i(290788),b=e.i(957744),C=e.i(767411),w=e.i(627888),T=e.i(955755),j=e.i(844066),S=e.i(109517),N=e.i(335572),E=e.i(927623);let I={wrapper:"ingredients-section",header:"ingredients-section-header",groupSelectAllCheckbox:"ingredients-section-group-select-all",globalSelectAllCheckbox:"ingredients-section-global-select-all",needToBuyList:"ingredients-section-need-to-buy-list",ingredientItem:"ingredients-section-ingredient-item",ingredientHeader:"ingredients-section-ingredient-header",ingredientCheckbox:"ingredients-section-ingredient-checkbox",ingredientProduct:"ingredients-section-ingredient-product",noProductAvailable:"ingredients-section-no-product-available",availabilityReason:"ingredients-section-availability-reason",findSimilarButton:"ingredients-section-find-similar",ingredientAddButton:"ingredients-section-ingredient-add-button",alternativeLink:"ingredients-section-alternative-link",pantrySection:"ingredients-section-pantry",swapModal:"ingredients-section-swap-modal",swapModalProductList:"ingredients-section-swap-product-list",swapModalProductRow:"ingredients-section-swap-product-row",swapModalProductRowSkeleton:"ingredients-section-swap-product-row-skeleton",swapModalConfirmButton:"ingredients-section-swap-confirm",portionCounter:"ingredients-section-portion-counter",portionCounterDecrease:"ingredients-section-portion-decrease",portionCounterIncrease:"ingredients-section-portion-increase",addToCartButton:"ingredients-section-add-to-cart"},k={listName:"Chef Ingredient",itemPosition:0,source:{touchpoint:y.GtmLocationName.ChefIngredient,id:null,favorite:!1},isSponsored:!1},_={addToCart:"recipe-add-to-cart",ingredientToggle:"recipe-ingredient-toggle",selectAll:"recipe-select-all",globalSelectAll:"recipe-global-select-all",servingsChange:"recipe-servings-change",swapOpen:"ingredient-swap-open",swapConfirm:"ingredient-swap-confirm",findSimilar:"recipe-find-similar"};e.s(["INGREDIENTS_SECTION_DATA_TESTS",0,I,"INGREDIENTS_SECTION_GTM_BUTTONS",0,_,"INGREDIENT_PRODUCT_LIST_INFO",0,k,"MAX_PORTIONS",0,20,"MIN_PORTIONS",0,1,"RECALCULATE_DEBOUNCE_MS",0,300],938784);let A={success:"cartControllerService.add_to_cart.success",partialFailure:"chef.recipe.add_to_cart.partial_failure",allFailed:"chef.recipe.add_to_cart.all_failed"},R=Object.values(A),P=e=>{let t,{ts:r}=(0,i.default)(),{notify:a}=(0,m.default)(),s=(0,c.useQueryClient)(),{data:l,isLoading:n,isError:o}=(0,p.useIngredientSelectionQuery)(e),I=(t=(0,c.useQueryClient)(),(0,g.useMutation)({mutationFn:async({recipeId:e,request:t})=>(await h.default.createChefIngredientsSelectionApi(x.default.createDefaultApiConfig())).updateSelection(e,t),onSuccess:(e,{recipeId:r})=>{t.setQueryData((0,p.getIngredientSelectionQueryKey)(r),e)}})),_=(()=>{let e=(0,v.useAnalyticsCartEvents)(),{cart:t}=(0,f.useCartContext)(),r=(0,c.useQueryClient)(),{addToCart:i,createCart:a}=(0,C.useEcommerceTracking)();return(0,g.useMutation)({mutationFn:async({products:e})=>{let t=await h.default.createChefApi();return await t.addAllItemsOrNothingToCart({products:e.map(e=>e.slim),bestEffort:!0})},onSuccess:async(s,l)=>{var n,o,d,c;r.invalidateQueries({queryKey:[b.cartQueryKeyPrefix]});let u=null==(n=s.data)?void 0:n.criticalChanges,m=await (0,b.getCart)({}),p=new Set(Object.keys(u??{}).map(Number)),g=l.products.filter(e=>!p.has(e.slim.productId));g.forEach(r=>{var i,a,s,l;let n=null==m||null==(a=m.items)||null==(i=a[r.fat.product.id])?void 0:i.quantity,o=(null==t||null==(l=t.items)||null==(s=l[r.fat.product.id])?void 0:s.quantity)??0;e.quantityUpdated({newQuantity:n??o,oldQuantity:o,product:r.fat,productListInfo:{listName:r.listInfo.listName,itemPosition:1,source:{favorite:r.fat.userData.favorite??!1,id:r.fat.product.id,touchpoint:y.GtmLocationName.ChefPackageIngredient}}})});let x=(null==m?void 0:m.items)||{};(0,w.trackBulkCartAddition)({products:g.map(e=>({productId:e.slim.productId})),cartItems:x,source:null==(c=g[0])||null==(d=c.listInfo)||null==(o=d.source)?void 0:o.touchpoint,getQuantity:(e,r)=>{var i,a,s,l;let n=r.productId??0;return((null==m||null==(a=m.items)||null==(i=a[n])?void 0:i.quantity)??0)-((null==t||null==(l=t.items)||null==(s=l[n])?void 0:s.quantity)??0)},addToCart:i,createCart:a})}})})(),{needToBuyGroups:P,pantryGroups:D,allItems:L}=(0,d.useMemo)(()=>{let e=(null==l?void 0:l.ingredientGroups.filter(e=>e.defaultSelected))??[],t=(null==l?void 0:l.ingredientGroups.filter(e=>!e.defaultSelected))??[],r=e.flatMap(e=>e.ingredients),i=t.flatMap(e=>e.ingredients);return{needToBuyGroups:e,pantryGroups:t,allItems:[...r,...i]}},[l]),[B,M]=(0,d.useState)(void 0),[F,O]=(0,d.useState)({}),[U,z]=(0,d.useState)({}),[Q,H]=(0,d.useState)(null),[K,W]=(0,d.useState)(0),G=(0,d.useRef)(null);(0,d.useEffect)(()=>
10{if(G.current!==e&&L.length>0){var t,r,i,a;G.current=e,O(Object.fromEntries(L.filter(e=>e.selected).map(e=>[e.ingredientId,!0]))),z(Object.fromEntries(L.map(e=>{var t,r;return[e.ingredientId,(null==(t=e.products.find(e=>e.selected))?void 0:t.productId)??(null==(r=e.products[0])?void 0:r.productId)]}).filter(([,e])=>null!=e))),W((null==l?void 0:l.metadata.portions)??(null==l?void 0:l.metadata.defaultPortions)??1),M((null==l||null==(r=l.presets)||null==(t=r.find(e=>e.selected))?void 0:t.id)??(null==l||null==(a=l.presets)||null==(i=a[0])?void 0:i.id))}},[L,l,e]);let q=(0,d.useRef)({checkedItems:F,selectedProducts:U,selectedPresetId:B,currentPortions:K});q.current={checkedItems:F,selectedProducts:U,selectedPresetId:B,currentPortions:K};let{mutate:V}=I,Y=(0,d.useCallback)(e=>{let t=e.ingredientGroups.flatMap(e=>e.ingredients);O(Object.fromEntries(t.filter(e=>e.selected).map(e=>[e.ingredientId,!0]))),z(Object.fromEntries(t.map(e=>{var t,r;return[e.ingredientId,(null==(t=e.products.find(e=>e.selected))?void 0:t.productId)??(null==(r=e.products[0])?void 0:r.productId)]}).filter(([,e])=>null!=e))),W(e.metadata.portions)},[]),$=(0,d.useCallback)((t={})=>{var r,i,a,s;let l={checkedItems:t.checkedItems??q.current.checkedItems,selectedProducts:t.selectedProducts??q.current.selectedProducts,presetId:null===t.presetId?void 0:t.presetId??q.current.selectedPresetId,portions:t.portions??q.current.currentPortions};V({recipeId:e,request:(r=l.checkedItems,i=l.selectedProducts,a=l.portions,s=l.presetId,{portions:a,ingredients:L.map(e=>({ingredientId:e.ingredientId,selected:!!r[e.ingredientId],selectedProductId:i[e.ingredientId]??null})),preset:s??null})})},[L,e,V]),X=(0,d.useMemo)(()=>(0,u.default)($,300),[$]);(0,d.useEffect)(()=>()=>X.cancel(),[X]);let Z=(0,d.useMemo)(()=>P.flatMap(e=>e.ingredients),[P]),J=Z.length>0&&Z.every(e=>F[e.ingredientId]),ee=(0,d.useMemo)(()=>Object.values(F).filter(Boolean).length,[F]),et=async()=>{let t=[],i=(await Promise.all(L.filter(e=>F[e.ingredientId]).map(async r=>{let i,a=U[r.ingredientId],l=a?r.products.find(e=>e.productId===a):void 0;if(!a||!l)return void t.push(r.title);try{i=await s.ensureQueryData({queryKey:(0,S.getProductCardInfoQueryKey)({id:a,categoryType:j.CategoryType.Normal}),queryFn:()=>(0,N.loadProductCard)(a,j.CategoryType.Normal)})}catch{}let n={product:{id:a,name:(null==i?void 0:i.name)??"",brand:(null==i?void 0:i.brand)??null},userData:{favorite:!1},stock:{inStock:(null==i?void 0:i.stock.availabilityStatus)===j.ProductStockAvailability.Available},categories:{categories:[]},prices:{price:{amount:(null==i?void 0:i.prices.unitPrice)??0}}};return{listInfo:{listName:k.listName,source:{touchpoint:y.GtmLocationName.ChefIngredient,id:e}},slim:{recipeId:e,productId:a,quantity:l.amount,actionId:null},fat:n}}))).filter(e=>void 0!==e),l=t.length>0?r("chef:recipeDetail.ingredients.productsNotAdded",{items:t.join(", ")}):void 0;if(0===i.length){l&&a(l,"error");return}try{var n,o,d,c;let t,s=await _.mutateAsync({products:i}),u=(null==(n=s.data)?void 0:n.messages)??[],m=u.find(e=>{let t;return t=e.messageCode,"string"==typeof t&&R.includes(t)})??u.find(e=>e.type===E.MessageType.Error&&null==e.productId)??u.find(e=>e.type===E.MessageType.Error),p=(null==(o=s.data)?void 0:o.criticalChanges)??{},g=Object.keys(p).length>0,x=r(g?"chef:recipeDetail.ingredients.addToCartError":"chef:recipeDetail.ingredients.addedToCart"),h=(d=g?"error":"success",t=null==m||null==(c=m.content)?void 0:c.trim(),(null==m?void 0:m.messageCode)===A.success?l?{content:l,level:"error"}:{content:t||x,level:"success"}:(null==m?void 0:m.messageCode)===A.partialFailure||(null==m?void 0:m.messageCode)===A.allFailed||(null==m?void 0:m.type)===E.MessageType.Error?{content:[t||x,l].filter(Boolean).join(" "),level:"error"}:{content:[x,l].filter(Boolean).join(" "),level:l?"error":d});h.content&&a(h.content,h.level),"success"===h.level&&(0,T.addRumAction)("recipe-add-to-cart",{recipeId:e})}catch{}};return{selection:l??void 0,isLoading:n,isError:o,needToBuyGroups:P,pantryGroups:D,allItems:L,checkedItems:F,selectedProducts:U,selectedPresetId:B,currentPortions:K,selectedCount:ee,allNeedToBuySelected:J,swapModalIngredientId:Q,isAddingToCart:_.isPending,handlePresetChange:t=>{M(t),V({recipeId:e,request:{portions:q.current.currentPortions,preset
10:t}},{onSuccess:Y})},handleToggleItem:e=>{let t={...F,[e]:!F[e]};O(t),M(void 0),$({checkedItems:t,presetId:null})},handleSelectAllInGroup:e=>{let t=e.ingredients.every(e=>F[e.ingredientId]),r={...F};for(let i of e.ingredients)r[i.ingredientId]=!t;O(r),M(void 0),$({checkedItems:r,presetId:null})},handleToggleAllNeedToBuy:()=>{let e=!J,t={...F};for(let r of Z)t[r.ingredientId]=e;O(t),M(void 0),$({checkedItems:t,presetId:null})},handlePortionsChange:e=>{W(e),X({portions:e})},handleAddAllToCart:et,setSwapModalIngredientId:H,handleSwapConfirm:e=>{if(null==Q)return;let t={...U,[Q]:e};z(t),H(null),M(void 0),$({selectedProducts:t,presetId:null})}}};e.s(["useIngredientSelection",0,P],707724);var D=e.i(821874),L=e.i(97902);let B=({value:e})=>{let{ts:r}=(0,i.default)();return(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-25",children:[(0,t.jsx)("span",{className:"text-100 text-secondary leading-[22px]",children:r("chef:recipeDetail.ingredients.pricePerPortion")}),(0,t.jsx)("span",{className:"font-semibold text-100 text-primary leading-[22px]",children:e})]})},M=({portions:e,totalPrice:r,onChange:a})=>{let{ts:s}=(0,i.default)();return(0,t.jsxs)("div",{className:"flex items-center gap-200","data-test":I.portionCounter,children:[(0,t.jsx)("button",{"aria-label":s("chef:recipeDetail.ingredients.decreasePortions"),className:"flex size-400 shrink-0 items-center justify-center rounded-medium border border-grey-40 disabled:opacity-50","data-gtm-button":_.servingsChange,"data-test":I.portionCounterDecrease,disabled:e<=1,onClick:()=>a(e-1),type:"button",children:(0,t.jsx)(D.default.IconMinus,{color:"var(--color-icon-primary)",height:16,width:16})}),(0,t.jsxs)("div",{className:"flex min-w-[64px] flex-col items-center",children:[(0,t.jsx)("span",{className:"font-semibold text-100 text-primary leading-300",children:s("chef:recipeDetail.ingredients.portionsCount",{count:e})}),(0,t.jsx)("span",{className:"font-semibold text-80 text-secondary leading-[18px]",children:r})]}),(0,t.jsx)("button",{"aria-label":s("chef:recipeDetail.ingredients.increasePortions"),className:"flex size-400 shrink-0 items-center justify-center rounded-medium border border-grey-40 disabled:opacity-50","data-gtm-button":_.servingsChange,"data-test":I.portionCounterIncrease,disabled:e>=20,onClick:()=>a(e+1),type:"button",children:(0,t.jsx)(D.default.IconPlus,{color:"var(--color-icon-primary)",height:16,width:16})})]})},F=({totalPrice:e,currentPortions:r,onPortionsChange:a,selectedCount:l,isAddingToCart:n,onAddToCart:o,className:d})=>{let{ts:c}=(0,i.default)();return(0,t.jsxs)("div",{className:(0,s.cn)("flex flex-col items-start gap-200 md:flex-row md:items-center md:gap-300",d),children:[r>0&&(0,t.jsx)(M,{onChange:a,portions:r,totalPrice:e??""}),(0,t.jsx)(L.Button,{className:"w-full font-semibold md:w-auto","data-gtm-button":_.addToCart,"data-test":I.addToCartButton,disabled:0===l||n,icon:(0,t.jsx)(D.default.IconPlus,{}),isLoading:n,onClick:o,size:"l",variant:"primary",children:c("chef:recipeDetail.ingredients.addToCart")})]})};e.s(["IngredientsSelectionActions",0,F,"PricePerPortion",0,B],954673);var O=e.i(148103),U=e.i(341597),z=e.i(141850),Q=e.i(29719),H=e.i(392077),K=e.i(508062),W=e.i(661525);let G=({id:e,checked:r,onChange:i,"data-test":a})=>(0,t.jsxs)("div",{className:"relative size-[18px] shrink-0",children:[(0,t.jsx)("input",{checked:r,className:"absolute inset-0 cursor-pointer opacity-0","data-test":a,id:e,onChange:i,type:"checkbox"}),(0,t.jsx)("div",{className:(0,s.cn)(["pointer-events-none flex size-full items-center justify-center rounded-small border-2 transition-colors",r?"border-brand bg-brand":"border-grey-60 bg-white"]),children:r&&(0,t.jsx)(D.default.IconCheckMarkSmall,{color:"var(--color-icon-inverted)",height:10,width:10})})]}),q=({id:e,checked:r,onChange:i,title:a,amount:l,className:n,"data-test":o,checkboxDataTest:d,"data-gtm-button":c,"data-ingredient-id":u})=>(0,t.jsxs)("label",{className:(0,s.cn)(["flex cursor-pointer items-center gap-150 bg-grey-20 px-200 py-150",n]),"data-gtm-button":c,"data-ingredient-id":u,"data-test":o,htmlFor:e,children:[(0,t.jsx)(G,{checked:r,"data-test":d,id:e,onChange:i}),(0,t.jsxs)("span",{className:"font-semibold text-100 text-primary leading-200",children:[a,l&&(0,t.jsxs)("span",{className:"font-normal text-secondary",children:[" ",l]})]})]});var V=e.i(671638);let Y={listName:"Chef Ingredient Swap",itemPosition:0,source:{touchpoint:y.GtmLocationName.ChefIngredient,id:null,favorite:!1},isSponsored:!1},$=()=>(0,t.jsxs)("div",{className:"flex w-full items-center gap-100 overflow-hidden rounded-medium pl-100 ring-1 ring-grey-30 ring-inset","data-test":I.swapModalProductRowSkeleton,children:[(0,t.jsx)("div",{className:(0,s.cn)(["size-300 shrink-0 rounded-full",l.skeletonClassNames])}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-50 p-[6px] sm:flex-row sm:items-center sm:gap-100",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-100 sm:flex-1",children:[(0,t.jsx)("div",{className:(0,s.cn)(["size-800 shrink-0 rounded-small",l.skeletonClassNames])}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsx)("span",{className:(0,s.cn)(["block h-[14px] w-3/4 rounded-small",l.skeletonClassNames])}),(0,t.jsx)("span",{className:(0,s.cn)(["block h-[12px] w-1/2 roun
10ded-small",l.skeletonClassNames])})]})]}),(0,t.jsx)("div",{className:(0,s.cn)(["h-[20px] w-[80px] rounded-small sm:shrink-0",l.skeletonClassNames])})]})]}),X=({amount:e,isSelected:r,onSelect:i})=>{var a,l,n,o;let{data:d,productCardRef:c}=(0,z.useProductCardContext)();return d?(0,t.jsxs)("button",{ref:c,className:(0,s.cn)(["flex w-full cursor-pointer items-center gap-[14px] overflow-hidden rounded-medium border-solid pl-200 text-left",r?"border-[1.5px] border-brand bg-grey-20":"border border-grey-30"]),"data-gtm-button":_.swapConfirm,"data-product-id":d.productId,"data-test":I.swapModalProductRow,onClick:()=>i(d.productId),type:"button",children:[(0,t.jsx)("div",{className:"flex size-300 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:(0,s.cn)(["flex size-250 items-center justify-center rounded-full transition-colors",r?"bg-brand":"border-[1.5px] border-grey-40 bg-grey-20"]),children:r&&(0,t.jsx)("div",{className:"size-150 rounded-full bg-grey-0"})})}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 self-stretch rounded-medium bg-primary",children:(0,t.jsxs)("div",{className:"flex w-full flex-col gap-50 p-[6px] sm:flex-row sm:items-center sm:gap-100",children:[(0,t.jsx)("div",{className:"flex min-w-0 items-center gap-100 sm:flex-1",children:(0,t.jsx)(K.ProductRow,{amount:e,availabilityReason:null==(a=d.stock)?void 0:a.availabilityReason,availabilityReasonDataTest:I.availabilityReason,imageGrayscale:(null==(l=d.stock)?void 0:l.availabilityStatus)===j.ProductStockAvailability.Unavailable,imageUrl:null==(n=d.image)?void 0:n.path,name:d.name,textualAmount:d.textualAmount,unit:d.unit,unitPrice:d.prices.unitPrice})}),(0,t.jsx)("div",{className:"flex min-w-[160px] sm:shrink-0 sm:px-100",children:(0,t.jsx)(U.Price,{currency:d.prices.currency,discountBadge:(null==(o=d.badges)?void 0:o.find(e=>e.position===j.ProductCardBadgePosition.Price))??null,originalPrice:null!=d.prices.salePrice?d.prices.originalPrice:null,price:d.prices.salePrice??d.prices.originalPrice??d.prices.unitPrice,saleStyle:d.prices.salePriceStyle,size:"s"})})]})})]}):null},Z=({ingredientProduct:e,isSelected:r,onSelect:i,recipeId:a})=>{let s=(0,d.useRef)(null);return(0,t.jsx)(z.ProductCardContextProvider,{categoryType:j.CategoryType.Normal,impressionId:null,productCardRef:s,productId:e.productId,productListInfo:Y,recipeId:a,children:(0,t.jsx)(X,{amount:e.amount,isSelected:r,onSelect:i})})},J=({open:e,onClose:a,ingredientTitle:s,products:l,selectedProductId:n,onConfirm:o,recipeId:c})=>{let{ts:u}=(0,i.default)(),m=(0,d.useMemo)(()=>l.map(e=>e.productId),[l]),{isLoading:p}=(0,V.useProductCardsInfosLoading)({ids:m,categoryType:j.CategoryType.Normal}),g=e=>{o(e),a()};return(0,t.jsx)(r.default,{hideModal:a,open:e,isInPortal:!0,children:(0,t.jsxs)("div",{className:"flex flex-col gap-200 p-300","data-test":I.swapModal,children:[(0,t.jsxs)("div",{className:"flex items-center gap-100",children:[(0,t.jsx)("button",{"aria-label":u("common:back"),className:"flex shrink-0 items-center justify-center",onClick:a,type:"button",children:(0,t.jsx)(D.default.IconChevron,{color:"var(--color-icon-primary)",height:24,orientation:"left",width:24})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsx)("h3",{className:"font-black text-400 text-primary leading-[30px]",children:u("chef:recipeDetail.ingredients.swapTitle")}),(0,t.jsx)("span",{className:"text-100 text-secondary leading-[22px]",children:u("chef:recipeDetail.ingredients.swapSubtitle")})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-25","data-test":I.swapModalProductList,children:p?l.map(e=>(0,t.jsx)($,{},e.productId)):l.map(e=>(0,t.jsx)(Z,{ingredientProduct:e,isSelected:n===e.productId,onSelect:g,recipeId:c},e.productId))})]})})},ee=({presets:e,selectedId:r,onSelect:i})=>0===e.length?null:(0,t.jsx)("div",{className:"mb-200 flex flex-col gap-100 sm:flex-row",children:e.map(e=>{let a=e.id===r;return(0,t.jsxs)("button",{className:(0,s.cn)(["flex flex-1 cursor-pointer items-center gap-100 overflow-hidden rounded-medium px-200 py-150 text-left",a?"bg-brand-light-secondary shadow-[inset_0_0_0_2px_var(--border-color-brand)]":"bg-grey-20 shadow-[inset_0_0_0_1px_var(--grey-30)]"]),"data-gtm-button":(e=>
10{switch(e.toLowerCase()){case"recommended":return"strategy-preset-recommended";case"cheapest":return"strategy-preset-cheapest";case"organic":return"strategy-preset-organic";default:return}})(e.id),"data-preset-id":e.id,onClick:()=>i(e.id),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsx)("span",{className:"font-semibold text-200 text-primary leading-300",children:e.title}),e.subtitle&&(0,t.jsx)("span",{className:"text-90 text-secondary leading-[19px]",children:e.subtitle})]}),(0,t.jsx)("span",{className:"shrink-0 font-semibold text-100 text-primary leading-[22px]",children:e.priceFormatted})]},e.id)})}),et=({item:e,productAmount:r,productId:a,checked:s,onToggle:l,onSwapClick:n})=>{var o,d;let c,{ts:u}=(0,i.default)(),{data:m}=(0,z.useProductCardContext)(),{openModal:p}=(0,Q.useProductCardProductModal)({productId:a,isLastMinute:!1,impressionId:null,productListInfo:k,categoryType:j.CategoryType.Normal}),g=m?`/${(0,H.getBaseLink)(a,m.slug)}`:"#",x=(null==m?void 0:m.stock.availabilityStatus)===j.ProductStockAvailability.Unavailable;return c=x?e.alternativesCount>0?(0,t.jsx)("div",{className:"-mr-100 xs:mr-0 flex w-[180px] shrink-0 justify-end pr-100",children:(0,t.jsx)(L.Button,{"data-gtm-button":_.findSimilar,"data-test":I.findSimilarButton,isLoading:!1,onClick:n,size:"m",variant:"primary",children:u("chef:recipeDetail.ingredients.findSimilar")})}):null:(0,t.jsx)("div",{className:"-mr-100 relative xs:mr-0 h-[40px] w-[180px] shrink-0",children:(0,t.jsx)(W.ProductRowCounter,{centered:!0,"data-test":I.ingredientAddButton})}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-medium border border-grey-30","data-test":I.ingredientItem,children:[(0,t.jsx)(q,{amount:e.amount,checked:s,checkboxDataTest:I.ingredientCheckbox,"data-gtm-button":_.ingredientToggle,"data-ingredient-id":e.ingredientId,"data-test":I.ingredientHeader,id:`ing-${e.ingredientId}`,onChange:l,title:e.title}),m&&s&&(0,t.jsxs)("div",{className:"flex xs:flex-row flex-col xs:items-center gap-50 xs:gap-200 p-100","data-test":I.ingredientProduct,children:[(0,t.jsx)("div",{className:"flex min-w-0 xs:flex-1 items-center gap-100",children:(0,t.jsx)(K.ProductRow,{amount:r,availabilityReason:m.stock.availabilityReason,availabilityReasonDataTest:I.availabilityReason,imageGrayscale:x,imageUrl:null==(o=m.image)?void 0:o.path,name:m.name,productLink:{to:g,onClick:p,ariaLabel:m.name},textualAmount:m.textualAmount,unit:m.unit,unitPrice:m.prices.unitPrice,children:e.alternativesCount>0&&(0,t.jsxs)("button",{className:"mt-50 flex w-fit items-center gap-50 font-semibold text-90 text-brand leading-200","data-gtm-button":_.swapOpen,"data-ingredient-id":e.ingredientId,"data-test":I.alternativeLink,onClick:n,type:"button",children:[(0,t.jsx)(D.default.IconReplace,{color:"var(--color-icon-brand)",height:16,width:16}),u("chef:recipeDetail.ingredients.selectAlternative",{count:e.alternativesCount})]})})}),(0,t.jsxs)("div",{className:"flex xs:shrink-0 xs:flex-row-reverse items-center justify-between xs:gap-100",children:[(0,t.jsx)("div",{className:"min-w-0 xs:min-w-[110px] flex-1 xs:flex-none",children:(0,t.jsx)(U.Price,{currency:m.prices.currency,price:m.prices.salePrice??m.prices.originalPrice??m.prices.unitPrice,originalPrice:null!=m.prices.salePrice?m.prices.originalPrice:null,saleStyle:m.prices.salePriceStyle,discountBadge:(null==(d=m.badges)?void 0:d.find(e=>e.position===j.ProductCardBadgePosition.Price))??null,size:"s"})}),c]})]})]})},er=({item:e,checked:r,onToggle:a,onSwapClick:s,selectedProductId:l,recipeId:n})=>{let{ts:o}=(0,i.default)(),c=(0,d.useRef)(null),u=(l?e.products.find(e=>e.productId===l):void 0)??e.products.find(e=>e.selected)??e.products[0],m=null==u?void 0:u.productId,p=(null==u?void 0:u.amount)??0;return m?(0,t.jsx)(z.ProductCardContextProvider,{categoryType:j.CategoryType.Normal,impressionId:null,productCardRef:c,productId:m,productListInfo:k,recipeId:n,children:(0,t.jsx)(et,{item:e,productAmount:p,productId:m,checked:r,onToggle:a,onSwapClick:s})}):(0,t.jsxs)("div",{className:"overflow-hidden rounded-medium border border-grey-30","data-test":I.ingredientItem,children:[(0,t.jsx)(q,{amount:e.amount,checked:r,checkboxDataTest:I.ingredientCheckbox,"data-gtm-button":_.ingredientToggle,"data-ingredient-id":e.ingredientId,"data-test":I.ingredientHeader,id:`ing-${e.ingredientId}
10`,onChange:a,title:e.title}),r&&(0,t.jsx)(O.BodyText,{as:"p",className:"p-100",color:"secondary","data-test":I.noProductAvailable,size:"s",children:o("chef:recipeDetail.ingredients.noProductAvailable")})]})},ei=({presets:e,selectedPresetId:r,onPresetChange:a,needToBuyGroups:s,pantryGroups:l,allItems:n,checkedItems:o,selectedProducts:d,onToggleItem:c,onSelectAllInGroup:u,swapModalIngredientId:m,onSwapOpen:p,onSwapClose:g,onSwapConfirm:x,recipeId:h,globalSelectAll:f})=>{var v,y;let{ts:b}=(0,i.default)(),C=null!=m?n.find(e=>e.ingredientId===m):void 0;return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(ee,{onSelect:a,presets:e,selectedId:r}),(0,t.jsx)("div",{className:"flex flex-col gap-200","data-test":I.needToBuyList,children:s.map((e,r)=>{let i=!f&&e.ingredients.length>1,a=e.ingredients.every(e=>o[e.ingredientId]),s=!!f&&0===r;return(0,t.jsxs)("div",{children:[(e.title||i||s)&&(0,t.jsxs)("div",{className:"mb-150 flex items-center justify-between gap-200",children:[e.title&&(0,t.jsx)("span",{className:"font-semibold text-200 text-primary leading-300",children:e.title}),i&&(0,t.jsxs)("label",{className:"ml-auto flex cursor-pointer items-center gap-100 whitespace-nowrap","data-gtm-button":_.selectAll,"data-group-id":e.id,"data-test":I.groupSelectAllCheckbox,htmlFor:`ing-select-all-${e.id}`,children:[(0,t.jsx)(G,{checked:a,id:`ing-select-all-${e.id}
10`,onChange:()=>u(e)}),(0,t.jsx)("span",{className:"text-80 text-primary leading-150",children:b("chef:recipeDetail.ingredients.selectAll")})]}),s&&f&&(0,t.jsxs)("label",{className:"ml-auto flex cursor-pointer items-center gap-100 whitespace-nowrap","data-gtm-button":_.globalSelectAll,"data-test":I.globalSelectAllCheckbox,htmlFor:"ing-global-select-all",children:[(0,t.jsx)(G,{checked:f.checked,id:"ing-global-select-all",onChange:f.onToggle}),(0,t.jsx)("span",{className:"text-80 text-primary leading-150",children:b("chef:recipeDetail.ingredients.selectAll")})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-25",children:e.ingredients.map(e=>(0,t.jsx)(er,{checked:o[e.ingredientId]??!1,item:e,onSwapClick:()=>p(e.ingredientId),onToggle:()=>c(e.ingredientId),recipeId:h,selectedProductId:d[e.ingredientId]},e.ingredientId))})]},e.id)})}),l.length>0&&(0,t.jsx)("div",{className:"mt-200 flex flex-col gap-200","data-test":I.pantrySection,children:l.map(e=>(0,t.jsxs)("div",{children:[e.title&&(0,t.jsx)("div",{className:"mb-100 font-semibold text-200 text-primary leading-300",children:e.title}),(0,t.jsx)("div",{className:"flex flex-col gap-25",children:e.ingredients.map(e=>(0,t.jsx)(er,{checked:o[e.ingredientId]??!1,item:e,onSwapClick:()=>p(e.ingredientId),onToggle:()=>c(e.ingredientId),recipeId:h,selectedProductId:d[e.ingredientId]},e.ingredientId))})]},e.id))}),C&&(0,t.jsx)(J,{ingredientTitle:C.title,onClose:g,onConfirm:x,open:null!=m,products:C.products,recipeId:h,selectedProductId:d[C.ingredientId]??(null==(v=C.products.find(e=>e.selected))?void 0:v.productId)??(null==(y=C.products[0])?void 0:y.productId)})]})};e.s(["IngredientsSelectionList",0,ei],139788);let ea=()=>(0,t.jsxs)("div",{className:"flex flex-col gap-200","data-test":o.RECIPE_CARD_DATA_TESTS.ingredientsModalLoading,children:[(0,t.jsx)("div",{className:(0,s.cn)("h-[52px] w-full rounded-medium",l.skeletonClassNames)}),(0,t.jsx)("div",{className:(0,s.cn)("h-[52px] w-full rounded-medium",l.skeletonClassNames)}),(0,t.jsx)("div",{className:(0,s.cn)("h-[52px] w-full rounded-medium",l.skeletonClassNames)}),(0,t.jsx)("div",{className:(0,s.cn)("h-[52px] w-full rounded-medium",l.skeletonClassNames)})]}),es=({recipeId:e,name:s,details:l,onClose:d})=>{let{ts:c}=(0,i.default)(),u=P(e),{selection:m,isLoading:p,isError:g}=u,x=g&&!m,h=!x&&(p||!m),f=null!==u.swapModalIngredientId;return(0,t.jsx)(r.default,{"aria-label":s,enableOnClickOutside:!f,hideModal:d,isInPortal:!0,open:!0,size:"xl",children:(0,t.jsxs)("div",{className:"flex max-h-[100dvh] flex-col overflow-hidden ml:rounded-medium sm:max-h-[calc(100dvh-100px)]","data-test":o.RECIPE_CARD_DATA_TESTS.ingredientsModal,children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-col gap-200 border-grey-20 border-b bg-primary p-300 md:flex-row md:items-start md:justify-between md:gap-300",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-50",children:[(0,t.jsx)(a.Title,{as:"h2",className:"line-clamp-2","data-test":o.RECIPE_CARD_DATA_TESTS.ingredientsModalTitle,size:"s",title:s,children:s}),(0,t.jsx)(n.RecipeCardDetails,{details:l})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-200 md:shrink-0 md:flex-row md:flex-wrap md:items-center md:gap-300",children:[(null==m?void 0:m.metadata.pricePerPortion)&&(0,t.jsx)(B,{value:m.metadata.pricePerPortion}),(0,t.jsx)(F,{className:"w-full md:w-auto",currentPortions:u.currentPortions,isAddingToCart:u.isAddingToCart,onAddToCart:u.handleAddAllToCart,onPortionsChange:u.handlePortionsChange,selectedCount:u.selectedCount,totalPrice:null==m?void 0:m.metadata.totalPrice})]})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-300",children:x?(0,t.jsx)("div",{className:"flex flex-col items-center gap-100 py-500 text-center text-secondary","data-test":o.RECIPE_CARD_DATA_TESTS.ingredientsModalError,children:(0,t.jsx)("span",{className:"text-200 leading-300",children:c("chef:recipeDetail.ingredients.loadError")})}):h?(0,t.jsx)(ea,{}):(0,t.jsx)(ei,{allItems:u.allItems,checkedItems:u.checkedItems,globalSelectAll:{checked:u.allNeedToBuySelected,onToggle:u.handleToggleAllNeedToBuy},needToBuyGroups:u.needToBuyGroups,onPresetChange:u.handlePresetChange,onSelectAllInGroup:u.handleSelectAllInGroup,onSwapClose
10:()=>u.setSwapModalIngredientId(null),onSwapConfirm:u.handleSwapConfirm,onSwapOpen:u.setSwapModalIngredientId,onToggleItem:u.handleToggleItem,pantryGroups:u.pantryGroups,presets:null==m?void 0:m.presets,recipeId:e,selectedPresetId:u.selectedPresetId,selectedProducts:u.selectedProducts,swapModalIngredientId:u.swapModalIngredientId})})]})})};e.s(["RecipeIngredientsModal",0,({recipeId:e,name:r,details:i,open:a,onClose:s})=>a?(0,t.jsx)(es,{details:i,name:r,onClose:s,recipeId:e}):null],983137)},649511,861366,e=>{"use strict";var t=e.i(391398),r=e.i(821874),i=e.i(790117),a=e.i(514703),s=e.i(374360),l=e.i(307932);let n={ratingCard:"recipe-rating-card",flowTrigger:"recipe-rating-flow-trigger",flowDropdown:"recipe-rating-flow-dropdown",flowStar:e=>`recipe-rating-flow-star-${e}`,flowThankYou:"recipe-rating-flow-thank-you",flowError:"recipe-rating-flow-error"};e.s(["RECIPE_RATING_DATA_TESTS",0,n],861366),e.s(["RecipeRating",0,({averageRating:e,ratingCount:r})=>{if(!e||!r)return(0,t.jsx)(a.RatingBar,{rating:0,ratingCount:0});let i=Number(e.toFixed(1));return(0,t.jsx)(a.RatingBar,{rating:i,ratingCount:r})},"RecipeRatingCard",0,({averageRating:e,ratingCount:a,className:o})=>{if(null===e||0===a)return null;let d=Number(e.toFixed(1));return(0,t.jsxs)("div",{className:(0,l.cn)("flex w-fit items-center gap-[2px]",o),"data-test":n.ratingCard,children:[(0,t.jsx)(r.default.IconStar,{color:"var(--yellow-60)"}),(0,t.jsx)(i.Caption,{semiBold:!0,as:"span","data-test":s.RatingStarsDataTest.ratingNumber,children:d}),(0,t.jsxs)(i.Caption,{as:"span",color:"secondary","data-test":s.RatingStarsDataTest.ratingCount,children:["(",a,")"]})]})}],649511)},61983,e=>{"use strict";var t=e.i(191788),r=e.i(686248),i=e.i(26736),a=e.i(344643),s=e.i(511954),l=e.i(124622),n=e.i(218528),o=e.i(686296),d=e.i(476363);let c=()=>{var e;if(!(0,d.isFtuQaOverrideAllowed)())return;let t=new URLSearchParams(window.location.search),r=t.get("addressModal");if("v2"===r||"v1"===r)return r;let i=null==(e=t.get("addressModalVariant"))?void 0:e.toUpperCase();if("CONTROL"===i||"A"===i||"B"===i||"C"===i)return i};var u=e.i(844066),m=e.i(794060),p=e.i(142550);e.s(["useOpenDeliveryOrAddressModal",0,()=>{let{showModal:e}=(0,r.useModalActionsContext)(),{setDeliveryType:d}=(0,i.useDeliveryContext)(),g=(()=>{let{client:e}=(0,l.useStatsigClient)(),{variant:r}=(0,o.useStatsigExperiment)(n.STATSIG_EXPERIMENT.ftuAddressModalV2,n.STATSIG_EXPERIMENT_PARAMETER.variant,n.STATSIG_EXPERIMENT_VARIANT.control,{manualExposure:!0}),i=(0,t.useCallback)(()=>{c()||(null==e||e.getExperiment(n.STATSIG_EXPERIMENT.ftuAddressModalV2),null==e||e.flush().catch(()=>void 0))},[e]);return{isEnabled:(e=>{let t=c();return"v2"===t||"A"===t||"B"===t||"C"===t||"v1"!==t&&"CONTROL"!==t&&(e===n.STATSIG_EXPERIMENT_VARIANT.variantA||e===n.STATSIG_EXPERIMENT_VARIANT.variantB||e===n.STATSIG_EXPERIMENT_VARIANT.variantC)})(r),logExposure:i}})(),{zoneId:x}=(0,m.default)(),{address:h,deliveryPoint:f}=(0,a.useDeliveryInfo)(),{modalType:v,logExposure:y}=(0,s.useDeliveryModalType)();return(0,t.useCallback)(t=>{(null==h?void 0:h.id)||(null==f?void 0:f.id)?((null==h?void 0:h.id)?(null==f?void 0:f.id)||d(u.DeliveryType.Courier):d(u.DeliveryType.DeliveryPoint),y(),e(v)):x?(d(u.DeliveryType.Courier),y(),e(v)):(g.logExposure(),e(g.isEnabled?"ADDRESS_MODAL_V2":"ADDRESS_MODAL")),p.default.saveFocusElement(t.currentTarget)},[g.isEnabled,g.logExposure,null==h?void 0:h.id,v,y,d,e,null==f?void 0:f.id,x])}],61983)},740605,e=>{"use strict";var t=e.i(794060),r=e.i(527862),i=e.i(574537),a=e.i(344643),s=e.i(354482),l=e.i(694819),n=e.i(290294),o=e.i(616382),d=e.i(957744),c=e.i(440823),u=e.i(779835);e.s(["useDeliveryModalV2Data",0,()=>{var e,m,p,g,x,h,f;let{user:v}=(0,t.default)(),y=(0,r.default)(),b=(0,i.default)(),{address:C}=(0,a.useDeliveryInfo)(),w=null==C?void 0:C.id,T=(0,s.useStartDeliveryInfo)(w,{retry:!1,meta:(0,l.doNotShowErrorSnackbar)("all")}),{data:j}=(0,n.useFirstDeliveryQuery)(),{data:S}=(0,d.useCartQuery)(),{data:N}=(0,c.useNearestDeliveryPointQuery)({addressId:w}),E=null==N?void 0:N[0],{data:I,isLoading:k}=(0,o.useTimeslotsAvailabilitiesQuery)({userId:null==v?void 0:v.id,addressId:w,priceLimit:0}),_=e=>null==e?void 0:b.formatPrice(e),A=e=>null==e?void 0:b.formatPriceWithFractionDigits(e,0),R=e=>null!=e&&e>0?e:void 0,P=R(null==S?void 0:S.minimalStandardOrderPrice),D=R(null==S?void 0:S.minimalDeliveryPointOrderPrice),L=!!T.isSuccess,{data:B}=(0,u.useShoppingStartDeliveryInfoQuery)(w,null==v?void 0:v.id),M=L?R(null==B||null==(e=B.minimalOrderValue)?void 0:e.amount):void 0,F=_(M)??_(P),O=L?_(R(null==B||null==(m
10=B.freeOrderValue)?void 0:m.amount)):void 0,U=L?_(R(null==B||null==(g=B.shoppingStartDeliveryOptionRange)||null==(p=g.deliveryStartingAt)?void 0:p.amount)):void 0;return{isLoading:T.isFetching,priceLevelsLoading:k,hasFacts:L,addressLabel:(null==C?void 0:C.fullAddress)??(null==j||null==(x=j.data)?void 0:x.deliveryLocationText)??void 0,freeForFTU:T.freeForFTU??void 0,earliestDay:T.firstPossibleDeliveryAtDay||void 0,earliestTime:T.firstPossibleDeliveryAtTime||void 0,usualExpressTime:(null==I||null==(h=I.data)?void 0:h.usualExpressTime)??void 0,freeOrderFrom:O,minimalOrderValue:F,pointMinOrderValue:_(D),homeMinShort:A(P)??A(M),pointMinShort:A(D),deliveryFrom:U,priceLevels:(null==I||null==(f=I.data)?void 0:f.priceLevels)??[],hasDeliveryPoint:!!y.FEATURE_DELIVERY_POINT&&!!(null==S?void 0:S.deliveryPointEnabled),pointEarliest:(null==E?void 0:E.firstAvailableSlot)??void 0,pointName:(null==E?void 0:E.name)??void 0}}])},476363,e=>{"use strict";e.s(["isFtuQaOverrideAllowed",0,()=>window.location.hostname.endsWith(".rohlikgroup.com")])},774889,e=>{"use strict";var t=e.i(218528),r=e.i(853127),i=e.i(720313),a=e.i(686296);let s=e=>{let{tenant:s}=(0,r.useConfiguration)(),l=s===i.Tenant.Knuspr,{variant:n}=(0,a.useStatsigExperiment)(t.STATSIG_EXPERIMENT.ftuPriceProofHomepage,t.STATSIG_EXPERIMENT_PARAMETER.variant,t.STATSIG_EXPERIMENT_VARIANT.control,{deferExposure:e&&l,manualExposure:!e||!l});return l?n===t.STATSIG_EXPERIMENT_VARIANT.variantA?t.STATSIG_EXPERIMENT_VARIANT.variantA:n===t.STATSIG_EXPERIMENT_VARIANT.variantB?t.STATSIG_EXPERIMENT_VARIANT.variantB:t.STATSIG_EXPERIMENT_VARIANT.control:t.STATSIG_EXPERIMENT_VARIANT.control};e.s(["useIsHomepageRebuildTreatment",0,()=>{let e=s(!1);return e===t.STATSIG_EXPERIMENT_VARIANT.variantA||e===t.STATSIG_EXPERIMENT_VARIANT.variantB},"useIsPriceProofHomepage",0,()=>s(!0)===t.STATSIG_EXPERIMENT_VARIANT.variantA,"useIsPriceProofHomepageArm",0,()=>s(!1)===t.STATSIG_EXPERIMENT_VARIANT.variantA])},997970,919657,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(189257),a=e.i(131464),s=e.i(97902),l=e.i(148103),n=e.i(340501),o=e.i(290788),d=e.i(27925),c=e.i(431753),u=e.i(435642),m=e.i(574537),p=e.i(123633),g=e.i(886297),x=e.i(406376),h=e.i(203828),f=e.i(718557),v=e.i(442347),y=e.i(77158),b=e.i(937632),C=e.i(647586),w=e.i(994852);let T=()=>({items:[],dismissed:[]}),j=()=>{let e=(0,C.readStagingCache)();return e?{items:[],dismissed:e.dismissed}:T()},S=(e,t)=>{switch(t.type){case"SET_ITEMS":{let r=new Set(t.items.map(e=>e.productId)),i={...e,items:t.items,dismissed:e.dismissed.filter(e=>r.has(e))};return(0,C.writeStagingCache)({dismissed:i.dismissed}),i}case"DISMISS_ALL":{(0,b.markStickyDismissed)();let t={...e,dismissed:e.items.map(e=>e.productId)};return(0,C.writeStagingCache)({dismissed:t.dismissed}),t}case"RESET":return(0,C.clearStagingCache)(),T();default:return e}},N=(0,r.createContext)(null),E=()=>{let e=(0,r.useContext)(N);if(!e)throw Error("useStaplesBasketContext must be used inside <StaplesBasketProvider>");return e};e.s(["StaplesBasketProvider",0,({children:e})=>{let[i,a]=(0,r.useReducer)(S,void 0,j),{ts:s}=(0,u.default)(),{notify:l}=(0,x.default)(),{addItems:n,isAdding:o}=(()=>{let e=(0,f.useBulkAddToCartMutation)(),[t,i]=(0,r.useState)(!1);return{addItems:(0,r.useCallback)(async(t,r)=>{let a=t.map(e=>({item:e,qty:r.get(e.productId)??e.qty})).filter(({qty:e})=>e>0).filter(({item:e})=>!1!==e.inStock);if(0===a.length)return{added:0};let s=a.map(({item:e,qty:t})=>({productId:e.productId,quantity:t,source:p.STAPLES_BASKET_CART_SOURCE}));i(!0);try{return await e.mutateAsync({products:s}),{added:a.length}}finally{i(!1)}},[e]),isAdding:t}})(),[d,c]=(0,r.useState)(""),[m,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>b(!1),p.STAPLES_SUCCESS_DURATION_MS);return()=>clearTimeout(e)},[m]);let C=(0,h.useRouter)(),T=(0,w.useIsNonProdEnv)()&&"1"===String(C.query[p.STAPLES_FORCE_OPEN_PARAM]),E=(0,y.useIsStaplesEligible)(),I=(0,v.useStaplesBasketQuery)({enabled:E||T}),{cart:k}=(0,g.useCartContext)(),_=(0,r.useMemo)(()=>new Set(Object.keys((null==k?void 0:k.items)??{}).map(Number)),[null==k?void 0:k.items]);(0,r.useEffect)(()=>{I.items.length>0&&a({type:"SET_ITEMS",items:I.items})},[I.items]);let A=(0,r.useMemo)(()=>i.items.filter(e=>!i.dismissed.includes(e.productId)&&!_.has(e.productId)),[i.items,i.dismissed,_]),R=(0,r.useMemo)(()=>I.products.filter(e=>!i.dismissed.includes(e.product.id)&&!_.has(e.product.id)),[I.products,i.dismissed,_]),P=(0,r.useMemo)(()=>A.filter(e=>e.inStock),[A]),D=(0,r.useMemo)(()=>P.reduce((e,t)=>
10e+t.price*t.qty,0),[P]),L=(0,r.useCallback)(()=>{a({type:"DISMISS_ALL"}),c(s("staplesBasket:announce.dismissedAll"))},[s]),B=(0,r.useCallback)(async()=>{if(0!==P.length)try{let e=new Map(P.map(e=>[e.productId,e.qty])),{added:t}=await n(P,e);t>0&&(c(s("staplesBasket:announce.addedAll",{count:t})),l(s("staplesBasket:toastSuccess",{added:t}),"success"),b(!0))}catch{}},[P,n,l,s]),M=(E||T)&&(I.isLoading||A.length>0||m),F=(0,r.useMemo)(()=>({isLoading:I.isLoading,visibleItems:A,visibleProducts:R,includedCount:P.length,totalPrice:D,isPresent:M,announcement:d,showSuccess:m,addAll:B,dismissAll:L,isAdding:o}),[I.isLoading,A,R,P,D,M,d,m,B,L,o]);return(0,t.jsxs)(N.Provider,{value:F,children:[e,(0,t.jsx)("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only","data-test":p.STAPLES_DATA_TESTS.liveRegion,children:d})]})},"useStaplesBasketContext",0,E,"useStaplesBasketPresence",0,()=>{let e=(0,r.useContext)(N);return(null==e?void 0:e.isPresent)??!1}],919657);var I=e.i(962984);let k=({stagedPrice:e})=>{let{ts:i}=(0,u.default)(),a=(0,m.default)(),{cart:s}=(0,g.useCartContext)(),n=(null==s?void 0:s.minimalStandardOrderPrice)??0,o=(null==s?void 0:s.totalPrice)??0,{percent:d,remaining:c,reached:x}=(0,r.useMemo)(()=>
10{let t=o+e;return{percent:n>0?Math.min(100,Math.round(t/n*100)):0,remaining:Math.max(0,n-t),reached:n>0&&t>=n}},[o,e,n]);return n<=0?null:(0,t.jsxs)("div",{"data-test":p.STAPLES_DATA_TESTS.progress,className:"px-200 pt-100 pb-50",children:[(0,t.jsx)(l.BodyText,{as:"p",size:"xs",color:x?"positive":"secondary",className:"mb-50",children:x?i("staplesBasket:progress.reached"):i("staplesBasket:progress.remaining",{amount:a.formatPrice(c)})}),(0,t.jsx)("progress",{max:100,value:d,"aria-label":i("staplesBasket:title"),className:"block h-100 w-full appearance-none overflow-hidden rounded-large border-none bg-grey-20 [&::-moz-progress-bar]:rounded-large [&::-moz-progress-bar]:bg-brand [&::-webkit-progress-bar]:bg-grey-20 [&::-webkit-progress-value]:rounded-large [&::-webkit-progress-value]:bg-brand [&::-webkit-progress-value]:transition-[width] [&::-webkit-progress-value]:duration-500"})]})};var _=e.i(341597),A=e.i(844066),R=e.i(141850),P=e.i(508062),D=e.i(661525),L=e.i(29719),B=e.i(853127),M=e.i(392077);let F=({item:e,productListInfo:r})=>{var i;let{ts:a}=(0,u.default)(),{data:s}=(0,R.useProductCardContext)(),{currencyCode:l}=(0,B.useConfiguration)(),{openModal:n}=(0,L.useProductCardProductModal)({productId:e.productId,isLastMinute:!1,impressionId:null,productListInfo:r,categoryType:A.CategoryType.Normal}),o=(null==s?void 0:s.slug)?`/${(0,M.getBaseLink)(e.productId,s.slug)}`:"#",d=(null==s||null==(i=s.badges)?void 0:i.find(e=>e.position===A.ProductCardBadgePosition.Price))??null;return(0,t.jsxs)("li",{className:"flex flex-col gap-100 border-grey-20 border-b p-100 px-150 last:border-b-0","data-test":p.STAPLES_DATA_TESTS.row(e.productId),children:[(0,t.jsx)("div",{className:"flex items-start gap-100",children:(0,t.jsx)(P.ProductRow,{amount:0,imageSize:60,imageUrl:e.imageUrl,name:e.name,productLink:{to:o,onClick:n,ariaLabel:e.name},textualAmount:(null==s?void 0:s.textualAmount)??void 0,unit:(null==s?void 0:s.unit)??void 0,unitPrice:(null==s?void 0:s.prices.unitPrice)??0,availabilityReason:e.inStock?null:a("staplesBasket:oosLabel"),imageGrayscale:!e.inStock})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100",children:[(0,t.jsx)(_.Price,{currency:l??(null==s?void 0:s.prices.currency)??"",discountBadge:d,originalPrice:(null==s?void 0:s.prices.originalPrice)??null,price:e.price,saleStyle:null==s?void 0:s.prices.salePriceStyle,size:"s"}),e.inStock&&(0,t.jsx)("div",{className:"-mr-50 relative h-[40px] w-[132px] shrink-0",children:(0,t.jsx)(D.ProductRowCounter,{centered:!0,size:"s","data-test":p.STAPLES_DATA_TESTS.addOne(e.productId)})})]})]})},O=({item:e,productListInfo:i})=>{let a=(0,r.useRef)(null);return(0,t.jsx)(R.ProductCardContextProvider,{categoryType:A.CategoryType.Normal,impressionId:null,productCardRef:a,productId:e.productId,productListInfo:i,children:(0,t.jsx)(F,{item:e,productListInfo:i})})},U=()=>{try{return"1"!==sessionStorage.getItem(p.STAPLES_REVEALED_SESSION_KEY)}catch{return!1}};e.s(["StaplesBasketSection",0,({surface:e="drawer"})=>{let{ts:g}=(0,u.default)(),x=(0,m.default)(),{visibleItems:h,visibleProducts:f,isLoading:v,totalPrice:y,includedCount:C,isPresent:w,showSuccess:T,addAll:j,dismissAll:S,isAdding:N}=E(),{stampExposure:_}=(0,I.useStaplesBasketExperiment)(),[A]=(0,r.useState)(U);(0,r.useEffect)(()=>{try{sessionStorage.setItem(p.STAPLES_REVEALED_SESSION_KEY,"1")}
10catch{}},[]);let R=!v&&h.length>0;return((0,r.useEffect)(()=>{R&&(_(e),"drawer"===e&&(0,b.markShownNow)())},[R,_,e]),w)?T&&!v&&0===f.length?(0,t.jsxs)("section",{"data-test":p.STAPLES_DATA_TESTS.success,className:"fade-in flex animate-in items-center gap-100 rounded-large border border-brand-30 bg-brand-light-tertiary px-200 py-150","aria-live":"polite",children:[(0,t.jsx)("span",{className:"flex size-400 shrink-0 items-center justify-center rounded-full bg-brand text-inverted",children:(0,t.jsx)(i.Check,{size:16,"aria-hidden":"true"})}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(l.BodyText,{as:"p",size:"s",semiBold:!0,children:g("staplesBasket:success.title")}),(0,t.jsx)(l.BodyText,{as:"p",size:"xs",color:"secondary",children:g("staplesBasket:success.subtitle")})]})]}):(0,t.jsxs)("section",{"aria-labelledby":"staples-basket-title","data-test":p.STAPLES_DATA_TESTS.section,className:`overflow-hidden rounded-large border border-brand-30 bg-brand-light-tertiary pb-150 ${A?"fade-in slide-in-from-top-2 animate-in duration-700":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-200 pt-200 pb-50",children:[(0,t.jsxs)("div",{className:"flex items-center gap-100",children:[(0,t.jsx)("span",{className:"flex size-350 items-center justify-center rounded-full bg-primary text-brand","aria-hidden":"true",children:(0,t.jsx)(a.Sparkles,{size:16})}),(0,t.jsx)(n.Subtitle,{as:"h2",size:"s",id:"staples-basket-title",children:g("staplesBasket:title")})]}),(0,t.jsx)("button",{type:"button","data-test":p.STAPLES_DATA_TESTS.dismissAll,className:"cursor-pointer border-none bg-transparent p-25 text-90 text-secondary underline hover:text-primary",onClick:S,children:g("staplesBasket:dismissAll")})]}),v?(0,t.jsx)("div",{className:"flex flex-col","aria-hidden":"true",children:Array.from({length:4}).map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center gap-150 border-grey-20 border-b px-200 py-150",children:[(0,t.jsx)("div",{className:"size-600 shrink-0 animate-pulse rounded-medium bg-grey-20"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-50",children:[(0,t.jsx)("div",{className:"h-200 w-3/4 animate-pulse rounded-small bg-grey-20"}),(0,t.jsx)("div",{className:"h-200 w-2/5 animate-pulse rounded-small bg-grey-20"})]})]},r))}):(0,t.jsx)(d.DynamicTranslations,{namespaces:[c.Namespace.product,c.Namespace.catalog],children:(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col p-0","data-test":p.STAPLES_DATA_TESTS.list,children:h.map((e,r)=>{var i;return(0,t.jsx)(O,{item:e,productListInfo:{itemPosition:r+1,listName:"Cart Staples Basket",source:{touchpoint:o.GtmLocationName.Cart,id:p.STAPLES_BASKET_CART_SOURCE,favorite:(null==(i=f.find(t=>t.product.id===e.productId))?void 0:i.userData.favorite)??!1}}},e.productId)})})}),T?(0,t.jsxs)("div",{"data-test":p.STAPLES_DATA_TESTS.success,className:"fade-in mx-200 mt-100 flex animate-in items-center gap-100 rounded-medium bg-primary px-150 py-100","aria-live":"polite",children:[(0,t.jsx)("span",{className:"flex size-400 shrink-0 items-center justify-center rounded-full bg-brand text-inverted",children:(0,t.jsx)(i.Check,{size:16,"aria-hidden":"true"})}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(l.BodyText,{as:"p",size:"s",semiBold:!0,children:g("staplesBasket:success.title")}),(0,t.jsx)(l.BodyText,{as:"p",size:"xs",color:"secondary",children:g("staplesBasket:success.subtitle")})]})]}):C>0&&!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k,{stagedPrice:y}),(0,t.jsx)("div",{className:"px-200 pt-50",children:(0,t.jsx)(s.Button,{variant:"primary",isFullWidth:!0,isLoading:N,onClick:j,"data-test":p.STAPLES_DATA_TESTS.addAll,children:g("staplesBasket:addAll",{count:C,price:x.formatPrice(y)})})})]})]}):null}],997970)},962984,937632,e=>{"use strict";var t=e.i(191788),r=e.i(124622),i=e.i(218528),a=e.i(853127),s=e.i(686296),l=e.i(774389),n=e.i(575590),o=e.i(794060),d=e.i(123633);let c=new Set;e.s(["resetStaplesExposureCache",0,()=>{c.clear()},"useStaplesBasketExperiment",0,()=>{let{isVariantB:e=!1}
10=(0,s.useStatsigExperiment)(i.STATSIG_EXPERIMENT.maiaProactiveNudge,i.STATSIG_EXPERIMENT_PARAMETER.variant,void 0,{manualExposure:!0}),{client:u}=(0,r.useStatsigClient)(),{logEvent:m}=(0,l.useStatsigLogger)(),p=(0,n.useUniqsid)(),{user:g}=(0,o.default)(),{tenant:x}=(0,a.useConfiguration)(),h=e?"treatment":"control",f=(0,t.useCallback)(t=>{e&&p&&(c.has(p)||(c.add(p),null==u||u.getExperiment(i.STATSIG_EXPERIMENT.maiaProactiveNudge),null==u||u.flush().catch(()=>void 0),m(d.STAPLES_EXPOSURE_EVENT,{arm:h,variant:i.STATSIG_EXPERIMENT_VARIANT.variantB,uniqsid:p,userId:null==g?void 0:g.id,tenant:x,surface:"review"===t?"cart_review":"sidebar_cart"})))},[h,e,p,null==g?void 0:g.id,x,m,u]);return{isTreatment:e,arm:h,stampExposure:f}}],962984),e.s(["clearStickyDismissed",0,()=>{try{sessionStorage.removeItem(d.STAPLES_STICKY_DISMISSED_KEY),localStorage.removeItem(d.STAPLES_STICKY_DISMISSED_KEY)}catch{}},"isWithinFrequencyCap",0,()=>Date.now()-(()=>{try{return Number(localStorage.getItem(d.STAPLES_LAST_SHOWN_KEY))||0}catch{return 0}})()<d.STAPLES_FREQUENCY_CAP_MS,"markAutoOpenedThisSession",0,()=>{try{sessionStorage.setItem(d.STAPLES_AUTO_OPENED_KEY,"true")}catch{}},"markShownNow",0,()=>{try{localStorage.setItem(d.STAPLES_LAST_SHOWN_KEY,String(Date.now()))}catch{}},"markStickyDismissed",0,()=>{try{sessionStorage.setItem(d.STAPLES_STICKY_DISMISSED_KEY,"true")}catch{}},"wasAutoOpenedThisSession",0,()=>{try{return"true"===sessionStorage.getItem(d.STAPLES_AUTO_OPENED_KEY)}catch{return!1}},"wasStickyDismissed",0,()=>{try{return"true"===sessionStorage.getItem(d.STAPLES_STICKY_DISMISSED_KEY)}catch{return!1}}],937632)},442347,555765,e=>{"use strict";var t=e.i(191788),r=e.i(2677),i=e.i(893930),a=e.i(123633);let s=async()=>{let e=await fetch("/api/v1/assistant/staples",{credentials:"include"});if(!e.ok)throw Error(`Staples request failed: ${e.status} ${e.statusText}`);let t=await e.json();return(Array.isArray(t.items)?t.items:[]).filter(e=>"number"==typeof e).slice(0,a.STAPLES_MAX_ITEMS)};var l=e.i(417969),n=e.i(134276);let o=async e=>{var t,r;let i=l.default.createDefaultApiConfig(e),s=await n.default.createCategorySpecialApi(i);return((null==(r=(await s.getWeeklyRegulars()).data)||null==(t=r.data)?void 0:t.products)??[]).map(e=>e.productId).filter(e=>"number"==typeof e).slice(0,a.STAPLES_MAX_ITEMS)},d=e=>e.map(e=>{var t;return{productId:e.product.id,name:e.product.name,price:e.prices.price.amount,imageUrl:null==(t=e.product.images)?void 0:t[0],inStock:e.stock.inStock??e.stock.availabilityDimension>0,qty:1,reason:void 0,dueScore:void 0}});e.s(["mapProductsToStagedItems",0,d],555765);var c=e.i(994852);e.s(["useStaplesBasketQuery",0,({enabled:e,source:l="weeklyRegulars"})=>{var n,u;let m=(0,c.useIsNonProdEnv)(),p=(({enabled:e})=>(0,i.useQuery)({queryKey:["staplesProductIds"],queryFn:async()=>await o()??null,enabled:e,staleTime:3e5}))({enabled:e&&"weeklyRegulars"===l}),g=(({enabled:e})=>(0,i.useQuery)({queryKey:["maiaStaplesIds"],queryFn:s,enabled:e,staleTime:3e5}))({enabled:e&&"maia"===l}),x="maia"===l?g:p,h=m?a.STAPLES_DEV_FALLBACK_PRODUCT_IDS:[],f=((null==(n=x.data)?void 0:n.length)?x.data:h).slice(0,a.STAPLES_MAX_ITEMS),v=(0,r.useProductsQuery)({productIds:f});return{items:(0,t.useMemo)(()=>{var e;return d((null==(e=v.data)?void 0:e.products)??[])},[v.data]),products:(null==(u=v.data)?void 0:u.products)??[],isLoading:x.isLoading||v.isLoading,isError:x.isError||v.isError}}],442347)},123633,e=>{"use strict";e.s(["STAPLES_AUTO_OPENED_KEY",0,"staples_basket_auto_opened","STAPLES_AUTO_OPEN_DELAY_MS",0,1200,"STAPLES_BASKET_CART_SOURCE",0,"staples_basket","STAPLES_DATA_TESTS",0,{section:"staples-basket-section",list:"staples-basket-list",row:e=>`staples-basket-row-${e}`,addOne:e=>`staples-basket-add-${e}`,addAll:"staples-basket-add-all",dismissAll:"staples-basket-dismiss-all",liveRegion:"staples-basket-live",progress:"staples-basket-progress",success:"staples-basket-success"},"STAPLES_DEV_FALLBACK_PRODUCT_IDS",0,[1349777,1462148,1461047,1406133,1406914,1303585,1322665,1317247,1351255,1320523],"STAPLES_EXPOSURE_EVENT",0,"staples_basket_exposure","STAPLES_FORCE_OPEN_PARAM",0,"usuals","STAPLES_FREQUENCY_CAP_MS",0,72e6,"STAPLES_LAST_SHOWN_KEY",0,"staples_basket_last_shown_at","STAPLES_MAX_ITEMS",0,8,"STAPLES_REVEALED_SESSION_KEY",0,"staples_basket_revealed","STAPLES_STAGING_CACHE_KEY",0,"staples_basket_staging","STAPLES_STICKY_DISMISSED_KEY",0,"staples_basket_dismissed","STAPLES_SUCCESS_DURATION_MS",0,3200])},77158,e=>{"use strict";var t=e.i(794060),r=e.i(962984),i=e.i(937632);e.s(["useIsStaplesEligible",0,()=>{let{isAuthenticated:e}=(0,t.default)(),{isTreatment:a}=(0,r.useStaplesBasketExperiment)();return!(!e||!a||(0,i.wasStickyDismissed)())}])},647586,e=>{"use strict";var t=e.i(123633);let r=()=>{sessionStorage.removeItem(t.STAPLES_STAGING_CACHE_KEY)};e.s(["clearStagingCache",0,r,"readStagingCache",0,()=>{var e;let i,a,s=sessionStorage.getItem(t.STAPLES_STAGING_CACHE_KEY);if(!s)return null;try{i=JSON.parse(s)}catch{return r(),null}return"object"==typeof(a=e=i)&&null!==a&&!Array.isArray(a)&&Array.isArray(e.dismissed)&&e.dismissed.every(e=>"number"==typeof e)?{dismissed:i.dismissed}:(r(),null)},"writeStagingCache",0,e=>{try{sessionStorage.setItem(t.STAPLES_STAGING_CACHE_KEY,JSON.stringify(e))}catch{}}])},994852,e=>{"use strict";var t=e.i(866089),r=e.i(853127);e.s(["useIsNonProdEnv",0,()=>(0,r.useConfiguration)().realNodeEnv!==t.ENVIRONMENT.production])},627888,e=>{"use strict";var t=e.i(103129);
10let r=(e,r,i)=>e.map(e=>{if(!e.productId)return;let a=r[e.productId];if(a)return(0,t.getTrackingProduct)({product:a,quantity:i(e,a)})}).filter(e=>void 0!==e);e.s(["mapProductsToTracking",0,r,"trackBulkCartAddition",0,({products:e,cartItems:t,source:i,listId:a,getQuantity:s,addToCart:l,createCart:n})=>{let o=r(e,t,s);Object.keys(t).length===e.length&&n(),l({listName:i,listId:a,products:o})}])},566059,e=>{"use strict";var t=e.i(573700),r=e.i(9776),i=e.i(893688);e.s(["useIsMobileRedesign",0,()=>{let{isMobileViewHeader:e}=(0,t.useUIContext)(),{innerWidth:a}=(0,r.useBreakpoints)();return e&&a<i.M_WIDTH},"useIsMobileRedesignWithWidth",0,()=>{let{isMobileViewHeader:e}=(0,t.useUIContext)(),{innerWidth:a}=(0,r.useBreakpoints)();return{isMobileRedesign:e&&a<i.M_WIDTH,innerWidth:a}}])},289456,806646,480986,543062,535792,752837,371591,e=>{"use strict";var t=e.i(391398),r=e.i(191788),i=e.i(468375),a=e.i(435642);let s=()=>{let{ts:e}=(0,a.default)();return(0,t.jsx)("a",{href:"#main-content",className:"sr-only absolute top-0 left-0 z-50 border border-gray-300 bg-white text-black focus:not-sr-only focus:outline-hidden focus:ring-2 focus:ring-blue-500",children:e("common:aria.skipNavigation")})};var l=e.i(59616),n=e.i(927623),o=e.i(307932),d=e.i(148103),c=e.i(340501),u=e.i(251876),m=e.i(252921);let p=(0,o.cn)("inline-flex w-fit text-secondary no-underline transition-colors","[&>*]:transition-colors","hover:text-link-primary hover:underline hover:[&>*]:text-link-primary","focus-visible:text-link-primary focus-visible:underline focus-visible:[&>*]:text-link-primary"),g=(0,o.cn)("flex size-500 shrink-0 items-center justify-center rounded-large bg-brand-light-secondary no-underline transition-colors","hover:bg-brand-light-muted","focus-visible:bg-brand-light-muted"),x=({blocks:e})=>(0,t.jsx)("div",{className:(0,o.cn)("grid w-full grid-cols-1 gap-x-500 gap-y-500","sm:grid-cols-2","md:grid-cols-3","lg:grid-cols-4"),children:e.map((e,r)=>{var i;let{direction:a}=e,s=e.type===n.FooterBlockDTOTypeEnum.Icon;return(0,t.jsxs)("nav",{"aria-labelledby":`${r}-title`,className:"flex min-w-0 flex-col gap-200","data-test":`footer-block-${r}`,children:[e.title&&"#"!==e.title&&(0,t.jsx)(c.Subtitle,{size:"s",id:`${r}-title`,className:"text-primary",children:e.title}),(0,t.jsx)("ul",{className:(0,o.cn)("flex",a===n.FooterBlockDTODirectionEnum.Row||s?"flex-row flex-wrap gap-150":"flex-col",!s&&a!==n.FooterBlockDTODirectionEnum.Row&&"gap-100"),children:null==(i=e.items)?void 0:i.map(({content:r,link:i,icon:a},s)=>e.type===n.FooterBlockDTOTypeEnum.LinkOrText?(0,t.jsx)("li",{children:(0,t.jsx)(m.default,{to:i,className:p,children:(0,t.jsx)(d.BodyText,{size:"s",as:"span",color:"secondary",children:r})})},s):e.type===n.FooterBlockDTOTypeEnum.IconWithLink?(0,t.jsx)("li",{children:(0,t.jsxs)(m.default,{className:(0,o.cn)("inline-flex items-center gap-150 rounded-medium border border-primary bg-primary px-200 py-100 no-underline transition-colors","hover:border-brand hover:bg-secondary","focus-visible:border-brand focus-visible:bg-secondary"),rel:"noopener noreferrer",target:"_blank",to:i,children:[a&&(0,u.getAppIcon)(a,{color:"var(--color-icon-primary)",width:24,height:24}),(0,t.jsx)(d.BodyText,{size:"s",as:"span",className:"text-primary",children:r})]})},s):e.type===n.FooterBlockDTOTypeEnum.Icon?(0,t.jsx)("li",{children:a&&(0,t.jsx)(m.default,{"aria-label":a,className:g,rel:"noopener noreferrer",target:"_blank",to:i,children:(0,u.getAppIcon)(a,{color:"var(--color-icon-brand)",width:24,height:24})})},s):e.type===n.FooterBlockDTOTypeEnum.Image?(0,t.jsx)("li",{className:"w-full max-w-[200px]",children:i?(0,t.jsx)(m.default,{"aria-label":e.title||r||void 0,className:"no-underline",rel:"noopener",referrerPolicy:"strict-origin-when-cross-origin",target:"_blank",to:i,children:(0,t.jsx)("img",{alt:e.title||"",className:"w-full max-w-[200px]",loading:"lazy",src:r||""})}):(0,t.jsx)("img",{alt:e.title||"",className:"w-full max-w-[200px]",loading:"lazy",src:r||""})},s):null)})]},r)})}),h=({blocks:e})=>(0,t.jsx)(t.Fragment,{children:e.map((e,r)=>{var i;return(0,t.jsx)("ul",{className:(0,o.cn)("mx-auto grid max-w-[1024px] list-none grid-cols-1 gap-x-500 gap-y-400 px-200","sm:grid-cols-2","lg:grid-cols-3"),children:null==(i=e.items)?void 0:i.map(({content:e,secondaryContent:r,link:i,icon:a},s)=>(0,t.jsxs)("li",{className:"flex items-start gap-150",children:[a&&(0,t.jsx)("span",{className:"flex size-600 shrink-0 items-center justify-center rounded-large bg-brand-light-secondary","aria-hidden":"true",children:(0,u.getContactIcon)(a,{color:"var(--color-icon-brand)",width:24,height:24})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(c.Subtitle,{size:"s",children:i?(0,t.jsx)(m.default,{to:i,className:"text-primary no-underline transition-colors hover:text-link-primary hover:underline",children:e}):e}),r&&(0,t.jsx)(d.BodyText,{className:(0,o.cn)("mt-25 whitespace-pre-line text-pretty","[&_a]:text-link-primary [&_a]:underline","hover:[&_a]:text-link-primary-hover hover:[&_a]:no-underline"),color:"secondary",htmlContent:r,size:"s"})]})]},s))},r)})});var f=e.i(790117);let v=({blocks:e})=>(0,t.jsx)("div",{className:(0,o.cn)("flex w-full flex-col gap-50","[&_a]:text-link-primary [&_a]:transition-colors","[&_a:hover]:text-link-primary-hover [&_a:hover]:no-underline","[&_a:focus]:text-link-primary-hover [&_a:focus]:no-underline"),children:e.reduce((e,t)=>
10[...e,...t.items||[]],[]).map((e,r)=>(0,t.jsx)(f.Caption,{color:"secondary",children:e.link?(0,t.jsx)(m.default,{to:e.link,children:e.content}):e.content},r))});var y=e.i(656598);let b=()=>(0,t.jsx)("ul",{"data-test":"skeleton-customer-care",className:(0,o.cn)("mx-auto grid max-w-[1024px] list-none grid-cols-1 gap-x-500 gap-y-400 px-200","sm:grid-cols-2","lg:grid-cols-3"),children:[void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("li",{className:"flex items-start gap-150",children:[(0,t.jsx)("span",{className:"size-600 shrink-0 rounded-large bg-skeleton","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(c.Subtitle,{size:"s",children:(0,t.jsx)(y.SkeletonText,{shortText:!0})}),(0,t.jsx)(d.BodyText,{className:"mt-25",color:"secondary",size:"s",children:(0,t.jsx)(y.SkeletonText,{})})]})]},r))}),C=()=>(0,t.jsx)("div",{"data-test":"skeleton-disclaimer",className:"w-full pt-[20px]",children:[void 0,void 0].map((e,r)=>(0,t.jsx)(f.Caption,{color:"secondary",children:(0,t.jsx)(y.SkeletonText,{})},r))}),w=()=>(0,t.jsx)(t.Fragment,{children:[void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)("nav",{"data-test":`skeleton-block-${r}`,className:"flex min-w-0 flex-col gap-200",children:[(0,t.jsx)(c.Subtitle,{size:"s",children:(0,t.jsx)(y.SkeletonText,{})}),(0,t.jsx)("ul",{className:"flex flex-col gap-100",children:[void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsx)("li",{children:(0,t.jsx)(d.BodyText,{size:"s",children:(0,t.jsx)(y.SkeletonText,{})})},r))})]},r))});var T=e.i(527862),j=e.i(125541),S=e.i(991134),N=e.i(853127),E=e.i(641956),I=e.i(599534);let k={width:16,height:16},_=({languages:e,onChange:r})=>e.length<2?null:(0,t.jsx)("div",{className:"u-flex-center","data-test":"language-switch",children:e.map(({title:e,value:i,icon:a,selected:s})=>s?(0,t.jsxs)("div",{className:"u-flex-center mr-100","data-language":i,"data-test":"language-selected",children:[a,(0,t.jsx)(f.Caption,{semiBold:!0,className:"u-flex-center ml-100",children:e})]},i):(0,t.jsxs)(I.Button,{className:"mr-100","data-language":i,"data-test":"language-not-selected",disabled:s,onClick:()=>r(i),size:"s",type:"secondary",children:[a,e]},i))}),A=({setLanguageTitle:e})=>{let{lang:r}=(0,a.default)(),i=(0,S.useChangeLanguageMutation)(),{tenant:s}=(0,N.useConfiguration)(),l=[(0,j.getDefaultLocale)(s)],n=(0,j.getLanguageMutation)(s,"en");n&&l.push(n);let o=l.map(t=>({selected:t===r,title:e(t),value:t,icon:(0,u.getLanguageIcon)(t,k)}));return(0,t.jsx)(_,{languages:o,onChange:e=>i.mutate({language:e})})};var R=e.i(144373),P=e.i(920166),D=e.i(97902),L=e.i(720731),B=e.i(150151),M=e.i(578280),F=e.i(954858);let O=({className:e})=>{let{ts:r}=(0,a.default)(),{theme:i,setTheme:s,mounted:l}=(0,P.useThemeWithSync)(),{theme:n}=(0,N.useConfiguration)();if(!l)return null;let c=[{value:F.ThemePreference.System,label:r("ui:themeSwitch.system"),icon:(0,t.jsx)(L.default,{}),dataTest:"theme-switch-system-button"},{value:`${n}-${F.ThemeMode.Light}`,label:r("ui:themeSwitch.light"),icon:(0,t.jsx)(B.default,{}),dataTest:"theme-switch-light-button"},{value:`${n}-${F.ThemeMode.Dark}`,label:r("ui:themeSwitch.dark"),icon:(0,t.jsx)(M.default,{}),dataTest:"theme-switch-dark-button"}];return(0,t.jsxs)("div",{className:(0,o.cn)("flex flex-col items-center justify-center gap-100",e),"data-test":"theme-switch",children:[(0,t.jsx)(d.BodyText,{size:"s",className:"text-secondary",semiBold:!0,children:r("ui:themeSwitch.label")}),(0,t.jsx)("div",{className:"flex flex-wrap justify-center gap-50",children:c.map(e=>(0,t.jsx)(D.Button,{onClick:()=>s(e.value),isLoading:!1,variant:i===e.value?"secondaryNeutral":"ghostNeutral",icon:e.icon,"data-test":e.dataTest,"aria-label":`${r("ui:themeSwitch.label")}: ${e.label}`,"aria-pressed":i===e.value,children:e.label},e.value))})]})},U=({data:e,isLoading:r})=>{let{t:i,ts:s,lang:l}=(0,a.default)(),d=(0,T.default)(),{canShowCookieConsent:c}=(0,R.useCookieConsentContext)();return(0,t.jsxs)("footer",{role:"contentinfo",className:"relative bg-secondary print:hidden",children:[(0,t.jsxs)("div",{className:"border-primary border-t border-b bg-secondary py-500",children:[(0,t.jsx)("h3",{className:"hidden",children:i("common:aria.contact")}),r&&(0,t.jsx)(b,{}),e&&(0,t.jsx)(h,{blocks:e.filter(e=>e.section===n.FooterBlockDTOSectionEnum.Contact)})]}),(0,t.jsxs)("div",{className:(0,o.cn)("mx-auto flex max-w-[1024px] flex-col gap-500 px-200 py-500","lg:px-300"),children:[r&&(0,t.jsx)("div",{className:(0,o.cn)("grid grid-cols-1 gap-x-500 gap-y-500","sm:grid-cols-2","md:grid-cols-3","lg:grid-cols-4"),children:(0,t.jsx)(w,{})}),e&&(0,t.jsx)(x,{blocks:e.filter(e=>e.section===n.FooterBlockDTOSectionEnum.Links)}),(0,t.jsxs)("div",{className:"flex flex-col gap-300 border-primary border-t pt-400",children:[r&&(0,t.jsx)(C,{}),e&&(0,t.jsx)(v,{blocks:e.filter(e=>e.section===n.FooterBlockDTOSectionEnum.Disclaimer)}),c&&(0,t.jsx)(f.Caption,{className:"w-full",color:"secondary","data-test":"cookies-consent",children:i("common:changeCookieConsent",{components:{Link:(0,t.jsx)(m.default,{onClick:()=>{var e,t;return(null==(t=window)||null==(e=t.UC_UI)?void 0:e.isInitialized())?window.UC_UI.showSecondLayer():null},children:"Renew or change your cookie consent"})}})}),(0,t.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-200","sm:flex-row sm:items-center sm:justify-between"),children:[d.FEATURE_LANGUAGE_SWITCH&&(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsx)(A,{setLanguageTitle:e=>{let t=e===l?"":s("common:switchTo");return`${t} ${(0,j.getLanguageTitle)(e)}`}})}),(0,t.jsx)(O,{className:"shrink-0"})]})]})]})]})},z=()=>{let{data:e,isLoading:r}=(0,l.useFooterQuery)();return(0,t.jsx)(U,{data:e,isLoading:r})};var Q=e.i(720288),H=e.i(632938),K=e.i(244796),W=e.i(292905),G=e.i(134276),q=e.i(809452),V=e.i(673552),Y=e.i(321517),$=e.i(794060),X=e.i(810686);let Z=({bottomSheetType:e,content:r,onClick:i})=>e!==n.BottomSheetMessageTypeName.PersonalizationConsent?null:(0,t.jsx)("div",{className:"mt-500","data-test":"personalisation-content",children:r.buttons.map(r=>{let a;return(0,t.jsx)(E.default,{fullWidth:!0,className:"mt-200","data-test":(a=r.activityType,`personalisation-content-${a}`),onClick:()=>i(e,r.activityType),type:r.activityType===n.ActivityType.Accept?"primary":"secondary",children:r.text},r.activityType)})});var J=e.i(919657),ee=e.i(945140),et=e.i(367914),er=e.i(2677),ei=e.i(984876),ea=e.i(611353),es=e.i(142550),el=e.i(782829),en=e.i(290788),eo=e.i(27925),ed=e.i(498856),ec=e.i(431753),eu=e.i(114168),em=e.i(965168),ep=e.i(285700),eg=e.i(957744),ex=e.i(341597),eh=e.i(844066),ef=e.i(508062),ev=e.i(661525),ey=e.i(141850),eb=e.i(611414),eC=e.i(836997),ew=e.i(29719),eT=e.i(896938),ej=e.i(392077),eS=e.i(574537),eN=e.i(247086),eE=e.i(62851);let eI=({item:e,productListInfo:i,onPendingRemovalStart:s,onPendingRemovalEnd:l})=>{var n;let{t:c,ts:u}=(0,a.default)(),p=(0,eS.default)(),{getDateWithYear:g}=(0,eN.default)(),{data:x}=(0,ey.useProductCardContext)(),{changeQuantity:h}=(0,eT.useProductCardActions)(),{setNotification:f}=(0,eb.useStatusNotificationsContext)(),{currencyCode:v}=(0,N.useConfiguration)(),y=(0,ep.useQueryClient)(),[b,C]=(0,r.useState)(!1),[w,T]=(0,r.useState)(!1),j=(0,r.useRef)(void 0),S=(0,r.useRef)(void 0),E=(0,r.useRef)(void 0),I=(0,r.useRef)(null),k=(0,r.useRef)(null),_=(0,r.useRef)(!1),A=(0,r.useRef)(!0),R=(0,r.useRef)(Promise.resolve(!1)),P=(0,r.useRef)(!1),D=(0,r.useRef)(!1),L=(0,r.useRef)(l);L.current=l;let B=(0,r.useRef)(0),M=(0,r.useRef)(4e3),F=(0,r.useRef)(!1),O=(0,r.useRef)(!1),U=(0,r.useRef)(!1),z=e.productId??0,Q=e.quantity??0,H=e.price??0,K=e.originalPrice??null,W=e.deposit??0,G=e.billablePackagingPriceVAT??0,{openModal:q}=(0,ew.useProductCardProductModal)({productId:z,isLastMinute:e.isLastMinute??!1,impressionId:null,productListInfo:i,categoryType:eh.CategoryType.Normal}),V=(null==x?void 0:x.slug)?`/${(0,ej.getBaseLink)(z,x.slug)}`:"#",Y=e.silent?null:(null==x||null==(n=x.badges)?void 0:n.find(e=>e.position===eh.ProductCardBadgePosition.Price))??null,$=()=>{j.current&&(clearTimeout(j.current),j.current=void 0)},X=()=>{E.current&&(clearTimeout(E.current),E.current=void 0)},Z=()=>{$(),S.current&&(clearTimeout(S.current),S.current=void 0),X()},J=()=>{B.current=0,M.current=4e3,F.current=!1,O.current=!1,U.current=!1},ee=()=>{var e;P.current&&(P.current=!1,null==(e=L.current)||e.call(L,z))},et=()=>{S.current||($(),X(),T(!0),S.current=setTimeout(ee,300))},er=e=>{$(),B.current=Date.now(),M.current=e,j.current=setTimeout(()=>{j.current=void 0,et()},e)};(0,r.useEffect)(()=>()=>{A.current=!1,Z(),ee()},[]),(0,r.useEffect)(()=>{var e,t,r;
10w?null==(e=k.current)||e.blur():b?(O.current=!0,null==(t=k.current)||t.focus()):_.current&&!b&&(null==(r=I.current)||r.focus()),_.current=b},[w,b]);let ei=async()=>{let e=await h(0);return!e||!("error"in e)||(ee(),A.current&&(Z(),J(),C(!1),T(!1)),!1)},ea=async()=>{try{var e;if(!await R.current.catch(()=>!1))return;let t=await h(Q,(null==x||null==(e=x.prices)?void 0:e.saleId)??void 0);t&&"error"in t||await y.invalidateQueries({queryKey:[eg.cartQueryKeyPrefix]},{cancelRefetch:!1})}finally{D.current=!1,ee()}};return(0,t.jsx)("li",{className:(0,o.cn)("grid transition-[grid-template-rows,padding,border-bottom-width,opacity] duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)] last:border-b-0","[&_[data-test=IconTrashCan]_path]:fill-[var(--color-icon-negative)]",w?"pointer-events-none grid-rows-[0fr] border-b-0 p-0 opacity-0":"grid-rows-[1fr] border-primary border-b bg-primary p-100 opacity-100"),"data-test":em.CartDataTests.cartItem,id:`product_${z}`,children:(0,t.jsxs)("div",{className:"min-h-0 overflow-hidden",children:[(0,t.jsx)("div",{"aria-hidden":b,inert:b,className:(0,o.cn)("grid transition-[grid-template-rows,opacity] duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]",b?"pointer-events-none grid-rows-[0fr] opacity-0":"grid-rows-[1fr] opacity-100"),children:(0,t.jsxs)("div",{className:"min-h-0 overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-start gap-100",children:[(0,t.jsxs)(ef.ProductRow,{amount:0,imageSize:60,imageUrl:e.imgPath??void 0,name:e.productName??"",productLink:{to:V,onClick:q,ariaLabel:e.productName??""},textualAmount:e.textualAmount??void 0,unit:x?e.unit??void 0:void 0,unitPrice:(null==x?void 0:x.prices.unitPrice)??0,children:[e.isLastMinute&&e.expireAt&&(0,t.jsxs)("span",{className:"mt-25 font-semibold text-80 text-special-offer leading-200",children:[c("cart:expirationDate")," ",g(e.expireAt,!0)]}),e.cartItemMessages&&(0,t.jsx)("span",{className:"mt-25 font-semibold text-80 text-special-offer leading-200",children:e.cartItemMessages})]}),(0,t.jsx)("button",{"aria-label":u("cart:removeItemAria"),className:"shrink-0 rounded-small p-50 text-tertiary hover:bg-grey-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-brand","data-test":em.CartDataTests.cartItemRemove,onClick:()=>{D.current||(Z(),J(),C(!0),T(!1),er(4e3),E.current=setTimeout(()=>{E.current=void 0,et()},2e4),P.current=!0,null==s||s(z),R.current=ei())},ref:I,type:"button",children:(0,t.jsx)(eC.default,{color:"var(--grey-90)",width:16,height:16})})]}),(0,t.jsxs)("div",{className:"mt-50 flex items-center justify-between gap-100",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsx)(ex.Price,{currency:v??(null==x?void 0:x.prices.currency)??"",discountBadge:Y,originalPrice:e.silent||null==K?null:Q*K,price:Q*H,saleStyle:null==x?void 0:x.prices.salePriceStyle,size:"s"}),0!==W&&(0,t.jsxs)("span",{className:"text-70 text-secondary leading-150","data-test":eE.ProductDataTests.productPriceDeposit,children:[c("product:deposit")," ",p.formatPrice(W)]}),G>0&&(0,t.jsxs)("span",{className:"text-70 text-secondary leading-150","data-test":eE.ProductDataTests.productPriceDepositPackaging,children:[c("product:deposit_billablePackaging")," ",p.formatPrice(G)]})]}),(0,t.jsx)("div",{className:"-mr-100 relative h-[40px] w-[132px] shrink-0",children:(0,t.jsx)(ev.ProductRowCounter,{alwaysExpanded:!0,centered:!0,"data-test":em.CartDataTests.cartItemCounter,maxAmountOverride:e.maxBasketAmount??void 0,onRemoved:()=>{f(eb.StatusNotificationType.deletedCartItem,(0,t.jsx)(m.default,{onClick:q,to:V,children:e.productName}))},size:"s"})})]})]})}),(0,t.jsx)("div",{"aria-hidden":!b||w,"aria-live":"polite",inert:!b||w,className:(0,o.cn)("grid overflow-hidden transition-[grid-template-rows,opacity] duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]",b&&!w?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,t.jsx)("div",{className:"min-h-0 overflow-hidden",children:b&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-100",children:[(0,t.jsx)(d.BodyText,{size:"xs",semiBold:!0,children:c("cart:itemRemoved")}),(0,t.jsx)(d.BodyText,{size:"xs",children:(0,t.jsx)(m.default,{ref:k,"aria-label":u("cart:undoRemove"),className:"text-primary hover:no-underline",onClick:()=>{D.current||(Z(),J(),C(!1),T(!1),D.current=!0,ea())},onBlur:()=>{F.current=!1,b&&!w&&U.current&&!F.current&&(U.current=!1,er(M.current))},onFocus:()=>
10{if(O.current){O.current=!1;return}F.current=!0,(()=>{if(!b||w||U.current||!j.current)return;let e=Date.now()-B.current;M.current=Math.max(0,M.current-e),$(),U.current=!0})()},children:c("cart:undoRemove")})})]})})})]})})},ek=({item:e,productListInfo:i,...a})=>{let s=(0,r.useRef)(null);return(0,t.jsx)(ey.ProductCardContextProvider,{categoryType:eh.CategoryType.Normal,impressionId:null,productCardRef:s,productId:e.productId??0,productListInfo:i,children:(0,t.jsx)(eI,{item:e,productListInfo:i,...a})})};var e_=e.i(38946),eA=e.i(24068);let eR=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("bg-transparent pt-150 pr-200 pb-50 pl-100",e),...i,children:r})),eP=({category:e,items:i,isStocksLoading:a,onPendingRemovalStart:s,onPendingRemovalEnd:l})=>{var n;let[d,c]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!0),x=(0,r.useRef)(!1),h=(e.items??[]).reduce((e,t,r)=>{let a=null==i?void 0:i[t];return a&&e.push({item:a,index:r}),e},[]);(0,r.useEffect)(()=>{let e=setTimeout(()=>c(!0),0);return()=>clearTimeout(e)},[]),(0,r.useEffect)(()=>{if(h.length>0){x.current=!0,m(!1),g(!0);return}if(!x.current)return void g(!1);m(!0);let e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)},[h.length]);let f=x.current&&0===h.length;return(h.length||x.current)&&p?f||d&&!a?(0,t.jsx)("div",{className:(0,o.cn)("grid overflow-hidden transition-[grid-template-rows,opacity] duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]",u?"grid-rows-[0fr] opacity-0":"grid-rows-[1fr] opacity-100"),"data-status":e.name,children:(0,t.jsxs)("div",{className:"min-h-0 overflow-hidden",children:[(0,t.jsx)(eR,{children:(0,t.jsx)("h3",{className:"m-0 font-semibold text-90 text-secondary leading-[22px]",children:e.name})}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-medium bg-primary",children:[(0,t.jsx)("ul",{children:h.map(({item:e,index:r})=>(0,t.jsx)(ek,{item:e,onPendingRemovalStart:s,onPendingRemovalEnd:l,productListInfo:{itemPosition:r+1,listName:el.GtmLocationFactory.cart(),source:{touchpoint:en.GtmLocationName.Cart,favorite:e.favourite,id:void 0}}},e.productId))}),(0,t.jsx)(e_.default,{notifications:null==(n=e.bottomMessages)?void 0:n.map(e=>(0,eA.MessageWithPriorityDTO_NotificationServerMessageExtended)(e)),round:!1})]})]})}):(0,t.jsx)("div",{className:"mx-200 my-100 h-[100px] rounded-medium bg-grey-20"}):null},eD=(e,t)=>{var r;let i=(null==e?void 0:e.companies)??[];return[...(null==e||null==(r=e.companies)?void 0:r.map(e=>({id:e.id??0,categories:Array.from(e.categories??[]),mergeInto:e.mergeInto??void 0})))??[],...i.reduce((e,t,r,i)=>t.mergeInto&&!i.find(({id:e})=>e===t.mergeInto)?[...e,t.mergeInto]:e,[]).map(e=>({id:t[e].id,categories:[]}))].sort((e,t)=>(e.id??0)-(t.id??0)).map((e,t,r)=>{let i=r.find(t=>t.mergeInto===e.id);return i?{...e,categories:[...e.categories??[],...i.categories??[]]}:e}).filter(e=>null==e.mergeInto&&e.mergeInto!==e.id)};var eL=e.i(366653),eB=e.i(769272),eM=e.i(456298),eF=e.i(893930),eO=e.i(417969),eU=e.i(543791),ez=e.i(905397);let eQ=async(e,t)=>{let r=await G.default.createNewAPIProductStockApi(eO.default.createDefaultApiConfig(t));return(0,eU.fetchInChunks)(e.ids,e=>r.getProductsStocks(e))};var eH=e.i(997970);let eK=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("bg-transparent px-200 pt-150 pb-50",e),...i,children:r})),eW=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)(m.default,{ref:a,className:(0,o.cn)("block overflow-hidden rounded-large bg-primary no-underline",e),...i,children:r})),eG=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("block h-full w-full","overflow-hidden overflow-y-auto","bg-secondary","flex flex-col gap-150 px-150 py-150","[&>*]:shrink-0",e),...i,children:r})),eq=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("flex h-700 pr-200","bg-primary","border-grey-20 border-t","justify-center gap-50 text-right",e),...i,children:r})),eV=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("overflow-hidden rounded-large bg-primary empty:hidden",e),...i,children:r})),eY=(0,r.forwardRef)(({handleOpenUpsell:e,cart:i,children:s,topContent:l,bottomContent:n,stickyFooter:o,onPendingRemovalStart:c,onPendingRemovalEnd:u},m)=>{let{byId:p}=(0,ei.useCompaniesContext)(),{t:g,ts:x}=(0,a.default)(),h=(0,eS.default)(),v=eD(i,p),{companyId:y}=(0,eL.useGlobalState)(),b=(0,J.useStaplesBasketPresence)(),[C,w]=(0,eu.useInView)({threshold:0,triggerOnce:!1});(0,r.useEffect)(()=>{e(w)},[w]);let{isLoading:T}=(e=>{let t=(0,ep.useQueryClient)(),{isLoading:r}=(0,eF.useQuery)({queryKey:["productsStocksLoading",e],queryFn:async()=>{let r=await eQ(e);
10return r&&r.forEach(e=>{t.setQueryData((0,ez.getProductStockQueryKey)({productId:e.productId}),e)}),r},enabled:!!e.ids.length,placeholderData:eM.keepPreviousData});return{isLoading:r}})({ids:Object.keys((null==i?void 0:i.items)??{}).map(Number)});if(!i)return null;let{items:j,categories:S}=i;return(0,t.jsxs)(eG,{ref:m,className:o?"pb-0":void 0,"data-test":em.CART_DATA_TEST.products,children:[l,(0,t.jsx)(eH.StaplesBasketSection,{}),b&&(0,t.jsx)("h3",{className:"-mb-100 m-0 px-100 pt-50 font-semibold text-90 text-secondary leading-[22px]",children:x("staplesBasket:cartZone")}),v.map(e=>{var r;if(e.id===y)return e.categories.map(e=>{let r=null==S?void 0:S[e];return r?(0,t.jsx)(eP,{category:r,items:j,isStocksLoading:T,onPendingRemovalStart:c,onPendingRemovalEnd:u},e):null});let i=e.categories.reduce((e,t)=>{var r,i;return[...e,...((null==S||null==(i=S[t])||null==(r=i.items)?void 0:r.map(e=>null==j?void 0:j[e]))??[]).filter(e=>void 0!==e)]},[]),a=p[e.id]||{};return(0,t.jsxs)(eW,{to:a.url||"/",children:[(0,t.jsx)(eK,{"data-test":`${a.type}Cart`,children:(0,t.jsx)(d.BodyText,{size:"xs",semiBold:!0,color:"secondary",children:null==(r=p[a.id])?void 0:r.label})}),(0,t.jsxs)(eq,{children:[(0,t.jsx)(eB.default,{className:"pr-50 pl-100",companyId:a.id,height:55,width:56}),(0,t.jsx)(f.Caption,{className:"u-flex-center",children:g("cart:companyTitle",{context:a.type,totalCount:i.length,totalPrice:h.formatPrice(i.reduce((e,t)=>e+(t.quantity??0)*(t.price??0),0))})})]})]},e.id)}),n,(0,t.jsx)(eV,{ref:C,children:s}),o]})});var e$=e.i(377216),eX=e.i(578764),eZ=e.i(658384),eJ=e.i(140248),e0=e.i(84161),e1=e.i(586489),e2=e.i(188989),e5=e.i(417370);let e3=({products:e,onOpen:r})=>{let{ts:i}=(0,a.default)(),s=(0,H.useCdn)(),l=e.slice(0,8);return l.length?(0,t.jsxs)("button",{type:"button",onClick:()=>r(0),"data-test":em.NextBestOfferDataTests.nboTeaserRohlink,className:"flex w-full cursor-pointer flex-col gap-100 rounded-large border-none bg-primary px-200 py-150 text-left shadow-[0_1px_2px_rgba(0,0,0,0.05),0_4px_12px_rgba(0,0,0,0.06)]",children:[(0,t.jsxs)("span",{className:"flex w-full items-baseline justify-between gap-100",children:[(0,t.jsx)(d.BodyText,{as:"span",size:"s",semiBold:!0,children:i("product:recommended.title")}),(0,t.jsx)(d.BodyText,{as:"span",size:"xs",semiBold:!0,className:"text-brand",children:i("product:recommended.scrollmore")})]}),(0,t.jsxs)("span",{className:"relative flex w-full gap-100 overflow-hidden",children:[l.map(({product:e})=>(0,t.jsx)("span",{"data-test":em.NextBestOfferDataTests.nboTeaserItem,className:"flex size-600 shrink-0 items-center justify-center rounded-medium bg-[#F6F6F6] p-100",children:(0,t.jsx)("img",{alt:e.name,src:s(e.images[0],{width:80,height:80}),className:"max-h-full max-w-full object-contain mix-blend-multiply"})},e.id)),(0,t.jsx)("span",{"aria-hidden":"true",className:"absolute top-0 right-0 h-full w-200 bg-gradient-to-l from-[var(--background-color-primary)] to-transparent"})]})]}):null},e8=({cart:e})=>{let[i,s]=(0,r.useState)(!1),{ts:l}=(0,a.default)(),{totalPrice:o=0,minimalStandardOrderPrice:d=0,minimalDeliveryPointOrderPrice:c=0,deliveryPointEnabled:u=!1,cartBanners:m}=e??{},p=(0,r.useMemo)(()=>({totalPrice:o,minimalStandardOrderPrice:d,minimalDeliveryPointOrderPrice:c,deliveryPointEnabled:u,freeDeliveryRemainingAmount:null}),[o,d,c,u]),g=null==m?void 0:m.find(e=>e.type===n.CartBannerType.Essential),{isMilestoneSetStable:x}=(0,e2.useDeliveryFtuInfo)(),h=(0,e1.useDeliverySegments)(p),f=(0,e5.useActiveThreshold)(p,g);if(!x||!(null==h?void 0:h.length))return null;let v=h.every(e=>e.reached),y=(null==f?void 0:f.message)??(v?l("cart:result.deliveryUnlocked"):""),b=!f&&v;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eZ.SegmentedDeliveryProgressBar,{message:y,segments:h,isComplete:b,onInfoClick:()=>s(!0)}),i&&(0,t.jsx)(e0.DeliveryFeeInfoSheet,{onClose:()=>s(!1)})]})},e4=(0,r.forwardRef)(({cart:e,handleHideCart:i,showUpsellTeaser:s,upsellProducts:l,showOrderButton:n,handleScrollToUpsell:d},c)=>{let{routes:u,router:m}=(0,eX.useRouting)(),{ts:p}=(0,a.default)(),[g,x]=(0,r.useState)(!1),h=async()=>{x(!0),await m.push(u.cartReview.url()),x(!1),i()};return(0,t.jsxs)("div",{ref:c,className:"-mx-150 pointer-events-none sticky bottom-0 z-[1000] mt-auto flex w-auto flex-col gap-50 bg-transparent p-100",children:[(0,t.jsx)("div",{"aria-hidden":!s,inert:!s,className:(0,o.cn)("pointer-events-auto grid transition-[grid-template-rows,opacity] duration-300 ease-[
10cubic-bezier(0.25,0.1,0.25,1)]",s?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,t.jsx)("div",{className:"-m-200 min-h-0 overflow-hidden p-200",children:(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.product],children:(0,t.jsx)(e3,{products:l,onOpen:d})})})}),(0,t.jsx)("div",{children:(0,t.jsxs)("div",{"data-test":em.CART_DATA_TEST.deliveryFooter,className:"pointer-events-auto flex flex-col gap-200 rounded-large bg-alpha-90 p-200 shadow-[0_2px_4px_rgba(0,0,0,0.12),0_8px_24px_rgba(0,0,0,0.18)] dark:bg-white",children:[(0,t.jsx)("div",{className:"flex flex-col gap-100 empty:hidden",children:(0,t.jsx)(eJ.CartReviewPromoBanners,{})}),(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.delivery],children:(0,t.jsx)(e8,{cart:e})}),!!n&&(0,t.jsx)(D.Button,{variant:"primary",size:"l",isFullWidth:!0,icon:(0,t.jsx)(e$.ChevronRight,{"aria-hidden":"true"}),iconPosition:"after","data-test":em.CART_DATA_TEST.footerCartReviewButton,isDisabled:g||!(null==e?void 0:e.totalPrice),onClick:h,children:(0,t.jsx)("span",{className:"font-semibold",children:p("cart:continueToCart")})})]})})]})});var e9=e.i(909725),e6=e.i(821874);let e7=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("relative",e),...i,children:r})),te=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("-top-25 absolute left-1/2 ml-50","flex h-200 min-w-200 items-center justify-center","rounded-medium bg-brand-new px-50","text-center font-semibold text-inverted",e),...i,children:r})),tt=({itemsLength:e,iconColor:r="primary"})=>(0,t.jsxs)(e7,{"aria-hidden":"true",children:[!!e&&(0,t.jsx)(te,{children:(0,t.jsx)(f.Caption,{semiBold:!0,color:"inverted",children:e})}),(0,t.jsx)(e6.default.IconCartClosed,{className:(0,o.cn)("inverted"===r&&"[&_path]:fill-white","brand"===r&&"[&_path]:fill-icon-brand")})]});e.s(["CartIcon",0,tt],806646);var tr=e.i(498505),ti=e.i(495850);let ta=({cart:e,handleHideCart:r})=>{let{ts:i}=(0,a.default)(),s=(0,eS.default)(),{currencyCode:l}=(0,N.useConfiguration)(),{routes:n,router:d}=(0,eX.useRouting)(),{setIsCartVisible:c}=(0,ti.useCartVisibilityContext)(),{totalPrice:u=0,items:p={}}=e??{},g=s.formatPrice(u),x=Object.keys(p??{}).length,h=x>0,f=()=>(c(!1),d.push(n.cartReview.url()));return(0,t.jsxs)("div",{className:(0,o.cn)("relative z-[1] flex w-full items-center justify-between gap-100 border-grey-20 border-b bg-primary px-200 py-100 shadow-[0_1px_2px_rgba(0,0,0,0.04),0_3px_8px_rgba(0,0,0,0.05)]",!h&&"justify-end"),children:[h&&(0,t.jsxs)(m.default,{to:n.cartReview.url(),onClick:f,onKeyUp:(0,tr.getOnKeyUpCallback)(f),className:"flex items-center gap-200 rounded-medium border border-grey-20 bg-primary pr-100 text-inherit no-underline transition-colors hover:border-brand-light","aria-label":i("common:aria.inCart",{totalCount:x,price:g}),tabIndex:0,"data-test":em.CART_DATA_TEST.headerWrapper,children:[(0,t.jsx)("span",{className:"flex h-600 items-center justify-center rounded-[7px] bg-brand-light-secondary py-100 pr-200 pl-100",children:(0,t.jsx)(tt,{itemsLength:x,iconColor:"brand"})}),(0,t.jsxs)("span",{className:"flex items-center gap-100",children:[(0,t.jsx)(ex.Price,{price:u,currency:l,size:"m","data-test":em.CART_DATA_TEST.cartHeaderPrice}),(0,t.jsx)(e$.ChevronRight,{size:24,"aria-hidden":"true",className:"text-brand"})]})]}),(0,t.jsx)(D.Button,{variant:"secondaryNeutral",size:"m",icon:(0,t.jsx)(e9.X,{size:20}),className:"shrink-0",onClick:r,isLoading:!1,"aria-label":i("common:close"),"data-test":em.CART_DATA_TEST.closeButton}),h&&(0,t.jsx)(m.default,{to:n.cartReview.url(),onClick:f,onKeyUp:(0,tr.getOnKeyUpCallback)(f),className:"sr-only",tabIndex:0,children:i("cart:orderBtn")})]})};var ts=e.i(371502),tl=e.i(913385);let tn=({cart:e})=>{let{ts:i}=(0,a.default)(),s=(0,ts.useIsAssistantEnabled)(),l=(0,J.useStaplesBasketPresence)(),n=(()=>{let{ts:e}=(0,a.default)(),{setIsCartVisible:t}=(0,ti.useCartVisibilityContext)();return(0,r.useCallback)(()=>{let r=e("assistant:fillCartWithAIMessage");window.dispatchEvent(new CustomEvent(tl.ASSISTANT_SEND_MESSAGE_EVENT,{detail:{message:r}})),t(!1)},[e,t,void 0])})(),{totalPrice:o=0,minimalStandardOrderPrice:c=0,minimalDeliveryPointOrderPrice:u=0,deliveryPointEnabled:m}=e??{},p=m?Math.min(c,u):c;return!s||o>=p||l?null:(0,t.jsxs)("button",{type:"button",onClick:n,"data-test":em.CART_DATA_TEST.fillWithAI,className:"flex w-full cursor-pointer items-center gap-200 rounded-medium border border-transparent bg-primary px-200 py-100 text-left shadow-[0_1px_2px_rgba(0,0,0,0.04),0_2px_6px_rgba(0,0,0,0.04)] transition-[border-color,box-shadow] hover:border-grey-30 hover:shadow-none",children:[(0,t.jsx)(e6.default.IconMaia,{width:24,height:24,color:"var(--color-icon-brand)","aria-hidden":"true",className:"shrink-0"}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-25",children:[(0,t.jsx)(d.BodyText,{as:"span",size:"s",semiBold:!0,children:i("cart:fillCartWithAI")}),(0,t.jsx)(d.BodyText,{as:"span",size:"xs",color:"secondary",children:i("cart:fillCartMinOrderHint")})]}),(0,t.jsx)(e$.ChevronRight,{size:24,"aria-hidden":"true",className:"shrink-0 text-brand"})]})};var to=e.i(720533),td=e.i(671638);let tc={CZK:20,EUR:1,HUF:300,RON:5},tu={CZK:10,EUR:.4,HUF:150,RON:2},tm=e=>{let t=/[\d\u00A0\u202F .,]+/.exec(e);if(!t)return null;let r=t[0].replace(/[\u00A0\u202F ]/g,""),i=Math.max(r.lastIndexOf("."),r.lastIndexOf(",")),a=Number.parseFloat(-1===i?r:`${r.slice(0,i).replace(/[.,]/g,"")}.${r.slice(i+1)}`);return Number.isFinite(a)&&a>0?a:null},tp=({children:e,attachedStrip:r})=>(0,t.jsx)("div",{className:(0,o.cn)("flex w-full items-center gap-200 rounded-medium border border-alpha-10 bg-[linear-gradient(118deg,#FFFDF8_18%,#FFEAB2_138%)] px-200 py-100",r&&"rounded-b-none"),children:e}),tg=()=>(0,t.jsx)(e6.default.IconSavingsPiggy,{width:24,height:24,color:"#E59B1C","aria-hidden":"true",className:"shrink-0"}),tx=({cart:e})=>{var r;let{ts:i}=(0,a.default)(),s=(0,eS.default)(),{currencyCode:l}=(0,N.useConfiguration)(),{routes:o,router:c}=(0,eX.useRouting)(),{setIsCartVisible:u}=(0,ti.useCartVisibilityContext)(),{xtraUser:p}=(0,$.default)(),g=Object.keys((null==e?void 0:e.items)??{}).map(Number),x=(0,td.useProductCardsInfos)({ids:g,categoryType:eh.CategoryType.Normal}),{totalPrice:h=0,totalSavings:f=0,premiumSavings:v}=e??{},y=f>=(tu[l]??.4)?f:0,b=Math.min(p?Object.values((null==e?void 0:e.items)??{}).reduce((e,t)=>
10{if((null==t?void 0:t.saleType)!==n.CartItemDTOSaleTypeEnum.Premium)return e;let r=t.originalPrice??0,i=t.price??0;return r>i?e+(r-i)*(t.quantity??1):e},0):0,y),C=Math.max(y-b,0),w=p?{amount:0,logoUrl:null}:((e,t)=>{let r={amount:0,logoUrl:null};if(!(null==e?void 0:e.items)||!(null==t?void 0:t.length))return r;let i=new Map(t.map(e=>[e.productId,e]));for(let t of Object.values(e.items)){var a,s;if(!(null==t?void 0:t.productId)||null==t.price)continue;let e=null==(s=i.get(t.productId))||null==(a=s.badges)?void 0:a.find(e=>e.position===eh.ProductCardBadgePosition.Price&&/xtra/i.test(e.trailingIcon??""));if(!e)continue;let l=tm(e.text);null==l||l>=t.price||(r.amount+=(t.price-l)*(t.quantity??1),r.logoUrl=r.logoUrl??e.trailingIcon??null)}return r})(e,x),T={amount:p?0:v??w.amount,logoUrl:w.logoUrl},j=T.amount>=(tc[l]??1)?T.amount:0;if(y<=0&&j<=0)return null;let S=(null==(r=o.xtra)?void 0:r.url())??"/",E=()=>(u(!1),c.push(S)),I=e=>(0,t.jsxs)(m.default,{to:S,onClick:E,"data-test":em.CART_DATA_TEST.savingsXtraUpsell,className:e?"flex w-full items-center gap-100 rounded-medium border border-brand-30 bg-brand-light-secondary px-200 py-150 text-grey-90 no-underline transition-colors hover:border-brand-light hover:bg-brand-light-muted":"flex w-full items-center gap-100 rounded-b-medium border border-brand-30 bg-brand-light-secondary px-200 py-100 text-grey-90 no-underline transition-colors hover:border-brand-light hover:bg-brand-light-muted",children:[T.logoUrl?(0,t.jsx)("img",{src:T.logoUrl,alt:"Xtra",className:"h-[14px] w-auto shrink-0"}):(0,t.jsx)("span",{"aria-hidden":"true",className:"shrink-0 font-extrabold text-brand",children:"â¦"}),(0,t.jsx)(d.BodyText,{as:"span",size:"s",semiBold:!0,className:"truncate text-grey-90",children:e?i("cart:xtraStripSolo",{amount:s.formatPriceWithFractionDigits(j,0)}):i("cart:xtraStripMore",{amount:s.formatPriceWithFractionDigits(j,0)})}),(0,t.jsx)(e$.ChevronRight,{size:24,"aria-hidden":"true",className:"ml-auto shrink-0 text-brand"})]});return y<=0?(0,t.jsx)(to.ForceTheme,{light:!0,"data-test":em.CART_DATA_TEST.savingsCard,children:I(!0)}):(0,t.jsxs)(to.ForceTheme,{light:!0,className:"flex w-full flex-col","data-test":em.CART_DATA_TEST.savingsCard,children:[(0,t.jsxs)(tp,{attachedStrip:j>0,children:[(0,t.jsx)(tg,{}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-col gap-25",children:[(0,t.jsx)(d.BodyText,{size:"s",semiBold:!0,className:"text-grey-90",children:i("cart:totalSavingsTitle")}),(0,t.jsx)(ex.Price,{price:y,currency:l,originalPrice:h+y,size:"s",saleStyle:{backgroundColor:"#FFE55A",textColor:"#1C2529"}})]}),C>0&&b>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"w-px shrink-0 self-stretch bg-alpha-10"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-50",children:[(0,t.jsxs)("span",{className:"flex items-baseline gap-50","data-test":em.CART_DATA_TEST.savingsOnSales,children:[(0,t.jsx)(ex.Price,{price:C,currency:l,size:"s",className:"shrink-0"}),(0,t.jsx)(d.BodyText,{as:"span",size:"xs",className:"!text-[12px] !leading-[20px] truncate text-grey-90",children:i("cart:savingsOnSales")})]}),(0,t.jsxs)("span",{className:"flex items-baseline gap-50","data-test":em.CART_DATA_TEST.savingsOnXtra,children:[(0,t.jsx)(ex.Price,{price:b,currency:l,size:"s",className:"shrink-0"}),(0,t.jsx)(d.BodyText,{as:"span",size:"xs",className:"!text-[12px] !leading-[20px] truncate text-grey-90",children:i("cart:savingsOnXtra")})]})]})]})]}),j>0&&I(!1)]})},th=({onRequestClear:e})=>{let{ts:r}=(0,a.default)();return(0,t.jsx)(D.Button,{variant:"secondaryNeutral",size:"s",icon:(0,t.jsx)(e6.default.IconTrashCan,{width:16,height:16,className:"text-[color:var(--color-icon-negative)]","aria-hidden":"true"}),onClick:e,isLoading:!1,"data-gtm-button":"clear-cart","data-test":em.CART_DATA_TEST.clearCartButton,children:r("cart:cartReview.removeAllItems")})},tf=({onUndo:e})=>{let{ts:r}=(0,a.default)();return(0,t.jsxs)("output",{"aria-live":"polite","data-test":em.CART_DATA_TEST.clearCartUndoBanner,className:"flex w-full items-center justify-between gap-100 border-grey-20 border-b bg-primary px-200 py-150",children:[(0,t.jsx)(d.BodyText,{as:"span",size:"s",semiBold:!0,children:r("cart:cartCleared")}),(0,t.jsx)(D.Button,{variant:"ghostPositive",size:"s",onClick:e,isLoading:!1,"data-test":em.CART_DATA_TEST.clearCartUndoButton,children:r("cart:undoRemove")})]})};var tv=e.i(342218),ty=e.i(641997),tb=e.i(934),tC=e.i(113531),tw=e.i(857567),tT=e.i(360458),tj=e.i(374208),tS=e.i(289076),tN=e.i(421785),tE=e.i(762509),tI=e.i(370645),tk=e.i(4104),t_=e.i(249707);let tA=()=>{let{t:e,ts:i}=(0,a.default)(),{user:s}=(0,$.default)(),{redirectToLoginAndBack:l}=(0,t_.default)(),n=(0,ep.useQueryClient)(),[o,c]=(0,r.useState)(null),{data:u,refetch:m}=(0,ed.useGetShoppingListFromCurrentCartQuery)(),{mutateAsync:p}=(0,tE.useShoppingListMutation)(),{cartChanged:g,shoppingListId:x,enabled:h}=u??{},f=(0,tk.joinBiSource)({touchpoint:en.GtmLocationName.cartReviewShoppingList,favorite:!1,id:void 0});return h?(0,t.jsxs)(t.Fragment,{children:[!x&&(0,t.jsx)(D.Button,{variant:"secondaryNeutral",size:"s",icon:(0,t.jsx)(tC.default,{}),onClick:()=>s?c("create"):l(),isLoading:!1,"data-test":em.CART_DATA_TEST.saveListButton,children:i("common:saveAsShoppingList")}),!!x&&!g&&(0,t.jsx)(D.Button,{isDisabled:!0,variant:"secondaryNeutral",size:"s",icon:(0,t.jsx)(tb.default,{color:"var(--color-icon-secondary)"}),"data-test":em.CART_DATA_TEST.saveListButton,children:i("shoppingLists:cartReview.listSaved")}),!!x&&!!g&&(0,t.jsx)(D.Button,{variant:"secondaryNeutral",size:"s",icon:(0,t.jsx)(tw.default,{height:20,width:20}),onClick:()=>p({name:void 0,source:f},{onSuccess:async()=>{x&&n.invalidateQueries({queryKey:(0,tI.getShoppingListByIdQueryKey)({id:x})}),await m()}}),isLoading:!1,"data-test":em.CART_DATA_TEST.saveListButton,children:i("shoppingLists:cartReview.updateList")}),(0,t.jsx)(tT.default,{"data-test":tN.ShoppingListDataTest.createNewListWrapper,hideModal:()=>c(null),open:"create"===o,"aria-label":i("shoppingLists:modal.title"),isInPortal:!0,children:(0,t.jsx)(tS.default,{handleClose:()=>c(null),handleCreateList:e=>p({name:e,source:f},{onSuccess:async()=>{c("success"),await m()}})})}),(0,t.jsx)(tj.default,{confirm:()=>c(null),confirmButtonLabel:e("shoppingLists:cartReview.confirmModal.button"),hideModal:()=>c(null),open:"success"===o,isInPortal:!0,showRejectButton:!1,text:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty.default,{backgroundColor:"var(--color-icon-brand)",className:"mb-300",size:"big",children:(0,t.jsx)(e6.default.IconSuccess,{color:"var(--color-icon-inverted)",height:24,width:24})}),(0,t.jsx)(tv.Title,{as:"h2",className:"mb-300",size:"m",children:e("shoppingLists:cartReview.confirmModal.title")}),(0,t.jsx)(d.BodyText,{children:e("shoppingLists:cartReview.confirmModal.text")})]})})]}):null};var tR=e.i(494450);let tP=({productIds:e,showTitle:r=!0,listInfo:i,initialSlide:s,isLoading:l,impressions:n,itemSpacing:o})=>{let{ts:d}=(0,a.default)();return(0,t.jsxs)(t.Fragment,{children:[r&&(0,t.jsx)(tv.Title,{as:"h4",className:"mt-100 ml-200",size:"xs",children:d("product:recommended.title")}),(0,t.jsx)(tR.ProductSliderNew,{disableBorder:!0,categoryType:eh.CategoryType.Normal,dataTest:em.NextBestOfferDataTests.nboUpsell,impressions:n,isLoading:l,listInfo:i,itemSpacing:o,productIds:e,sliderProps:{arrowsInside:!0,initialSlide:s},title:void 0,ariaLabel:d("product:recommended.title")})]})},tD=(0,e.i(205270).default)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);var tL=e.i(344643),tB=e.i(61983);let tM=()=>(0,t.jsxs)("svg",{width:"120",height:"100",viewBox:"0 0 120 100",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M46 34v-6c0-8.8 6.3-15 14-15s14 6.2 14 15v6",stroke:"var(--color-icon-brand)",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),(0,t.jsx)("path",{d:"M38.4 32h43.2c4.9 0 8.6 4.4 7.9 9.2l-5.4 37.6c-.8 5.9-5.9 10.2-11.8 10.2H47.7c-6 0-11-4.3-11.8-10.2l-5.4-37.6c-.7-4.8 3-9.2 7.9-9.2z",fill:"var(--color-icon-brand-50)"}),(0,t.jsx)("circle",{cx:"50",cy:"55",r:"3.2",fill:"var(--color-icon-brand-90)"}),(0,t.jsx)("circle",{cx:"70",cy:"55",r:"3.2",fill:"var(--color-icon-brand-90)"}),(0,t.jsx)("path",{d:"M49 66c3.2 3.8 7 5.7 11 5.7s7.8-1.9 11-5.7",stroke:"var(--color-icon-brand-90)",strokeWidth:"3.5",strokeLinecap:"round",fill:"none"}),(0,t.jsx)("path",{d:"M92 22l5-8M99 31l9-3.5",stroke:"#F0C33C",strokeWidth:"3.5",strokeLinecap:"round"})]}),tF=({cart:e})=>{var i;let{ts:s}=(0,a.default)(),{routes:l,router:n}=(0,eX.useRouting)(),{setIsCartVisible:c}=(0,ti.useCartVisibilityContext)(),{address:u,deliveryPoint:p}=(0,tL.useDeliveryInfo)(),g=(0,tB.useOpenDeliveryOrAddressModal)(),x=(null==(i=l.sales)?void 0:i.url())??"/",h=!!(null==u?void 0:u.id)||!!(null==p?void 0:p.id),f=e=>(c(!1),n.push(e)),[v,y]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=requestAnimationFrame(()=>y(!0));return()=>cancelAnimationFrame(e)},[]),(0,t.jsxs)("div",{className:(0,o.cn)("flex min-h-0 flex-1 flex-col gap-150 p-150","transition-[opacity,transform] duration-300 ease-out motion-reduce:transition-none",v?"translate-y-0 opacity-100":"translate-y-[6px] opacity-0"),"data-test":em.CART_DATA_TEST.emptyCartWrapper,children:[(0,t.jsx)(tn,{cart:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-100 px-300 text-center",children:[(0,t.jsx)(tM,{}),(0,t.jsx)(tv.Title,{as:"h3",size:"xs",className:"mt-100",children:s("cart:emptyDrawerTitle")}),(0,t.jsx)(d.BodyText,{size:"s",color:"secondary",className:"max-w-[30ch]",children:s("cart:emptyDrawerText")}),(0,t.jsx)(D.Button,{variant:"primary",size:"l",isFullWidth:!0,className:"mt-200",icon:(0,t.jsx)(e$.ChevronRight,{"aria-hidden":"true"}),iconPosition:"after",onClick:()=>f("/"),isLoading:!1,children:(0,t.jsx)("span",{className:"font-semibold",children:s("cart:emptyDrawerCta")})}),(0,t.jsxs)(m.default,{to:x,onClick:()=>f(x),className:"mt-150 inline-flex items-center gap-25 font-semibold text-90 text-brand no-underline hover:underline",children:[s("cart:emptyDrawerSalesLink"),(0,t.jsx)(e$.ChevronRight,{size:16,"aria-hidden":"true"})]})]}),!h&&(0,t.jsxs)("button",{type:"button",onClick:e=>{c(!1),g(e)},className:"flex w-full cursor-pointer items-center gap-150 rounded-medium border border-transparent bg-primary px-200 py-150 text-left shadow-[0_1px_2px_rgba(0,0,0,0.04),0_2px_6px_rgba(0,0,0,0.04)] transition-colors hover:border-grey-30",children:[(0,t.jsx)(tD,{size:24,"aria-hidden":"true",className:"shrink-0 text-brand"}),(0,t.jsx)(d.BodyText,{as:"span",size:"s",semiBold:!0,className:"flex-1",children:s("cart:emptyDrawerAddressHint")}),(0,t.jsx)(e$.ChevronRight,{size:24,"aria-hidden":"true",className:"shrink-0 text-brand"})]})]})};var tO=e.i(170583);let tU=(e,t)=>Array.from(new Set([...e??[],...t??[]]));var tz=e.i(576983),tQ=e.i(581040);let tH=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("flex h-full min-h-0 w-full flex-col","shadow-[0_8px_32px_rgba(0,0,0,0.2)]",e),...i,children:r})),tK=(0,r.forwardRef)(({className:e,children:r,...i},a)=>(0,t.jsx)("div",{ref:a,className:(0,o.cn)("relative flex min-h-0 flex-1","flex-col items-stretch overflow-hidden","bg-secondary",e),...i,children:r})),tW=({visible:e,upsellRef:r,upsellIndex:i,isLoading:a,productIds:s,impressions:l})=>e?(0,t.jsx)("div",{className:"pt-100",ref:r,children:(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.product],children:(0,t.jsx)(tP,{itemSpacing:8,initialSlide:i,isLoading:a,listInfo:{listName:el.GtmLocationFactory.cartReviewNBO(),source:{touchpoint:en.GtmLocationName.CartReviewNBO,id:void 0}},productIds:s,impressions:l})})}):null,tG=({isOpen:e})=>{var i;let{byId:s}=(0,ei.useCompaniesContext)(),{setIsCartVisible:l}=(0,ti.useCartVisibilityContext)(),{cart:n}=(0,tz.default)(),{isPendingClear:o,requestClear:d,undoClear:c}=(()=>{let{mutate:e}=(0,tO.useClearCartMutation)(),[t,i]=(0,r.useState)(!1),a=(0,r.useRef)(void 0),s=(0,r.useRef)(!1),l=(0,r.useRef)(e);l.current=e;let n=(0,r.useCallback)(()=>{s.current&&(s.current=!1,i(!1),l.current())},[]),o=(0,r.useCallback)(()=>{s.current||(s.current=!0,i(!0),a.current=setTimeout(n,4e3))},[n]),d=(0,r.useCallback)(()=>{a.current&&clearTimeout(a.current),s.current=!1,i(!1)},[]);return(0,r.useEffect)(()=>()=>{a.current&&clearTimeout(a.current),s.current&&(s.current=!1,l.current())},[]),{isPendingClear:t,requestClear:o,undoClear:d}})(),{cartWithPendingRemovals:u,startPendingRemoval:m,endPendingRemoval:p}=(e=>{let[t,i]=(0,r.useState)(null),a=(0,r.useMemo)(()=>e&&t?((e,{productIds:t,snapshot:r})=>{var i,a;let s=t.filter(t=>{var i,a;return!(null==(i=e.items)?void 0:i[t])&&(null==(a=r.items)?void 0:a[t])});if(!s.length)return e;let l={...e.items};for(let e of s)l[e]=null==(i=r.items)?void 0:i[e];let n={...e.categories},o=[];for(let[e,t]of Object.entries(r.categories??{})){if(!(null==t||null==(a=t.items)?void 0:a.some(e=>s.includes(e))))continue;o.push(Number(e));let r=n[e];n[e]=r?{...r,items:tU(t.items,r.items)}:t}let d=[...e.companies??[]];for(let e of r.companies??[]){let t=(e.categories??[]).filter(e=>o.includes(e));if(!t.length)continue;let r=d.findIndex(t=>t.id===e.id);if(-1===r){d.push({...e,categories:t});continue}let i=d[r],a=(e.categories??[]).filter(e=>{var r;return t.includes(e)||(null==(r=i.categories)?void 0:r.includes(e))});d[r]={...i,categories:tU(a,i.categories)}}return{...e,items:l,categories:n,companies:d}})(e,t):e,[e,t]),s=(0,r.useCallback)(e=>{a&&i(t=>({productIds:tU(null==t?void 0:t.productIds,[e]),snapshot:a}))},[a]);return{cartWithPendingRemovals:a,startPendingRemoval:s,endPendingRemoval:(0,r.useCallback)(e=>{i(t=>{let r=(null==t?void 0:t.productIds.filter(t=>t!==e))??[];return t&&r.length?{...t,productIds:r}:null})},[])}})(n),{ts:g}=(0,a.default)(),{inDrugstore:x}=(0,tQ.default)(),{data:h}=(0,ed.useGetShoppingListFromCurrentCartQuery)(),f=!!(null==h?void 0:h.enabled),[v,y]=(0,r.useState)(!1),[b,C]=(0,r.useState)(0),{data:w}=(0,et.useCartNextBestOfferQuery)(!x),{data:T,isLoading:j}=(0,er.useProductsQuery)({productIds:(null==w?void 0:w.productIds)||[]}),S=eD(n,s),N=!!(null==w?void 0:w.productIds.length)&&!x,E=(0,r.useRef)(void 0),I=(0,r.useRef)(null),k=(0,r.useRef)(null),_=(0,r.useRef)(null),A=(0,r.useRef)(null),R=!!(null==T||null==(i=T.products)?void 0:i.length)&&!x,P=0===Object.keys((null==u?void 0:u.items)??{}).length;(0,r.useEffect)(()=>
10{if(e){var t;null==(t=A.current)||t.focus({preventScroll:!0})}},[e]);let D=P||o,L=D&&n?{...n,items:{},totalPrice:0}:n,B=()=>{l(!1),es.default.restoreFocus()},M=(0,t.jsx)(e4,{cart:n,handleHideCart:B,showUpsellTeaser:R&&!v,showOrderButton:!!S.length,upsellProducts:(null==T?void 0:T.products)??[],handleScrollToUpsell:e=>{var t;return t=e,void(y(!0),C(t),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{(0,ee.default)(_.current,{element:k.current})},50))},ref:I});return(0,t.jsx)(ea.Sidebar,{onClickOutside:B,position:"right",size:"cartDrawer",isOpen:e,children:(0,t.jsxs)(tH,{"aria-label":g("cart:title"),"data-test":em.CART_DATA_TEST.cartWrapper,ref:A,children:[(0,t.jsx)(ta,{cart:L,handleHideCart:B}),(0,t.jsxs)(tK,{children:[o&&(0,t.jsx)(tf,{onUndo:c}),D?(0,t.jsx)(tF,{cart:L}):(0,t.jsx)(eY,{cart:u,handleOpenUpsell:e=>y(e),onPendingRemovalStart:m,onPendingRemovalEnd:p,ref:k,topContent:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tx,{cart:n}),(0,t.jsx)(tn,{cart:n})]}),bottomContent:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-100 py-100",children:[(0,t.jsx)(th,{onRequestClear:d}),f&&(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.shoppingLists],children:(0,t.jsx)(tA,{})})]}),stickyFooter:M,children:(0,t.jsx)(tW,{visible:N,upsellRef:_,upsellIndex:b,isLoading:j,productIds:(null==w?void 0:w.productIds)||[],impressions:(null==w?void 0:w.impressions)||[]})})]})]})})},tq=()=>{let{isCartVisible:e}=(0,ti.useCartVisibilityContext)(),i=(e=>{let[t,i]=(0,r.useState)(e);return(0,r.useEffect)(()=>{if(e)return void i(!0);let t=window.setTimeout(()=>i(!1),300);return()=>window.clearTimeout(t)},[300,e]),t})(e);return(0,t.jsx)(J.StaplesBasketProvider,{children:i&&(0,t.jsx)(tG,{isOpen:e})})},tV="/images/premium/confetti.svg";var tY=e.i(685619);let t$=({data:e})=>(0,t.jsx)("div",{className:"my-200",children:(0,t.jsx)(tY.ListWithIcons,{iconHeight:24,iconWidth:24,info:e,textSize:"xs",type:"primary"})}),tX=({reward:e,background:r,textSize:i="m",...a})=>(0,t.jsxs)("div",{className:(0,o.cn)(["flex items-center rounded-medium text-left","mb-200 p-100 px-200","md:mb-0 md:px-400"]),style:{background:r},...a,children:[(0,t.jsx)(e6.default.IconGitftColored,{className:"mr-200",height:64,width:64}),(0,t.jsx)(d.BodyText,{htmlContent:e,size:i})]}),tZ=({reward:e})=>(0,t.jsx)(tX,{background:"var(--grey-20)",className:"mb-200 sm:mb-0",reward:e,textSize:"s"}),tJ=({text:e})=>(0,t.jsx)(d.BodyText,{className:"mt-100 mb-200 text-center",htmlContent:e,size:"s"}),t0=({content:e,disclaimer:r})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mb-200 flex items-center justify-center rounded-medium bg-brand-light-tertiary px-200 py-100 text-center md:mb-0 md:px-400",children:(0,t.jsx)(d.BodyText,{className:"text-center",htmlContent:e,size:"s"})}),r&&(0,t.jsx)(d.BodyText,{className:"mt-100 text-center",htmlContent:r,size:"xs"})]});var t1=e.i(734896);let t2=({orders:e,ordersNeeded:r,expiration:i})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-end justify-between",children:[[...Array(r)].map((r,i)=>i+1<=e?(0,t.jsx)(ty.Circle,{backgroundColor:"var(--grey-0)",borderColor:"var(--yellow-60)",size:"bigger",children:(0,t.jsx)(e6.default.IconBagWithCheck,{height:34,width:28})},i):(0,t.jsx)(ty.Circle,{backgroundColor:(0,t1.default)("var(--background-color-primary)",75),size:"bigger",children:(0,t.jsx)(e6.default.IconBagEmpty,{color:"var(--yellow-50)",height:32,width:32})},i)),(0,t.jsx)(e6.default.IconGitftColored,{color:"var(--green-50)",height:60,width:60})]}),(0,t.jsx)(f.Caption,{className:"mt-200 text-center",htmlContent:i})]});var t5=e.i(281476),t3=e.i(190194),t8=e.i(184365);let t4=({content:e,closeBottomSheet:r,buttonLabel:i,buttonUrl:a,bottomSheetType:s})=>{let l,{router:n}=(0,eX.useRouting)(),o=(0,t3.useAnalyticsXtraEvents)(),{setEventToStorage:d}=(0,t5.useGtmContext)();return(0,t.jsxs)(t.Fragment,{children:["benefits"in e&&(0,t.jsx)(t$,{data:e.benefits}),"reward"in e&&(0,t.jsx)(tZ,{reward:e.reward}),"text"in e&&(0,t.jsx)(tJ,{text:e.text}),"loyaltyReward"in e&&(0,t.jsx)(t0,{content:e.loyaltyReward,disclaimer:e.disclaimer}),"ordersNeeded"in(l=e)&&"orders"in l&&"expiration"in l&&(0,t.jsx)(t2,{expiration:e.expiration,orders:e.orders,ordersNeeded:e.ordersNeeded}),i&&(0,t.jsx)("div",{className:"u-flex-center mt-200",children:(0,t.jsx)(E.default,{fullWidth:!0,onClick:()=>{o.premiumBottomSheetClicked(s),a&&d("xtraInitialClickInfo",{location:en.GtmLocationName.BottomSheet,type:t8.GtmXtraPromotionType.BottomSheet}),r(),a&&n.push(a)},type:"primary",children:i})})]})};var t9=e.i(168489),t6=e.i(896340),t7=e.i(566059),re=e.i(573700);let rt=({id:e,label:r,icon:i,isActive:a,disabled:s=!1,onClick:l,badge:n,dataTest:d})=>(0,t.jsxs)("button",{type:"button",onClick:()=>{s||l()},disabled:s,"data-test":d,"aria-label":r,"aria-current":a?"page":void 0,className:(0,o.cn)(["flex flex-1 flex-col items-center justify-center","bg-transparent p-0","transition-colors duration-200","relative min-h-0 min-w-0","disabled:cursor-default disabled:opacity-100"]),children:[(0,t.jsxs)("div",{className:"relative flex h-[24px] w-[24px] shrink-0 items-center justify-center",children:[(0,t.jsx)("div",{className:(0,o.cn)(["flex items-center justify-center",a&&"text-brand",!a&&"text-grey-70"]),children:i}),n&&(0,t.jsx)("div",{"data-test":`${d}-badge`,className:(0,o.cn)(["-right-50 -top-25 absolute","flex h-200 min-w-[16px] items-center justify-center","rounded-full bg-brand px-50","font-bold text-[10px] text-inverted leading-none"]),"aria-label":`${n} items in cart`,children:n})]}),(0,t.jsx)("span",{className:(0,o.cn)(["whitespace-nowrap text-[10px] leading-[20px]",a&&"font-bold text-brand",!a&&"font-medium text-grey-70"]),children:r})]});var rr=e.i(974208);let ri=rr.Z_INDEX_CLASSES.BOTTOM_NAVIGATION;var ra=e.i(736556);let rs=({isOpen:e,enabled:t=!0})=>{let{enableScroll:i,disableScroll:a}=(0,ra.useScrollLock)();(0,r.useEffect)(()=>
10{if(t)return e?a():i(),()=>{i()}},[e,t,a,i])};var rl=e.i(672998),rn=e.i(877587),ro=e.i(56887),rd=e.i(756205),rc=e.i(362639),ru=e.i(487498),rm=e.i(625691);let rp=({variant:e,query:r,isWhispererVisible:i,isFetching:s,showClearButton:l,inputRef:n,searchRef:o,onFocus:d,onChange:c,onBlur:u,onClear:m,onSubmit:p})=>{let{ts:g}=(0,a.default)(),x="desktop"===e?"h-[40px]":"h-500";return(0,t.jsxs)("form",{className:"desktop"===e?"flex w-full max-w-[760px] sm:relative md:px-200":"flex w-full",noValidate:!0,"aria-label":g("common:aria.searchText"),"data-test":rn.SearchDataTests.searchForm,action:"/","data-gtm-form":"search-form",[rn.SEARCH_FORM_IDENTIFIER]:!0,id:"desktop"===e?"searchForm":void 0,role:"search",ref:o,onSubmit:e=>{e.preventDefault(),p(e)},children:[(0,t.jsxs)("div",{className:"desktop"===e?"relative flex w-full":"relative flex flex-1",children:[(0,t.jsx)("input",{className:`${x} w-full rounded-r-none rounded-l-medium border border-primary border-r-0 px-100 pr-[40px] placeholder:text-grey-60 focus:border-[2px] focus:border-brand`,...ro.GRAMMARLY_DISABLE_PROPS,"data-lokalise":!0,type:"text",role:"combobox","aria-controls":rd.WHISPERER_ID.wrapper,"aria-expanded":i,"aria-haspopup":"listbox","aria-autocomplete":"list",autoComplete:"off","data-key":"header.search.placeholder",id:"desktop"===e?"searchGlobal":void 0,placeholder:g("common:header.search.placeholder"),onFocus:d,onChange:c,onBlur:u,ref:n,value:r,"data-test":rn.SearchDataTests.searchInput}),s&&(0,t.jsx)("div",{className:`pointer-events-none absolute right-0 m-0 flex ${x} w-[40px] items-center justify-center rounded-0 bg-transparent p-0`,role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,children:(0,t.jsx)(rm.default,{height:26,width:26})}),l&&(0,t.jsx)("button",{className:`absolute right-0 m-0 flex ${x} w-[40px] items-center justify-center rounded-0 bg-transparent p-0 leading-none hover:bg-transparent`,type:"reset",onClick:m,tabIndex:0,"aria-label":g("common:aria.deletedSearchedText"),children:(0,t.jsx)(ty.default,{backgroundColor:"var(--grey-60)",size:"tiny",children:(0,t.jsx)(rc.default,{color:"var(--color-icon-inverted)",width:12,height:12})})})]}),(0,t.jsx)("button",{className:`flex ${x} ${"desktop"===e?"w-[40px] lg:w-[80px]":"w-[40px]"} items-center justify-center rounded-r-medium rounded-l-none bg-brand-new leading-[40px] hover:bg-brand-new-dark active:bg-brand-new-light`,"data-test":rn.SearchDataTests.searchButton,"aria-label":g("ui:search.button"),type:"submit",onClick:e=>{e.preventDefault(),p(e)},children:(0,t.jsx)("span",{className:"flex items-center justify-center",children:(0,t.jsx)(ru.default,{className:"icon",color:"var(--color-icon-inverted)",width:24,height:24})})})]})};e.s(["SearchInput",0,rp],480986);var rg=e.i(56928),rx=e.i(995161);let rh=({children:e,onClose:i,searchInput:s})=>{let{ts:l}=(0,a.default)(),{companyId:n}=(0,eL.useGlobalState)(),{router:o}=(0,eX.useRouting)(),{getSearchUrl:d}=(0,rg.default)(),c=(0,r.useRef)(i),u=(0,r.useRef)(!1);return rs({isOpen:!0}),(0,r.useEffect)(()=>{c.current=i},[i]),(0,r.useEffect)(()=>{let e=s.input.current;if(!e||document.activeElement===e)return;if((0,rx.isIOS)()){e.focus();let t=e.value.length;e.setSelectionRange(t,t);return}let t=setTimeout(()=>{e.focus()},50);return()=>{clearTimeout(t)}},[s.input]),(0,r.useEffect)(()=>{let e=e=>{e.code===rl.Keys.ESC&&(e.preventDefault(),u.current=!0,c.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),(0,r.useEffect)(()=>{u.current=!1,window.history.pushState({mobileSearchOverlay:!0},"");let e=e=>{var t;null!=(t=e.state)&&t.mobileSearchOverlay||(e.preventDefault(),c.current())};return window.addEventListener("popstate",e),()=>{var t;window.removeEventListener("popstate",e),u.current&&(null==(t=window.history.state)?void 0:t.mobileSearchOverlay)&&window.history.back()}},[]),(0,t.jsxs)("div",{className:`fixed inset-0 ${rr.Z_INDEX_CLASSES.MOBILE_SEARCH_OVERLAY} flex w-screen flex-col bg-grey-0`,role:"dialog","aria-modal":"true","aria-label":l("common:header.search.closeSearch"),"data-ignore-outside-click":"true",onMouseDown:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation()},children:[(0,t.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-100 bg-grey-20 px-200 py-100",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(rp,{variant:"mobile",query:s.query,isWhispererVisible:s.isWhispererVisible,isFetching:s.isWhispererFetching,showClearButton:s.isClearButtonVisible,inputRef:s.input,searchRef:s.searchRef,onFocus:s.handleFocus,onChange:s.handleChange,onBlur:s.handleBlur,onClear:s.handleClearSearchBox,onSubmit:e=>{if(e.preventDefault(),!s.query||null==n)return void s.clearSearchBox();let t=s.query;i();let r=d(t,n);o.push(r)}})}),(0,t.jsxs)("button",{type:"button",onClick:()=>{u.current=!0,i()},className:"flex h-[40px] w-[40px] shrink-0 flex-col items-center justify-center bg-transparent p-0 pb-[2px]","aria-label":l("common:header.search.closeSearch"),children:[(0,t.jsx)(e6.default.IconCloseX,{color:"var(--color-icon-primary)",width:24,height:24}),(0,t.jsx)("span",{className:"font-bold text-[8.5px] text-grey-90 leading-normal",children:l("common:close")})]})]}),(0,t.jsx)("div",{className:"flex flex-1 flex-col overflow-y-auto bg-grey-0",children:e})]})};e.s(["MobileSearchOverlay",0,rh],543062);var rf=e.i(377819),rv=e.i(825470),ry=e.i(554207),rb=e.i(861059);let rC={autocomplete:{categories:[],companies:[],productIds:[],recipes:[],searchQuery:"",showAllLink:"",totalCategoryHits:0,totalHits:0,totalRecipeHits:0,suggestions:[],impressions:[],banners:[]},products:[],infoboxes:[]},rw={...rC.autocomplete,productIds:[1,2,3],searchQuery:"searchQuery",totalHits:3};eh.CorrectionType.Correction,n.HttpSearchItemType.Category;let rT=(e={})=>{let{isMobileOverlay:t=!1,shouldShowMobileOverlay:i=!1,navigationTabOpen:a=!1}=e,{companyId:s,setCompanyId:l}=(0,eL.useGlobalState)(),{isMobileViewHeader:n}=(0,re.useUIContext)(),o=(0,r.useRef)(null),d=(0,r.useRef)(null),c=(0,r.useRef)(void 0),{query:u,setQuery:m,isWhispererVisible:p,setIsWhispererVisible:g,isQueryEmpty:x}=(()=>{let[e,t]=(0,r.useState)(""),[i,a]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>""===e,[e]);return{query:e,setQuery:t,isWhispererVisible:i,setIsWhispererVisible:a,isQueryEmpty:s}})(),h=(({query:e,companyId:t})=>{let r=(0,rb.useDebouncedValue)(e,300),i=""===e,{data:a,isLoading:s,isFetching:l}=(0,rf.useWhispererQuery)({query:r,companyId:t}),{data:n,isLoading:o}=(0,rv.useRecommendedWhispererQuery)(),{autocomplete:d,products:c,infoboxes:u}=i?n??{}:a??rC,{categories:m,companies:p,recipes:g,totalHits:x=0,totalRecipeHits:h=0,source:f,suggestions:v,noResults:y,fuzzy:b,correction:C,differentiatedAssortments:w,banners:T}=d??{};return{categories:m,companies:p,recipes:g,totalHits:x,totalRecipeHits:h,source:f,suggestions:v,noResults:y,fuzzy:b,correction:C,differentiatedAssortments:w,banners:T,productsWithPricing:(0,ry.usePre
10calculateCategoryProducts)(c)??[],infoboxes:u,isLoading:s||o,isFetching:l,isWhispererLoading:s,isRecommendedLoading:o}})({query:u,companyId:s}),f=n&&p||!!u.length,v=(0,r.useCallback)((e,t)=>{l(t),m(e)},[l,m]),y=(0,r.useCallback)(()=>{v("",s??void 0),g(!0)},[v,s,g]),b=(0,r.useCallback)(()=>{c.current&&(clearTimeout(c.current),c.current=void 0)},[]),C=(0,r.useCallback)(e=>{var t;let r=e??(null==(t=o.current)?void 0:t.value);b(),s&&r&&r.length>=rf.MIN_WHISPERER_QUERY_LENGTH?c.current=setTimeout(()=>{document.activeElement===o.current&&(g(!0),v(r,s))},300):i&&p||g(!1)},[s,i,p,v,g,b]),w=(0,r.useCallback)(()=>{v("",s??void 0),m(""),n&&g(!1)},[v,s,m,n,g]),T=(({inputRef:e,setIsWhispererVisible:t,setQuery:i,evaluateRecommendedWhisperer:a,evaluateWhisperer:s,clearSearchBox:l,cancelWhispererTimer:n,query:o="",isMobileViewHeader:d})=>{let{router:c}=(0,eX.useRouting)(),{getSearchUrl:u}=(0,rg.default)(),{inDrugstore:m}=(0,tQ.default)(),{companyId:p,setCompanyId:g}=(0,eL.useGlobalState)(),{isMobileViewHeader:x}=(0,re.useUIContext)(),h=(0,ei.useCompaniesContext)(),f=d??x,v=(0,r.useRef)(""),y=(0,r.useRef)(void 0),b=(0,r.useCallback)((e,t)=>{g(t),i(e)},[g,i]),C=(0,r.useCallback)(()=>{l?l():(b("",p??void 0),i(""),f&&t(!1))},[l,b,p,i,f,t]),w=(0,r.useCallback)(()=>{var r;C(),e.current&&(e.current.value=""),null==(r=e.current)||r.focus(),f&&t(!1)},[C,e,f,t]),T=(0,r.useCallback)(()=>{var t;if(v.current=document.documentElement.style.scrollPaddingTop,document.documentElement.style.scrollPaddingTop="0",(null==(t=e.current)?void 0:t.value)!==""||m?s():a(),(0,rx.isTouchOnly)()){let t=e.current;if(t){let e=t.value.length;setTimeout(()=>t.setSelectionRange(e,e),0)}}else setTimeout(()=>{var t;return null==(t=e.current)?void 0:t.select()},0)},[e,m,a,s]),j=(0,r.useCallback)(e=>{let t=e.target.value;if(i(t??""),""===t&&!m){var r;b("",p??(null==(r=h.mainCompany)?void 0:r.id)),a();return}s(t)},[i,m,b,p,h,a,s]);return{handleFocus:T,handleChange:j,handleBlur:(0,r.useCallback)(()=>{var t;document.documentElement.style.scrollPaddingTop=v.current,y.current&&clearTimeout(y.current),null==(t=e.current)||t.blur()},[e]),handleClearSearchBox:w,handleSubmitSearch:(0,r.useCallback)((r,a)=>s=>{var l,d;s.preventDefault(),null==n||n();let m=r??p??(null==(l=h.mainCompany)?void 0:l.id);if(o&&null!=m){let r=a??u(o,m);c.push(r),i(""),t(!1),null==(d=e.current)||d.blur();return}C()},[o,p,h,u,c,i,t,e,C,n]),clearSearchBox:C}})({inputRef:o,setIsWhispererVisible:g,setQuery:m,evaluateRecommendedWhisperer:y,evaluateWhisperer:C,clearSearchBox:w,cancelWhispererTimer:b,query:u,isMobileViewHeader:n});return(({inputRef:e,isWhispererVisible:t,setIsWhispererVisible:i,handleFocus:a,isMobileOverlay:s})=>{let l=(0,r.useCallback)(r=>{var a,l;if(!s){if(r.code===rl.Keys.ESC&&t){r.preventDefault(),i(!1),null==(a=e.current)||a.blur();return}"KeyK"===r.code&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),null==(l=e.current)||l.focus())}},[s,t,i,e]);(0,r.useEffect)(()=>{if(!s)return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[l,s])})({inputRef:o,isWhispererVisible:p,setIsWhispererVisible:g,handleFocus:T.handleFocus,isMobileOverlay:t}),rs({isOpen:p&&!i,enabled:!t}),(0,r.useEffect)(()=>{!t&&a&&o.current&&(g(!1),o.current.blur())},[a,t,g]),(0,r.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]),{query:u,isWhispererVisible:p,setIsWhispererVisible:g,input:o,searchRef:d,...T,setQuery:m,whispererData:h,isWhispererLoading:h.isWhispererLoading,isWhispererFetching:h.isFetching,recommendedData:h,isRecommendedLoading:h.isRecommendedLoading,productsWithPricing:h.productsWithPricing,isQueryEmpty:x,isClearButtonVisible:f,categories:h.categories,companies:h.companies,recipes:h.recipes,totalHits:h.totalHits,totalRecipeHits:h.totalRecipeHits,source:h.source,suggestions:h.suggestions,noResults:h.noResults,fuzzy:h.fuzzy,correction:h.correction,differentiatedAssortments:h.differentiatedAssortments,banners:h.banners,infoboxes:h.infoboxes}};e.s(["useSearchInput",0,rT],535792);var rj=e.i(489944);let rS=({setNavigationTabOpen:e,setIsMobileSearchOpen:t,mobileSearchInput:i})=>{let a=(0,r.useCallback)(()=>{e(eh.NavigationTabComponentTypeEnum.Category)},[e]);return{handleOpenMobileSidebar:a,handleCloseMobileSidebar:(0,r.useCallback)(()=>{e(null)},[e]),handleCloseMobileSearchOverlay:(0,r.useCallback)(()=>
10{i&&(i.setIsWhispererVisible(!1),i.clearSearchBox()),t(!1)},[i,t])}};e.s(["useMobileSidebarHandlers",0,rS],752837);let rN=(0,t9.default)(()=>(0,t6.retryImport)(()=>e.A(906587)),{loadableGenerated:{modules:[486272]}}),rE=()=>{var e;let{ts:i}=(0,a.default)(),{router:s,routes:l}=(0,eX.useRouting)(),n=(0,t7.useIsMobileRedesign)(),{navigationTabOpen:d,setNavigationTabOpen:c,isMobileSearchOpen:u,setIsMobileSearchOpen:m,isOverlaySidebarOpen:p}=(0,re.useUIContext)(),{cart:g}=(0,tz.default)(),{user:x}=(0,$.default)(),h=null!==d;rs({isOpen:h});let f=rT({isMobileOverlay:!0,shouldShowMobileOverlay:u}),v=(({pathname:e,isMobileSearchOpen:t,navigationTabOpen:i,indexUrl:a})=>(0,r.useMemo)(()=>{let r=t||null!==i,s=!t&&null!==i,l=!t&&!i&&e===a,n=!t&&!i&&(null==e?void 0:e.startsWith("/favorites")),o=!t&&!i&&((null==e?void 0:e.includes("/cart-review"))||(null==e?void 0:e.includes("/cart"))),d=e===a&&!r,c=i===eh.NavigationTabComponentTypeEnum.Category;return{isSearchActive:t,isCategoriesActive:s,isHomeActive:l,isFavoritesActive:n,isCartActive:o,isHomeDisabled:d,isCategoriesDisabled:c,isSearchDisabled:t,isFavoritesDisabled:(null==e?void 0:e.startsWith("/favorites"))&&!r,isCartDisabled:((null==e?void 0:e.includes("/cart-review"))||(null==e?void 0:e.includes("/cart")))&&!r,hasOverlayOpen:r}},[e,t,i,a]))({pathname:s.pathname,isMobileSearchOpen:u,navigationTabOpen:d,indexUrl:l.index.url()}),y=(({router:e,routes:t,setNavigationTabOpen:i,setIsMobileSearchOpen:a,isCategoriesDisabled:s,isSearchDisabled:l})=>{let n=(0,r.useCallback)(()=>{i(null),a(!1)},[i,a]),o=(0,r.useCallback)(()=>{n(),e.pathname!==t.index.url()&&e.push(t.index.url())},[n,e,t]),d=(0,r.useCallback)(()=>{s||(a(!1),i(eh.NavigationTabComponentTypeEnum.Category))},[s,a,i]),c=(0,r.useCallback)(()=>{l||(i(null),a(!0))},[l,i,a]);return{handleHomeClick:o,handleCategoriesClick:d,handleSearchClick:c,handleFavoritesClick:(0,r.useCallback)(()=>{var r;n(),(null==(r=e.pathname)?void 0:r.startsWith("/favorites"))||e.push(t.favorites.url())},[n,e,t]),handleCartClick:(0,r.useCallback)(()=>{var r,i;n(),(null==(r=e.pathname)?void 0:r.includes("/cart-review"))||(null==(i=e.pathname)?void 0:i.includes("/cart"))||e.push(t.cartReview.url())},[n,e,t])}})({router:s,routes:l,setNavigationTabOpen:c,setIsMobileSearchOpen:m,isCategoriesDisabled:v.isCategoriesDisabled,isSearchDisabled:v.isSearchDisabled}),{handleCloseMobileSidebar:b,handleCloseMobileSearchOverlay:C}=rS({setNavigationTabOpen:c,setIsMobileSearchOpen:m,mobileSearchInput:f});if(!n||p)return null;let w=Object.keys((null==g?void 0:g.items)??{}).length,T=0===w?null:w>9?"9+":String(w);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-ignore-outside-click":"true",className:(0,o.cn)(["fixed right-0 bottom-200 left-0",ri,"px-100"]),children:(0,t.jsxs)("nav",{"data-test":"bottom-navigation-wrapper","aria-label":i("common:aria.mobileNavigation"),className:(0,o.cn)(["flex items-center gap-100","p-150","rounded-[16px]","border border-grey-30 border-solid","backdrop-blur-[4px]","bg-[linear-gradient(90deg,rgba(242,242,242,0.08)_0%,rgba(242,242,242,0.08)_100%),linear-gradient(90deg,rgba(242,242,242,0.9)_0%,rgba(242,242,242,0.9)_100%)]","dark:bg-[linear-gradient(0deg,rgba(0,5,5,0.3)_0%,rgba(0,5,5,0.3)_100%),linear-gradient(0deg,rgba(28,37,41,0.9)_0%,rgba(28,37,41,0.9)_100%)]"]),children:[(0,t.jsx)(rt,{id:"home",label:i("common:navigation.home"),icon:v.isHomeActive?(0,t.jsx)(e6.default.IconHomeFilled,{color:"currentColor",width:24,height:24}):(0,t.jsx)(e6.default.IconHome,{color:"currentColor",width:24,height:24}),isActive:v.isHomeActive,disabled:v.isHomeDisabled,onClick:y.handleHomeClick,dataTest:"bottom-nav-home"}),(0,t.jsx)(rt,{id:"categories",label:i("common:navigation.categories"),icon:v.isCategoriesActive?(0,t.jsx)(e6.default.IconGridFilledNew,{color:"currentColor",width:24,height:24}):(0,t.jsx)(e6.default.IconGridNew,{color:"currentColor",width:24,height:24}),isActive:v.isCategoriesActive,disabled:v.isCategoriesDisabled,onClick:y.handleCategoriesClick,dataTest:"bottom-nav-categories"}),(0,t.jsx)(rt,{id:"search",label:i("common:navigation.search"),icon:v.isSearchActive?(0,t.jsx)(e6.default.IconSearchNewFilled,{color:"currentColor",width:24,height:24}):(0,t.jsx)(e6.default.IconSearchNew,{color:"currentColor",width:24,height:24}),isActive:v.isSearchActive,disabled:v.isSearchDisabled,onClick:y.handleSearchClick,dataTest:"bottom-nav-search"}),!!x&&(0,t.jsx)(rt,{id:"favorites",label:i("common:navigation.favorites"),icon:(0,t.jsx)(e6.default.IconFavoriteOutline,{color:"currentColor",fill:v.isFavoritesActive?"currentColor":void 0,width:24,height:24}),isActive:v.isFavoritesActive,disabled:v.isFavoritesDisabled,onClick:y.handleFavoritesClick,dataTest:"bottom-nav-favorites"}),(0,t.jsx)(rt,{id:"cart",label:i("common:navigation.cart"),icon:v.isCartActive?(0,t.jsx)(e6.default.IconCartNewFilled,{color:"currentColor",width:24,height:24}):(0,t.jsx)(e6.default.IconCartNew,{color:"currentColor",width:24,height:24}),isActive:v.isCartActive,disabled:v.isCartDisabled,onClick:y.handleCartClick,badge:T,dataTest:"bottom-nav-cart"})]})}),h&&(0,t.jsx)(ea.Sidebar,{size:"m",onClickOutside:b,children:(0,t.jsx)(rN,{handleClose:b})}),u&&(0,t.jsx)(rh,{searchInput:f,onClose:C,children:(0,t.jsx)("div",{className:(0,o.cn)("flex-1 overflow-y-auto",n&&"pb-[80px]"),children:(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.product,ec.Namespace.catalog,ec.Namespace.chef],children:(0,t.jsx)(rj.default,{banners:f.banners,categories:(null==(e=f.noResults)?void 0:e.categories)??f.categories,clearSearchBox:f.clearSearchBox,c
10ompanies:f.companies,correction:f.correction??null,differentiatedAssortments:f.differentiatedAssortments,fuzzy:f.fuzzy??!1,handleClose:C,handleSubmitSearch:f.handleSubmitSearch,isMobileOverlay:!0,loading:f.isWhispererLoading||f.isRecommendedLoading,noResults:f.noResults,products:f.productsWithPricing,recipes:f.recipes,searchBoxRef:f.searchRef,searchQuery:f.query,source:f.source,suggestions:f.suggestions,totalHits:f.totalHits,totalRecipeHits:f.totalRecipeHits,isSticky:!1})})})})]})};var rI=e.i(9776),rk=e.i(83128),r_=e.i(429482),rA=e.i(164133),rR=e.i(895857);let rP=e=>(0,o.cn)("text-[var(--banner-text-light-color)]",e&&"dark:text-[var(--banner-text-dark-color)]"),rD=({children:e,lightColor:i,darkColor:a,className:s})=>{let l=(0,r.cloneElement)(e,{color:i});if(a){let i=(0,r.cloneElement)(e,{color:a});return(0,t.jsxs)("div",{className:(0,o.cn)("flex items-center justify-center",s),children:[(0,t.jsx)("div",{className:"block leading-[0] dark:hidden",children:l}),(0,t.jsx)("div",{className:"hidden leading-[0] dark:block",children:i})]})}return(0,t.jsx)("div",{className:(0,o.cn)("flex items-center justify-center leading-[0]",s),children:l})};var rL=e.i(855354);let rB=e=>{let r=e.incentive.icon?e6.default[e.incentive.icon]:void 0,i={...e.style,"--animation-duration":`${4*e.itemsCount}s`,"--banner-text-light-color":e.textColor,"--banner-text-dark-color":e.textColorDark},a=rP(!!e.textColorDark);return(0,t.jsx)("div",{className:(0,o.cn)("absolute top-0 right-0 bottom-0 left-0 flex-[0_0_100%] items-stretch","lg:visible lg:flex-[0_1_auto] lg:opacity-100","lg:static lg:top-auto lg:right-auto lg:bottom-auto lg:left-auto",rL.default.bannerItemAnimation),style:i,children:(0,t.jsxs)("div",{className:(0,o.cn)("flex flex-row items-center justify-center gap-50"),children:[r&&(0,t.jsx)(rD,{lightColor:e.iconColor,darkColor:e.iconColorDark,children:(0,t.jsx)(r,{width:20,height:20})}),(0,t.jsx)(f.Caption,{className:(0,o.cn)(a),children:e.incentive.text})]})})},rM=e=>{let{icon:r,textColor:i,textColorDark:a,text:s,bigIcon:l,itemsCount:n,iconColor:d,iconColorDark:c}=e,{sDevice:u}=(0,rI.useBreakpoints)(),m=r?e6.default[r]:void 0,p={...e.style,"--animation-duration":`${4*n}s`,"--banner-text-light-color":i,"--banner-text-dark-color":a},g=rP(!!a);return(0,t.jsx)("div",{className:(0,o.cn)("absolute top-0 right-0 bottom-0 left-0 flex-[0_0_100%] items-stretch","lg:visible lg:flex-[0_1_auto] lg:opacity-100","lg:static lg:top-auto lg:right-auto lg:bottom-auto lg:left-auto",rL.default.bannerItemAnimation),style:p,children:(0,t.jsxs)("div",{className:"flex flex-row items-center justify-center gap-50",children:[m&&(0,t.jsx)(rD,{lightColor:d,darkColor:c,children:(0,t.jsx)(m,{width:l?32:20,height:l&&!u?14:20})}),(0,t.jsx)(f.Caption,{className:(0,o.cn)(g),semiBold:!0,children:s})]})})};var rF=e.i(893688);let rO=e=>({"--animation-delay":`${4*e}s`}),rU=({gradient:e,gradientDark:r,iconColor:i,iconColorDark:a,textColor:s,textColorDark:l,itemsCount:n,header:d,headerIcon:c,bigIcon:u,headerOnClick:p,headerLink:g,itemsToDisplay:x,"data-test":h,"aria-label":f})=>{let v=!!g,y=r?{"--gradient":e,"--gradient-dark":r}:e?{background:e}:{},b={style:y,className:(0,o.cn)("flex h-[30px] items-center justify-center py-50",r&&"[background:var(--gradient)] dark:[background:var(--gradient-dark)]"),"data-test":h,"aria-label":f},C=(0,t.jsxs)("div",{className:(0,o.cn)("flex items-center justify-center gap-100 px-50","relative h-full w-full","lg:h-auto lg:w-auto lg:p-0"),style:{maxWidth:rF.XL_WIDTH},children:[(d||c)&&(0,t.jsx)(rM,{iconColor:i,iconColorDark:a,textColor:s,textColorDark:l,itemsCount:n,text:d,icon:c,bigIcon:u,style:rO(0)}),x.map((e,r)=>(0,t.jsx)(rB,{iconColor:i,iconColorDark:a,textColor:s,textColorDark:l,itemsCount:n,incentive:e,style:rO(r+(d||c?1:0))},e.text))]});return v?(0,t.jsx)(m.default,{...b,to:g,onClick:p,style:{...y,textDecoration:"none"},children:C}):(0,t.jsx)("div",{...b,children:C})},rz=()=>{let{data:e}=(0,rR.useIncentivesQuery)();if(!e)return null;let r=[...e.items],i=(r.length??0)+1;return(0,t.jsx)(rU,{"data-test":"incentiveBanner",iconColor:e.iconColor,iconColorDark:e.iconColorDark,textColor:e.textColor,textColorDark:e.textColorDark,itemsCount:i,header:e.header,headerIcon:e.headerIcon,bigIcon:e.bigIcon,headerLink:e.link,itemsToDisplay:r,gradient:e.gradient,gradientDark:e.gradientDark})};var rQ=e.i(774889);let rH=()=>(0,rQ.useIsPriceProofHomepageArm)()?null:(0,t.jsx)(rz,{}),rK=[rl.Keys.ENTER,rl.Keys.SPACE],rW=({icon:e,label:r,type:i="primary",onClick:a,...s})=>(0,t.jsxs)("button",{className:(0,o.cn)("flex flex-1 cursor-pointer flex-col items-center text-center text-90 text-link-primary leading-250 no-underline transition-all duration-fast ease-[cubic-bezier(0.15,0.15,0.35,1)]","bg-transparent","primary"===i&&(0,o.cn)("border-grey-30 border-y border-l border-solid px-25 py-100 last:border-r sm:flex-row sm:whitespace-nowrap sm:px-100 sm:py-50","first:rounded-l-small last:rounded-r-small hover:text-grey-90 focus:text-grey-90"),"secondary"===i&&(0,o.cn)("border-none px-25 py-150 hover:text-grey-90 hover:no-underline focus:text-grey-90 focus:no-underline","min-[768px]:py-0 min-[768px]:underline")),"aria-label":r,onClick:a,onKeyUp:e=>rK.indexOf(e.key)>-1&&(null==a?void 0:a(e)),type:"button",tabIndex:0,...s,children:[(0,t.jsx)("div",{className:(0,o.cn)("primary"===i&&"mb-150 size-[30px] shrink-0 sm:mr-50 sm:mb-0 sm:size-200","secondary"===i&&"mb-200 size-[42px] sm:mb-300 sm:size-800"),children:e}),r]}),rG=({title:e,content:r,buttonLabel:i,onClose:s,buttons:l,onClaimButtonClick:n,onRatingSelect:u,claimActive:m=!0})=>{let{ts:p}=(0,a.default)();return(0,t.jsxs)("div",{className:(0,o.cn)("relative flex w-full flex-col items-center rounded-small bg-background-primary p-[8px_16px_12px] text-center shadow-primary","sm:px-200 sm:py-100"),"data-test":"feedback-wrapper",children:[(0,t.jsx)("button",{"aria-label":p("common:close"),className:"absolute top-[10px] right-[10px] size-300 cursor-pointer border-none bg-transparent p-0 text-center leading-100 shadow-none hover:bg-transparent",onClick:s,tabIndex:0,type:"button",children:(0,t.jsx)(e6.default.IconCloseX,{color:"var(--color-icon-primary)"})}),(0,t.jsx)("div",{className:"flex w-full items-center justify-center px-150",children:(0,t.jsx)(c.Subtitle,{className:"mb-50",size:"s",children:e})}
10),(0,t.jsx)(d.BodyText,{className:"mb-100",size:"s",children:r}),(0,t.jsx)("div",{className:"mb-200 flex flex-wrap",children:l.map(({icon:e,label:r,rating:i},a)=>(0,t.jsx)(rW,{"data-test":`rating-${i}`,icon:e,label:r,onClick:()=>u(i),type:"primary"},a))}),m&&(0,t.jsx)(E.default,{"data-test":"feedback-claim-btn",icon:(0,t.jsx)(e6.default.IconFoodstuffs,{}),onClick:n,size:"s",type:"ghostNeutral",children:i})]})};var rq=e.i(962059),rV=e.i(509731),rY=e.i(637200),r$=e.i(759692);let rX=({onClose:e,claimAnnouncement:r})=>{let i=(0,rq.default)(),s=(0,rV.default)(),{mutate:l}=(0,r$.useHideClaimAnnouncementMutation)(),n=(0,rY.default)(),{t:o}=(0,a.default)();return r?(0,t.jsx)("ul",{className:"w-full p-100","data-test":"announcements-claim",children:(0,t.jsx)(rG,{buttonLabel:o("common:claimAnnouncement.claimGoods"),buttons:n,claimActive:r.claimActive??!1,content:r.announcementText,onClaimButtonClick:()=>i.push(s.claim.url({orderId:r.orderId})),onClose:()=>{e(),(null==r?void 0:r.orderId)&&l(r.orderId)},onRatingSelect:e=>{let t={rating:e,hash:r.orderHash,id:r.orderId};i.push(s.orderRating.url(t))},title:o("common:claimAnnouncement.title")})}):null};var rZ=e.i(305580),rJ=e.i(277183),r0=e.i(941500),r1=e.i(70025),r2=e.i(570482);let r5=e=>{let t=e[rZ.Cookie.CLOSED_ANNOUNCEMENTS];return t?"object"==typeof t?t:t?JSON.parse(t):[]:[]},r3=({onReload:e})=>{let{ts:r}=(0,a.default)();return(0,t.jsx)("div",{className:"p-100 pt-50",children:(0,t.jsx)(rk.default,{button:(0,t.jsx)(D.Button,{onClick:e,variant:"secondaryNeutral",size:"s",isLoading:!1,children:r("ui:versionsChanged.actionLabel")}),title:r("ui:versionsChanged.title"),type:n.AnnouncementDTOTypeEnum.Informative})})},r8=r.default.memo(()=>{let e,i=(0,rq.default)(),a=(0,ep.useQueryClient)(),{firstTimeUser:s}=(0,$.default)(),{FEATURE_CLAIMS:l}=(0,T.default)(),[n,o]=(0,rJ.default)(),{data:d}=(0,rA.useTopAnnouncementsQuery)(),{data:c}=(0,r_.useDeliveryAnnouncementsQuery)(),{data:u}=(0,r2.useClaimAnnouncementQuery)(),[m,p]=(0,r.useState)(!!(null==u?void 0:u.orderId)),[g,x]=(0,r.useState)(!1),h=(e=r5(n).map(e=>e.updatedAt),null==d?void 0:d.filter(t=>!e.includes(t.updatedAt??""))),f=async e=>{var t,r,i;let s,l=(r=(null==(t=e.updatedAt)?void 0:t.toString())??"",i=r5(n),s=Date.now(),[...i.filter(e=>e.validUntil>s),{updatedAt:r,validUntil:(void 0)??Date.now()+157788e5}]);await Promise.resolve(o(rZ.Cookie.CLOSED_ANNOUNCEMENTS,l)),a.invalidateQueries({queryKey:(0,rA.getTopAnnouncementsQueryKey)()})};((e={})=>{let{value:{versions:t}}=(0,r1.useApplicationContext)(),{data:i,isLoading:a}=(0,r0.useVersionsQuery)();(0,r.useEffect)(()=>{if(!a&&i&&t&&t.client!==i.client){var r;null==(r=e.onClientChanged)||r.call(e,i.client)}},[a,i])})({onClientChanged:()=>x(!0)}),(0,r.useEffect)(()=>{p(!!(null==u?void 0:u.orderId))},[u]);let v="/product"===i.pathname&&s;return(0,t.jsxs)("div",{className:"relative bg-primary print:hidden","data-test":"notification-wrapper",children:[c&&(0,t.jsx)(e_.default,{"data-test":"announcements-delivery",notifications:c,onClose:f,wrapperClass:"p-100"}),h&&!v&&(0,t.jsx)(e_.default,{"data-test":"announcements-top",notifications:h,onClose:f,wrapperClass:"p-100"}),g&&(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.ui],children:(0,t.jsx)(r3,{onReload:()=>i.reload()})}),l&&m&&(0,t.jsx)(rX,{claimAnnouncement:u,onClose:()=>p(!1)}),"/"===i.pathname?(0,t.jsx)(rH,{}):(0,t.jsx)(rz,{})]})});var r4=e.i(494834),r9=e.i(635089),r6=e.i(81869),r7=e.i(280970),ie=e.i(339479),it=e.i(952097);let ir=r.default.memo(()=>{let{brandName:e}=(0,N.useConfiguration)(),[i,s]=(0,rJ.default)(),{t:l,ts:n}=(0,a.default)(),{appleIcon:o}=(0,ie.useFavicons)(),{appUrlOnPlatformDevices:c}=(0,r6.useMobileAppUrl)(),{isApp:u,isSafari:m}=(0,Q.default)(),p=(0,it.useAnalyticsApplicationEvents)(),g={color:"var(--yellow-60)",width:12,height:12};(0,r.useEffect)(()=>{u||i[rZ.Cookie.SMART_BANNER]||!c||m||p.smartBannerViewed()},[]);let x=e=>()=>{s(rZ.Cookie.SMART_BANNER,e,{expires:(0,r4.default)().add(r9.REOPEN_PERIOD[e],"day").toDate()}),e===r7.SmartBannerCloseType.Installed&&p.smartBannerInstallBtnClicked(),e===r7.SmartBannerCloseType.Closed&&p.smartBannerCloseBtnClicked()};return u||i[rZ.Cookie.SMART_BANNER]||!c||m?null:(0,t.jsxs)("div",{className:"flex items-center border border-primary border-solid bg-warning-light p-100",children:[(0,t.jsx)("button",{className:"u-button-reset mr-100","data-test":r9.SmartBannerDataTests.buttonClose,onClick:x(r7.SmartBannerCloseType.Closed),type:"button","aria-label":n("common:aria.close"),children:(0,t.jsx)(e6.default.IconCloseX,{color:"var(--color-icon-secondary)",height:24,width:24})}),(0,t.jsx)("div",{className:"mr-200 h-700 w-700 flex-shrink-0 overflow-hidden rounded-large shadow-[0_2px_4px_-1px_rgba(0,0,0,0.1)]",children:(0,t.jsx)("img",{alt:e,height:"56",src:o,width:"56"})}),(0,t.jsxs)("div",{className:"flex w-full items-center",children:[(0,t.jsxs)("div",{className:"mr-100 flex-grow",children:[(0,t.jsxs)("div",{className:"u-flex-center mb-50 inline-flex",children:[(0,t.jsx)(d.BodyText,{semiBold:!0,size:"s",children:e}),(0,t.jsx)("div",{className:"ml-100 flex",children:[...Array(r9.TOTAL_STAR)].map((e,r)=>r9.TOTAL_STAR-1===r?(0,t.jsx)(e6.default.IconHalfStar,{...g},r):(0,t.jsx)(e6.default.IconStar,{...g},r))})]}),(0,t.jsx)(f.Caption,{color:"secondary",children:l("common:smartBanner_description")})]}),(0,t.jsx)(I.Button,{external:!0,className:"mr-100","data-test":r9.SmartBannerDataTests.buttonInstall,onClick:x(r7.SmartBannerCloseType.Installed),size:"s",url:c,children:l("common:smartBanner_button")})]})]})}),ii=(0,t9.default)(()=>(0,t6.retryImport)(()=>e.A(568286)),{loadableGenerated:{modules:[955776]},ssr:!1}),ia=({hideToggleButton:e,hasCapsule:r,suppressNudge:i})=>(0,ts.useIsAssistantEnabled)()?(0,t.jsx)(ii,{hasCapsule:r,hideToggleButton:e,suppressNudge:i}):null;var is=e.i(431881),il=e.i(473791);let io=({children:e})=>(0,ts.useIsAssistantEnabled)()?(0,t.jsx)(il.AssistantStateContextProvider,{children:(0,t.jsx)(is.AssistantMessagesContextProvider,{children:e})}):(0,t.jsx)(t.Fragment,{children:e});var id=e.i(218528),ic=e.i(686296);let iu=()=>((0,ic.useStatsigExperiment)(id.STATSIG_EXPERIMENT.maiaContextualHoldout,id.STATSIG_EXPERIMENT_PARAMETER.variant,void 0,{deferExposure:!0}),null);var im=e.i(843805);let ip=(0,t9.default)(()=>(0,t6.retryImport)(()=>e.A(69149)),{loadableGenerated:{modules:[297483]},ssr:!1}),ig=({isCompactPage:e=!1})=>{let{isAuthenticated:r}=(0,$.default)(),i=(0,im.useIsShoppingMaiaEnabled)(),a=(0,im.useIsCapsuleViewport)();return(0,t.jsxs)(t.Fragment,{children:[r&&a&&(0,t.jsx)(iu,{}),i&&(0,t.jsx)(ip,{isCompactPage:e})]})};e.s(["default",0,({showFooter:e,showPremiumTeaser:a=!0,showDaktelaChat:l=!0,showMaiaButton:d=!0,maiaCapsule:c,showAiAssistantWrapper:u=!0,showBottomNavigation:m=!0,simpleMobileHeaderProps:p,showDefaultMobileHeader:g=!0,hideMobileHeader:x=!1,pageContainer:h,layoutColor:f,footerBelowViewport:v,children:y,indentTop:b=!1,renderHeader:C,embed:w=!1,...T})=>{let[j,S]=(0,r.useState)(!1),N=(0,H.default)(),{xsDevice:E,sDevice:I}
10=(0,rI.useBreakpoints)(),k=(0,t7.useIsMobileRedesign)(),{announcementsRef:_,isAssistantOpened:A,assistantChatMode:R}=(0,re.useUIContext)(),P=c??(d?"default":"off"),D=(0,im.useIsShoppingMaiaEnabled)()&&"off"!==P,L=k&&m,B=p&&(E||I),M=k&&g&&!B&&!x,{data:F}=(0,K.useActiveBottomSheetQuery)(),{mutate:O}=(0,W.useMutation)({mutationFn:async({sheetType:e,activityType:t})=>{let r=await G.default.createBottomSheetMessagesApi(),i=await r.acknowledgeBottomSheetMessage({type:e,activity:t});return(0,q.returnOrThrowApiResponse)(i)}}),U=(0,Y.useGtmXtraEvents)(),{user:J}=(0,$.default)(),{isApp:ee}=(0,Q.default)();r.default.useEffect(()=>(k?document.body.classList.add("has-bottom-nav"):document.body.classList.remove("has-bottom-nav"),()=>{document.body.classList.remove("has-bottom-nav")}),[k]);let et={title:null==F?void 0:F.title,icon:null==F?void 0:F.icon,subtitle:(null==F?void 0:F.subtitle)??void 0},er=(e,t)=>{S(!0),O({sheetType:e,activityType:t})};return(0,t.jsxs)("div",{...T,children:[(0,t.jsx)(s,{}),!w&&!B&&!(x&&(E||I))&&(0,t.jsxs)("div",{ref:_,"aria-live":"polite",className:"relative lg:static",children:[(0,t.jsx)(ir,{}),(0,t.jsx)(r8,{})]}),!w&&C,(0,t.jsx)(tq,{}),!w&&m&&(0,t.jsx)(rE,{}),(0,t.jsxs)("div",{className:(0,o.cn)({"pt-300 sm:pt-500":b&&!M,"bg-[var(--background-color-primary)]":!f||f===X.LayoutColor.Primary,"bg-[var(--background-color-secondary)]":f===X.LayoutColor.Secondary,"pb-[96px]":L||D,hidden:"fullscreen"===R&&A}),style:{paddingTop:B?`${rr.SIMPLE_MOBILE_HEADER_HEIGHT}px`:void 0},children:[(0,t.jsx)("main",{className:(0,o.cn)("relative 3xl:mx-auto 3xl:my-0 w-full print:m-0 print:w-auto print:p-0",{"min-h-[calc(100vh-90px)]":v,"md:min-h-[400px]":!v,"3xl:w-[1920px]":h}),id:"main-content",children:y}),!ee&&!w&&e&&(0,t.jsx)(z,{}),!J&&(0,t.jsx)(i.default.LoginNotice,{})]}),!w&&(0,t.jsxs)(io,{children:[u&&(0,t.jsx)(ia,{hasCapsule:D,hideToggleButton:!d,suppressNudge:"compact"===P}),"off"!==P&&(0,t.jsx)(ig,{isCompactPage:"compact"===P})]}),!ee&&!w&&l&&(0,t.jsx)(i.default.DaktelaChat,{}),!j&&(null==F?void 0:F.type)&&(0,t.jsx)(V.default,{emit:()=>U.xtraBottomSheetViewed(F.type),children:(0,t.jsxs)(i.default.BottomSheet,{background:((e,t)=>{switch(e){case n.BottomSheetMessageTypeName.PremiumFreeActivation:case n.BottomSheetMessageTypeName.PremiumSaleActionActivation:return`top/200% url(${t(tV)}) no-repeat, var(--color-semantic-xtra-bottomSheet)`;case n.BottomSheetMessageTypeName.PremiumInspirationTimeslotReservation:return"var(--color-semantic-xtra-bottomSheet)";
10case n.BottomSheetMessageTypeName.LoyaltyReward:case n.BottomSheetMessageTypeName.LoyaltyGiftSelection:case n.BottomSheetMessageTypeName.LoyaltyGiftSelectionSuccess:return`top/200% url(${t(tV)}) no-repeat, var(--background-color-brand-light-secondary)`;case n.BottomSheetMessageTypeName.PersonalizationConsent:return"var(--background-color-primary)";default:return"var(--background-color-brand-light-secondary)"}})(F.type,N),icon:et.icon,notClosable:F.type===n.BottomSheetMessageTypeName.PersonalizationConsent,onClose:()=>{er(F.type),U.premiumBottomSheetCloseBtnClicked(F.type)},subtitle:et.subtitle,title:et.title,children:[(0,t.jsx)(t4,{bottomSheetType:F.type,buttonLabel:F.buttonText,buttonUrl:F.buttonUrl??void 0,closeBottomSheet:()=>er(F.type),content:F.content}),(0,t.jsx)(Z,{bottomSheetType:F.type,content:F.content,onClick:er})]})})]})}],289456);var ix=e.i(389364),ih=e.i(609349),iv=e.i(730943),iy=e.i(290170),ib=e.i(788378),iC=e.i(467065);let iw=({showUserBox:e,anchorRef:a})=>{let{setUserBoxVisible:s}=(0,re.useUIContext)(),[l,n]=(0,r.useState)(!0);return e?(0,t.jsx)(i.default.UserBox,{anchorRef:a}):(0,ib.isServer)()?null:(0,iv.createPortal)((0,t.jsx)(iy.default.LoginModal,{hideModal:()=>{s(!1),n(!1)},open:l,ignoreOutsideClick:!0}),document.getElementById(iC.REACT_PORTAL_ID)??document.body)};var iT=e.i(799103),ij=e.i(367793);let iS=()=>{let{tenant:e}=(0,N.useConfiguration)(),{lang:r}=(0,a.default)(),i=[(0,j.getDefaultLocale)(e)],s=(0,S.useChangeLanguageMutation)(),{innerWidth:l}=(0,rI.useBreakpoints)(),n=(0,j.getLanguageMutation)(e,"en");n&&i.push(n);let o=i.map(e=>({label:(0,j.getLanguageTitle)(e),value:e,icon:(0,u.getLanguageIcon)(e,k)})),d=l<rF.M_WIDTH;return(0,t.jsx)(iT.default,{buttonType:"ghostWColorfullIcon",className:"mr-100","data-test":"language-switcher",icon:(0,t.jsxs)("div",{className:"flex items-center gap-50 pl-100",children:[(0,u.getLanguageIcon)(r,k),!d&&(0,t.jsx)(ij.default,{orientation:"down",width:16,height:16})]}),listId:"langSwitch",onChange:(e,t)=>
10{s.mutate({language:t??""})},options:o,dropdownAlign:d?"right":"left"})};var iN=e.i(937569),iE=e.i(39158),iI=e.i(874487),ik=e.i(748252);let i_=({children:e,isLoggedIn:r,...i})=>(0,t.jsx)("div",{className:(0,o.cn)("flex items-center justify-center","h-400 w-400","rounded-full bg-[var(--alpha-5)] dark:bg-[var(--alphaWhite-10)]","text-center font-semibold text-200 text-primary leading-400","sm:gap-50 sm:text-nowrap",!r&&"sm:w-auto sm:px-100 sm:py-0",r&&"sm:p-0"),...i,children:e}),iA=()=>{let{xtraUser:e,isAuthenticated:r,user:i,isBabyClubPremium:s}=(0,$.default)(),{t:l,ts:n}=(0,a.default)(),{tutorials:o,invalidUrls:c,cookieName:u}=(0,iI.useTutorialContext)();if(r&&i){var m,p;return(0,t.jsx)(iE.TutorialTooltip,{cookieName:u,hidesBatchedDeviceType:!0,invalidUrls:c,text:null==o||null==(m=o.profile)?void 0:m.text,title:null==o||null==(p=o.profile)?void 0:p.title,children:(0,t.jsxs)("div",{id:"headerUser",className:"relative max-w-[72px] xs:max-w-[200px] font-normal text-primary",children:[(e||i.parentsClub)&&(0,t.jsxs)("div",{className:"-right-50 absolute top-0 flex flex-col gap-25",children:[e&&(0,t.jsx)(iN.default,{circleSize:"tiny","data-test":ih.UserDataTests.userBoxPremiumCrown,height:16,type:"xtra",width:16,color:"var(--color-text-brand-10)",bgColor:"var(--background-color-brand-80)"}),i.parentsClub&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(iN.default,{circleSize:"tiny",height:13,type:"babyClub",width:13,"data-test":"baby-club-badge"}),s&&(0,t.jsx)("span",{"data-test":"baby-club-premium-badge",className:"-right-[5px] -bottom-50 -translate-y-[1px] absolute flex h-150 w-150 select-none items-center justify-center rounded-full bg-pink-90",children:(0,t.jsx)(e6.default.IconPlus,{height:8,width:8,color:"var(--color-icon-inverted)"})})]})]}),(0,t.jsx)(i_,{isLoggedIn:!0,children:i.pictureUrl?(0,t.jsx)("img",{className:"rounded-full",alt:n("common:header.user.accountTitle"),id:"headerUserImage",src:i.pictureUrl,width:32,height:32}):((e,t="")=>{let r,i,a,s,l;return e?(i=(r=e.split(" "))[0],a=r[r.length-1],s=i.charAt(0).toUpperCase(),l=r.length>1?a.charAt(0).toUpperCase():"",`${s}${l}`):t})(null==i?void 0:i.name,n("common:header.user.account"))})]})})}return(0,t.jsxs)(i_,{"aria-label":n("common:header.user.account"),children:[(0,t.jsx)(ik.default,{}),(0,t.jsx)(d.BodyText,{size:"s",semiBold:!0,className:"hidden sm:block",children:l("user:login")})]})},iR=r.default.memo(({showLanguageSwitcher:e})=>{let{ts:i}=(0,a.default)(),{userBoxVisible:s,setUserBoxVisible:l}=(0,re.useUIContext)(),{user:n,isAuthenticated:o}=(0,$.default)(),d=(0,r.useRef)(null);return(0,ix.default)(d,()=>!!s&&l(!1)),(0,t.jsxs)("div",{className:"relative flex items-center","data-gtm-section":"user-login",ref:d,children:[e&&(0,t.jsx)(iS,{}),(0,t.jsx)("div",{className:"max-width-[200px] float-right flex cursor-pointer text-right font-normal text-semibold","aria-expanded":s,"aria-label":i("common:aria.account"),"data-test":ih.UserDataTests.userBoxIcon,onClick:()=>{l(e=>!e)},onKeyUp:e=>{(e.key===rl.Keys.ENTER||e.key===rl.Keys.SPACE)&&l(e=>!e),e.key===rl.Keys.ESC&&l(!1)},role:"button",tabIndex:0,children:(0,t.jsx)(iA,{})}),s&&(0,t.jsx)(eo.DynamicTranslations,{namespaces:[ec.Namespace.user],fallback:(0,t.jsx)("div",{className:"tw:fixed tw:inset-0 tw:z-[1000] tw:flex tw:items-center tw:justify-center tw:bg-[rgba(0,0,0,0.5)]",children:(0,t.jsx)(rm.default,{width:48,height:48})}),children:(0,t.jsx)(iw,{showUserBox:!!(o&&n),anchorRef:d})})]})});e.s(["default",0,iR],371591)},51633,e=>{"use strict";let t="[\\w-'\\(\\)]+",r="[0-9]+[\\w-]*",i="[0-9]+-*[\\w-]*",a=`c:categorySlug(${i})`,s=`:categorySlug(c${i})`,l=`:productSlug(${r})`,n=`:articleSlug(${t})`,o=`:city(${t})`,d=`:shareId(${t})`;e.s(["ARTICLE_SLUG",0,n,"CATEGORY_SLUG",0,a,"CATEGORY_SLUG_FAVS",0,s,"CITY_SLUG",0,o,"FILTERS_SLUG",0,":filters([\\w-%,/!']+)","LANGUAGE_REGEXP",0,":lng([a-z]{2}-[A-Z]{2})","PRODUCT_SLUG",0,l,"ROUTE_REGEX_ID",0,"[0-9]+","ROUTE_REGEX_ID_WITH_SLUG",0,r,"ROUTE_REGEX_SLUG",0,t,"SHARE_LIST_SLUG",0,d,"buildIdSlug",0,(e,t)=>`${e}-${t.replace(/[^\w-]/g,"")}`])},948294,878938,766540,695093,e=>{"use strict";var t=e.i(494834);let r={};e.s(["getDefaultOptions",0,function(){return r}],878938);let i={year:0,month:1,day:2,hour:3,minute:4,second:5},a={},s=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/Ne
10w_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),l="06/25/2014, 00:00:00"===s||"â06â/â25â/â2014â â00â:â00â:â00"===s;function n(e,t,r,i,a,s,l){let n=new Date(0);return n.setUTCFullYear(e,t,r),n.setUTCHours(i,a,s,l),n}let o=/^(Z)$/,d=/^([+-]\d{2})$/,c=/^([+-])(\d{2}):?(\d{2})$/;function u(e,t,r){let i,a;if(!e)return 0;let s=o.exec(e);if(s)return 0;if(s=d.exec(e))return p(i=parseInt(s[1],10))?-(36e5*i):NaN;if(s=c.exec(e)){i=parseInt(s[2],10);let e=parseInt(s[3],10);return p(i,e)?(a=36e5*Math.abs(i)+6e4*e,"+"===s[1]?-a:a):NaN}if(function(e){if(g[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),g[e]=!0,!0}catch(e){return!1}}(e)){var l;t=new Date(t||Date.now());let i=m(r?t:n((l=t).getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),e);return-(r?i:function(e,t,r){let i=e.getTime()-t,a=m(new Date(i),r);if(t===a)return t;let s=m(new Date(i-=a-t),r);return a===s?a:Math.max(a,s)}(t,i,e))}return NaN}function m(e,t){var r,s,o;let d,c,u,m=(a[r=t]||(a[r]=l?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),"formatToParts"in(u=a[r])?function(e,t){try{let r=e.formatToParts(t),a=[];for(let e=0;e<r.length;e++){let t=i[r[e].type];void 0!==t&&(a[t]=parseInt(r[e].value,10))}return a}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(u,e):(s=u,o=e,d=s.format(o),[parseInt((c=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(d))[3],10),parseInt(c[1],10),parseInt(c[2],10),parseInt(c[4],10),parseInt(c[5],10),parseInt(c[6],10)])),p=n(m[0],m[1]-1,m[2],m[3]%24,m[4],m[5],0).getTime(),g=e.getTime(),x=g%1e3;return p-(g-=x>=0?x:1e3+x)}function p(e,t){return -23<=e&&e<=23&&(null==t||0<=t&&t<=59)}let g={};function x(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-t}let h=/^([0-9W+-]+)(T| )(.*)/,f=/^([0-9W+-]+)(.*)/,v=/^(\d{2})$/,y=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],b=/^(\d{4})/,C=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],w=/^-(\d{2})$/,T=/^-?(\d{3})$/,j=/^-?(\d{2})-?(\d{2})$/,S=/^-?W(\d{2})$/,N=/^-?W(\d{2})-?(\d{1})$/,E=/^(\d{2}([.,]\d*)?)$/,I=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,k=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;function A(e,t,r){t=t||0,r=r||0;let i=new Date(0);i.setUTCFullYear(e,0,4);let a=7*t+r+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+a),i}let R=[31,28,31,30,31,30,31,31,30,31,30,31],P=[31,29,31,30,31,30,31,31,30,31,30,31];function D(e){return e%400==0||e%4==0&&e%100!=0}function L(e,t,r){if(t<0||t>11)return!1;if(null!=r){if(r<1)return!1;let i=D(e);if(i&&r>P[t]||!i&&r>R[t])return!1}return!0}function B(e,t){return!(e<0)&&!(e>52)&&(null==t||!(t<0)&&!(t>6))}function M(e,t,r){return!(e<0)&&!(e>=25)&&(null==t||!(t<0)&&!(t>=60))&&(null==r||!(r<0)&&!(r>=60))}function F(e,t,r){e=function(e,t={}){if(arguments.length<1)throw TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);let r=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==r&&1!==r&&0!==r)throw RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);let i=function(e){let t,r={},i=h.exec(e);if(i?(r.date=i[1],t=i[3]):(i=f.exec(e))?(r.date=i[1],t=i[2]):(r.date=null,t=e),t){let e=_.exec(t);e?(r.time=t.replace(e[1],""),r.timeZone=e[1].trim()):r.time=t}return r}(e),{year:a,restDateString:s}=function(e,t){if(e){let r=y[t],i=C[t],a=b.exec(e)||i.exec(e);if(a){let t=a[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(a=v.exec(e)||r.exec(e)){let t=a[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(i.date,r),l=function(e,t){let r,i,a;if(null===t)return null;
10if(!e||!e.length)return(r=new Date(0)).setUTCFullYear(t),r;let s=w.exec(e);if(s)return(r=new Date(0),L(t,i=parseInt(s[1],10)-1))?(r.setUTCFullYear(t,i),r):new Date(NaN);if(s=T.exec(e)){r=new Date(0);let e=parseInt(s[1],10);return!function(e,t){if(t<1)return!1;let r=D(e);return(!r||!(t>366))&&(!!r||!(t>365))}(t,e)?new Date(NaN):(r.setUTCFullYear(t,0,e),r)}if(s=j.exec(e)){r=new Date(0),i=parseInt(s[1],10)-1;let e=parseInt(s[2],10);return L(t,i,e)?(r.setUTCFullYear(t,i,e),r):new Date(NaN)}if(s=S.exec(e))return B(a=parseInt(s[1],10)-1)?A(t,a):new Date(NaN);if(s=N.exec(e)){a=parseInt(s[1],10)-1;let e=parseInt(s[2],10)-1;return B(a,e)?A(t,a,e):new Date(NaN)}return null}(s,a);if(null===l||isNaN(l.getTime())||!l)return new Date(NaN);{let e,r=l.getTime(),a=0;if(i.time&&(null===(a=function(e){let t,r,i=E.exec(e);if(i)return M(t=parseFloat(i[1].replace(",",".")))?t%24*36e5:NaN;if(i=I.exec(e))return M(t=parseInt(i[1],10),r=parseFloat(i[2].replace(",",".")))?t%24*36e5+6e4*r:NaN;if(i=k.exec(e)){t=parseInt(i[1],10),r=parseInt(i[2],10);let e=parseFloat(i[3].replace(",","."));return M(t,r,e)?t%24*36e5+6e4*r+1e3*e:NaN}return null}(i.time))||isNaN(a)))return new Date(NaN);if(i.timeZone||t.timeZone){if(isNaN(e=u(i.timeZone||t.timeZone,new Date(r+a))))return new Date(NaN)}else e=x(new Date(r+a)),e=x(new Date(r+a+e));return new Date(r+a+e)}}(e,r);let i=u(t,e,!0),a=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}e.s(["toZonedTime",0,F],766540),e.s([],695093);let O=e=>!Number.isNaN(("string"==typeof e?(0,t.default)(e).toDate():e).getTime()),U=e=>{var t,r,i;return!!(null==(t=e.match(/\.\d{3}Z/g))?void 0:t.length)||!!(null==(r=e.match(/\+\d\d:\d\d/g))?void 0:r.length)||!!(null==(i=e.match(/\+\d\d\d\d/g))?void 0:i.length)};e.s(["getDateWithYear",0,(e,r,i,a)=>{if(!O(e))return"";let s=Intl.DateTimeFormat(r,a?{month:"numeric",day:"numeric"}:void 0);return U(e.toString())?s.format(F((0,t.default)(e.toString()).toDate(),i)):s.format((0,t.default)(e).toDate())},"getDayForDelivery",0,(e,r,i)=>{let a=F(new Date,i).getDate(),s=F(new Date,i);s.setDate(a+1);let l=s.getDate(),n=(0,t.default)(e.toString()).toDate(),o=F(n,i),d=U(e.toString())?o.getDay():n.getDay(),c=U(e.toString())?o.getDate():n.getDate();return r(a===c?"common:today":l===c?"common:tomorrow":`common:dayIn.${d}`)},"getMonthAndYear",0,(e,r,i)=>{if(!O(e))return"";let a=Intl.DateTimeFormat(r,{day:"numeric",month:"long",year:"numeric"}),s=U(e.toString())?F((0,t.default)(e.toString()).toDate(),i):(0,t.default)(e).toDate(),l=a.formatToParts(s),n=l.findIndex(e=>"day"===e.type);if(-1!==n){let e=n===l.length-1?n-1:n+1;[Math.max(n,e),Math.min(n,e)].forEach(e=>l.splice(e,1))}return l.map(e=>e.value).join("").trim()},"getTime",0,(e,r,i)=>{if(!O(e))return"";let a=Intl.DateTimeFormat(r,{hour:"numeric",minute:"numeric"});return U(e.toString())?a.format(F((0,t.default)(e.toString()).toDate(),i)):a.format((0,t.default)(e).toDate())},"isDateValid",0,O],948294)},247086,e=>{"use strict";var t=e.i(962059),r=e.i(435642),i=e.i(853127),a=e.i(840358),s=e.i(948294);e.s(["default",0,()=>{let{locale:e,defaultLocale:l}=(0,t.default)(),{tenant:n}=(0,i.useConfiguration)(),o=(0,a.getTimezoneByTenant)(n),{ts:d}=(0,r.default)();return{getDateWithYear:(t,r)=>(0,s.getDateWithYear)(t,e||l,o,r),getTime:t=>(0,s.getTime)(t,e||l,o),getMonthAndYear:t=>(0,s.getMonthAndYear)(t,e||l,o),getDayStringForDelivery:e=>(0,s.getDayForDelivery)(e,d,o)}}])},772054,e=>{"use strict";var t=e.i(191788);e.s(["default",0,()=>{let[e,r]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{r(!0)},[]),e}
10])},637200,e=>{"use strict";var t=e.i(391398),r=e.i(435642),i=e.i(821874);e.s(["default",0,(e="100%")=>{let{ts:a}=(0,r.default)();return[{icon:(0,t.jsx)(i.default.IconSmileyMegaHappy,{height:e,width:e}),rating:5,label:a("common:rating.rating5")},{icon:(0,t.jsx)(i.default.IconSmileyHappy,{height:e,width:e}),rating:4,label:a("common:rating.rating4")},{icon:(0,t.jsx)(i.default.IconSmileyUnHappy,{height:e,width:e}),rating:3,label:a("common:rating.rating3")},{icon:(0,t.jsx)(i.default.IconSmileyFurious,{height:e,width:e}),rating:1,label:a("common:rating.rating1")}]}])},56928,e=>{"use strict";var t=e.i(984876),r=e.i(225857),i=e.i(509731);e.s(["default",0,()=>{let{drugstoreCompany:e}=(0,t.useCompaniesContext)(),a=(0,i.default)();return{getSearchUrl:(t,i,s="",l,n)=>{var o;let d=e&&i===e.id?(null==(o=e.url)?void 0:o.substr(0,e.url.indexOf("/c")))||"/":"";return(0,r.setUrlParams)(`${s}${d}${a.search.url()}`,{q:t,companyId:i,searchcategory:i===(null==e?void 0:e.id)?"lekarna":void 0,searchEngine:l,searchDebug:n?1:void 0})}}}])},354482,e=>{"use strict";var t=e.i(853127),r=e.i(948294),i=e.i(435642),a=e.i(574537),s=e.i(779835),l=e.i(840358),n=e.i(794060);e.s(["useStartDeliveryInfo",0,(e,o)=>{var d,c,u,m,p,g,x,h,f,v,y,b;let{ts:C}=(0,i.default)(),{tenant:w}=(0,t.useConfiguration)(),T=(0,a.default)(),j=(0,l.getTimezoneByTenant)(w),{user:S}=(0,n.default)(),{data:N,isFetching:E,isSuccess:I,isError:k}=(0,s.useShoppingStartDeliveryInfoQuery)(e,null==S?void 0:S.id,o);return{isFetching:E,isSuccess:I&&N&&0!==Object.keys(N).length,isSettled:I||k,isError:k,freeForFTU:null==N?void 0:N.freeForFTU,firstPossibleDeliveryAtDay:(null==N?void 0:N.firstPossibleDeliveryAt)&&(0,r.getDayForDelivery)(N.firstPossibleDeliveryAt,C,j),firstPossibleDeliveryAtTime:(null==N?void 0:N.firstPossibleDeliveryAt)&&(0,r.getTime)(N.firstPossibleDeliveryAt,w,j),minimalOrderValue:T.formatPrice((null==N||null==(d=N.minimalOrderValue)?void 0:d.amount)??0),minimalOrderValueAmount:null==N||null==(c=N.minimalOrderValue)?void 0:c.amount,freeOrderFrom:T.formatPrice((null==N||null==(u=N.freeOrderValue)?void 0:u.amount)??0),freeOrderValueAmount:null==N||null==(m=N.freeOrderValue)?void 0:m.amount,deliveryRange:{minPrice:T.formatPrice((null==N||null==(g=N.shoppingStartDeliveryOptionRange)||null==(p=g.minOrderPrice)?void 0:p.amount)??0),maxPrice:T.formatPrice((null==N||null==(h=N.shoppingStartDeliveryOptionRange)||null==(x=h.maxOrderPrice)?void 0:x.amount)??0),from:T.formatPrice((null==N||null==(v=N.shoppingStartDeliveryOptionRange)||null==(f=v.deliveryStartingAt)?void 0:f.amount)??0)},deliveryStartingAtAmount:null==N||null==(b=N.shoppingStartDeliveryOptionRange)||null==(y=b.deliveryStartingAt)?void 0:y.amount}}])},897323,e=>{"use strict";var t=e.i(945140),r=e.i(218063),i=e.i(788378);e.s(["between",0,(e,t,r,i=!0)=>i?e>t&&e<r:e>=t&&e<=r,"clickedOnScrollbar",0,function(e){return window.innerWidth<=e||window.innerWidth-32<=e},"scrollToElement",0,function(e,a=0,s,l){if((0,i.isServer)()||!e)return;if("string"==typeof e&&(e=document.getElementById(e)),l){let r=document.getElementById(l);return r?(0,t.default)(((null==e?void 0:e.offsetTop)||0)-a,{element:r}):void 0}let{top:n=0}=(null==e?void 0:e.getBoundingClientRect())||{},o=function(){if((0,i.isServer)())return r.HEADER_HEIGHT;let e=document.querySelector("#headerNav")||document.querySelector("header.Header__header");return e?e.getBoundingClientRect().height:0}(),d=((0,i.isServer)()?0:window.scrollY||0)+n-o-a;return s?(0,t.default)(d,{minDuration:500}):window.scrollTo(0,d)},"stripHTML",0,function(e){let t=!1,r=-1,i=Array(e.length);for(let a=0;a<e.length;a++){let s=e[a];if(t&&">"===s){t=!1;continue}if(t){if("<"===s){for(let t=r;t<a;t++)i.push(e[t]);r=a}continue}let l=e[a+1];if("<"===s&&" "!==l&&">"!==l){t=!0,r=a;continue}i.push(s)}return i.join("").replace(/\n/g,"").replace(" "," ")}])},789812,e=>{"use strict";var t=e.i(672998);let r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [role="link"], [role="button"]',i=(e,t=r)=>e?Array.from(e.querySelectorAll(t)).filter(e=>{let t=e.hasAttribute("disabled")||!0===e.disabled;return null!==e.offsetParent&&!t}):[];e.s(["createKeyboardNavigationHandler",0,(e,a={})=>{let{selector:s=r,onEscape:l,escapeCondition:n,onEscapeCallback:o}=a;return a=>{let d;if(a.code===t.Keys.ESC&&l&&(void 0===n||n)){a.preventDefault(),l(),null==o||o();return}((d=a.code)===t.Keys.DOWN||d===t.Keys.UP)&&((e,a,s=r)=>{var l,n;let o=i(a.current,s);if(0===o.length)return;let d=(l=o.indexOf(document.activeElement),n=o.length,e.code===t.Keys.DOWN?l<n-1?l+1:0:l>0?l-1:n-1);e.preventDefault(),o[d].focus()})(a,e,s)}},"getFocusableElements",0,i])},793790,e=>{"use strict";var t=e.i(927623);e.s(["getSearchCorrection",0,e=>{let r=(null==e?void 0:e.correctionType)??"",i=r===t.CorrectionType.Relaxation,a=r===t.CorrectionType.Correction;return{relaxation:i,keyword:a,message:(null==e?void 0:e.message)??"",query:null==e?void 0:e.query}}])},132767,e=>{"use strict";var t=e.i(413694),r=e.i(773455);e.s(["showProductImageInGreyscale",0,({prices:e,stock:i,isItemInLastMinute:a,isArchived:s})=>!!s||(0,t.isProductSoldOut)({inStock:i.inStock,preorderEnabled:i.preorderEnabled},a)&&!a&&!(0,r.isProductAvailableForLastMinute)(e)])}]); 11
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.