const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CsBNR-_Q.js","./BxiWQxwE.js","./entry.CtWQE1sF.css","./snow-effect.DsVN3pyP.css"])))=>i.map(i=>d[i]);
import{d as Z,r as B,R as le,a as ee,cy as Ze,cz as et,e as I,bx as tt,u as ue,K as ce,ce as ot,Z as nt,Y as pe,V as Y,q as de,H as me,cA as st,a3 as at,k as ae,ca as rt,bN as it,l as lt,s as X,j as re,bs as ut,m as ct,p as pt,w as dt,f as mt,i as t,h as _t,g as e,t as p,x as S,C as d,A as ft,aK as gt,o as u,cB as ht,cC as vt,cD as bt,cE as wt,cx as kt,cF as yt,G as St,I as Ct,T as P,D as Q,aI as xt,cG as Tt,cc as It,c9 as T,n as Lt,a5 as Et,cH as Pt,cI as Dt,_ as Nt}from"./BxiWQxwE.js";import At from"./pwSx0HTh.js";import Bt from"./_6A4EL4o.js";import Rt from"./CcOBa4EZ.js";import Ot from"./DUDG9KLG.js";import Ft from"./8C7n74AL.js";import $t from"./DyCHKxtu.js";import Mt from"./BaQCUg5W.js";import{_ as Ht}from"./BsYfKBuO.js";import{_ as qt}from"./SbpFJDkq.js";import zt from"./CQ5kzF4f.js";import Wt from"./DdY7KJZY.js";import Gt from"./co21RnpE.js";import{u as jt}from"./BuMsBOrl.js";import{u as Vt}from"./DV8hZmlQ.js";import{u as Kt}from"./BOa3TGoj.js";import"./BY4NrwIH.js";import"./C2JzzFl-.js";import"./BvjsPMik.js";import"./9mcJnkzw.js";import"./rHd7yrCD.js";import"./CXl5K08l.js";import"./B8cvSguG.js";import"./Cr1-d7pQ.js";import"./BtFqvK5V.js";import"./DXn7UZRN.js";import"./4HfP1VOY.js";import"./QMEN6lyk.js";import"./CxeYIrhH.js";import"./CMsHgkl0.js";import"./D8_G3sZS.js";import"./Bq7un2f4.js";import"./Ce1Sjjn1.js";import"./C4s7dVXj.js";import"./C2lb8vfu.js";import"./COGYfyY2.js";import"./C06lYHNU.js";import"./3JbtE1cp.js";import"./BRskpzNM.js";import"./CL-JfOb1.js";import"./CLOapF1a.js";import"./B_7hk5vn.js";import"./Egyo_DST.js";import"./6f6dE3EF.js";import"./C5EyhMCy.js";import"./DbZappjS.js";import"./CACLnWKE.js";import"./B9mC1keg.js";const ie={webManifest:{href:"/manifest.webmanifest"}},Ut=Z({async setup(){if(ie){const o=B({link:[]});le(o);const{webManifest:n}=ie;if(n){const{href:c}=n;o.value.link.push({rel:"manifest",href:c})}}return()=>null}});function Jt(o,n){const c=n/o*100;return 2/Math.PI*100*Math.atan(c/50)}function Xt(o={}){const{duration:n=2e3,throttle:c=200,hideDelay:i=500,resetDelay:f=400}=o,g=o.estimatedProgress||Jt,m=ee(),s=B(0),h=B(!1),C=B(!1);let _=!1,a,v,D,L;const N=()=>{C.value=!1,q(0)};function q(b=0){if(!m.isHydrating){if(b>=100)return R();x(),s.value=b<0?0:b,c?v=setTimeout(()=>{h.value=!0,O()},c):(h.value=!0,O())}}function z(){D=setTimeout(()=>{h.value=!1,L=setTimeout(()=>{s.value=0},f)},i)}function R(b={}){s.value=100,_=!0,x(),V(),b.error&&(C.value=!0),b.force?(s.value=0,h.value=!1):z()}function V(){clearTimeout(D),clearTimeout(L)}function x(){clearTimeout(v),cancelAnimationFrame(a)}function O(){_=!1;let b;function w(F){if(_)return;b??(b=F);const K=F-b;s.value=Math.max(0,Math.min(100,g(n,K))),a=requestAnimationFrame(w)}a=requestAnimationFrame(w)}let W=()=>{};{const b=m.hook("page:loading:start",()=>{N()}),w=m.hook("page:loading:end",()=>{R()}),F=m.hook("vue:error",()=>R());W=()=>{F(),b(),w(),x()}}return{_cleanup:W,progress:I(()=>s.value),isLoading:I(()=>h.value),error:I(()=>C.value),start:N,set:q,finish:R,clear:x}}function Qt(o={}){const n=ee(),c=n._loadingIndicator=n._loadingIndicator||Xt(o);return Ze()&&(n._loadingIndicatorDeps=n._loadingIndicatorDeps||0,n._loadingIndicatorDeps++,et(()=>{n._loadingIndicatorDeps--,n._loadingIndicatorDeps===0&&(c._cleanup(),delete n._loadingIndicator)})),c}const Yt=Z({name:"NuxtLoadingIndicator",props:{throttle:{type:Number,default:200},duration:{type:Number,default:2e3},height:{type:Number,default:3},color:{type:[String,Boolean],default:"repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)"},errorColor:{type:String,default:"repeating-linear-gradient(to right,#f87171 0%,#ef4444 100%)"},estimatedProgress:{type:Function,required:!1}},setup(o,{slots:n,expose:c}){const{progress:i,isLoading:f,error:g,start:m,finish:s,clear:h}=Qt({duration:o.duration,throttle:o.throttle,estimatedProgress:o.estimatedProgress});return c({progress:i,isLoading:f,error:g,start:m,finish:s,clear:h}),()=>tt("div",{class:"nuxt-loading-indicator",style:{position:"fixed",top:0,right:0,left:0,pointerEvents:"none",width:"auto",height:`${o.height}px`,opacity:f.value?1:0,background:g.value?o.errorColor:o.color||void 0,backgroundSize:`${100/i.value*100}% auto`,transform:`scaleX(${i.value}%)`,transformOrigin:"left",transition:"transform 0.1s, height 0.4s, opacity 0.4s",zIndex:999999}},n)}}),Zt=()=>{const o=new Date,n=ue(),{isHomePage:c}=ce(n),i=I(()=>o.getMonth()===11&&(o.getDate()===24&&o.getHours()>=17||o.getDate()===25||o.getDate()===26)),f=ot("snowFlakesShown",null),g=I(()=>!f.value&&i.value&&c.value);return{snowFlakesShown:f,stopSnowFlakes:()=>{f.value===null&&(f.value=!0)},shouldShowSnowFlakes:g}},eo=()=>{const o=Y(),{basketState:n}=nt(),{setBasketId:c,basketCredentials:i,clearBasketId:f}=pe(),g=Y().public.defaultStoreId,m=de(`${me}-storeId`),s=I(()=>{var C,_;return(C=m.value)!=null&&C.storeId?Number((_=m.value)==null?void 0:_.storeId):Number(g)}),h=()=>{if(!i.value.id)return;const _=st(o.public.subscriptionGateway)("subscription")({listTotals:[i.value,{id:!0,total:!0,subTotal:!0,discount:!0,sup:!0,terms:{id:!0,content:!0,strike:!0},productLines:{id:!0,productId:!0,quantity:!0,normalPrice:!0,offerPrice:!0,productDiscount:!0,strike:!0,productInformation:{headerText:!0,department:!0,webgroup:!0,packaging:!0,image:!0,brand:!0,productAssortment:[{storeId:s.value},{normalPrice:!0,offerPrice:!0,productOffer:{textPriceSign:!0}}]}}}]});_.error(a=>{var L;const v=a;Array.isArray(v)&&v.some(N=>N.extensions.Detail==="Invalid basket")&&(f(),(L=_.ws)==null||L.close())});try{_.on(({listTotals:a})=>{var v;if(a===null){console.warn("Received 'null' for 'listTotals'. Invalid shoppinglist. Clearing basketID and closing websocket"),f(),(v=_.ws)==null||v.close();return}n.value=a})}catch(a){console.error("Error subscribing to messages",a)}window.onblur=()=>{var a;try{(a=_.ws)==null||a.close()}catch(v){console.error("Error closing websocket",v)}},window.onfocus=async()=>{var a;try{(a=_.ws)==null||a.close()}catch(v){console.error("Error closing websocket",v)}await c(),h()}};return{startSubscription:h}},to=Pt(()=>Dt(()=>import("./CsBNR-_Q.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(o=>o.default||o)),oo=Z({__name:"default",async setup(o){let n,c;const i=ue(),f=at(),{$toast:g,$gtm:m,$messages:s,$pwa:h}=ee(),{shouldShowSnowFlakes:C,stopSnowFlakes:_}=Zt(),{userProfile:a}=ae(),{newsletterFloorAdShown:v}=rt(),{open:D,toggleDialog:L}=it(),{clearRouteParamByKey:N}=ae(),{setBasketId:q,basketCredentials:z}=pe(),{startSubscription:R}=eo(),{currentMultiProduct:V,showDrawer:x}=jt(),{photoCakeProduct:O,updatePastries:W,pastriesSaved:b}=Vt(),{openCmsPopup:w,getGlobalPopups:F,newsletterCmsPopupActive:K,cookieNewsletterCmsPopupShow:_e,cookieContentPopupShow:fe}=Kt(),{openListDialog:M,openListBottomSheet:te,toggleList:ge,deleteList:he,openListDialogUpdate:ve,getShoppingListData:oe,triggerView:ne,deleteShoppinglist:be,shoppingListToDelete:E}=lt();X(()=>{var r;return(r=z.value)==null?void 0:r.id},async()=>{z.value.id&&(await q(),R())},{immediate:!0});const we=Y(),ke=I(()=>i.path.startsWith(Et.SEARCH)?[]:[{rel:"canonical",href:`${we.public.website}${i.path}`}]);le({link:ke.value});const H=B({}),ye=B(null);re(async()=>{await ut(),setTimeout(async()=>{try{const r=await F();r&&(H.value=r.reduce((l,y)=>({...l,[String(y.alias)]:y}),{}))}catch(r){console.error("Error fetching global popups:",r),ye.value=r}},100)});const Se=I(()=>{const r=["/mijn-dekamarkt","/mijn-winkelmand","/boodschappenlijsten","/winkels","/services","/meer/folder","/folder","/dekagebak","/meer"];return i.path.includes("/meer/recepten")?!1:r.some(l=>i.path.startsWith(l))}),Ce=I(()=>Le.value?"home":se.value?"basket":""),xe=de(`${me}-cookies-analytics_storage`);X(xe,r=>{var l,y;if(r!==void 0){if(!fe.value&&((l=H.value)!=null&&l[T.CONTENT])){w.value=T.CONTENT;return}!_e.value&&((y=H.value)!=null&&y[T.NEWSLETTER])&&(w.value=T.NEWSLETTER)}},{immediate:!0,deep:!0});const Te=r=>{W([...b.value??[],{...r}]),O.value=void 0},Ie=()=>O.value=void 0,{openConfirmationDialog:U}=ct(),J=()=>{U.value=!1,document.body.classList.remove("locked")},{isBasketPage:se,isHomePage:Le}=ce(i),{clearShoppingList:Ee}=pt(),$=B(!1),Pe=()=>M.value=!0,De=async()=>{if(!E.value)return;if($.value=!0,se.value){if(await Ee(E.value.shoppingListId)){m("shoppingList.delete",{name:E.value.name}),E.value=null,$.value=!1,J(),g.add({id:1,title:s("shoppinglist.deleted.title"),text:s("shoppinglist.deleted.description")});return}$.value=!1}if(await be(String(E.value.shoppingListId))){m("shoppingList.delete",{name:E.value.name}),U.value=!1,E.value=null,$.value=!1,await Lt("/boodschappenlijsten"),await oe(),g.add({id:1,title:s("shoppinglist.deleted.title"),text:s("shoppinglist.deleted.description")});return}$.value=!1,g.add({id:2,text:s("error.common")??""})},Ne=()=>{te.value=!1,setTimeout(()=>ve.value=!0,250)};[n,c]=dt(()=>oe()),await n,c();const Ae=()=>{window.addEventListener("beforeinstallprompt",()=>{m("pwa.install_prompt")}),window.addEventListener("appinstalled",()=>{m("pwa.app_installed")}),h!=null&&h.isPWAInstalled&&m("pwa.pwa_active")};return X(()=>i.path,r=>{r!=="/"&&_()}),re(async()=>{var l,y,G;Ae(),i.query.login&&a.value&&(m("login",{user_id:((y=(l=a==null?void 0:a.value)==null?void 0:l.customer)==null?void 0:y.id)??s("recipes.seo.anonymous")}),g.add({id:3,title:s("authentication.login.title",{name:((G=a.value.customer)==null?void 0:G.firstname)??""}),text:s("authentication.login.message")}));const r=f.currentRoute.value.query;i.query.logout&&(await N("logout",r),g.add({id:4,text:s("authentication.logout.message")})),i.hash==="#list=1"&&(M.value=!0),i.query.login&&await N("login",r)}),(r,l)=>{const y=Ut,G=Yt,Be=At,Re=vt,Oe=bt,Fe=Bt,$e=wt,Me=kt,He=Rt,k=gt,qe=yt,ze=Ot,We=Ft,Ge=$t,j=St,je=Mt,Ve=Tt,Ke=Ht,Ue=qt,Je=zt,Xe=Wt,Qe=Gt,Ye=to;return u(),mt("div",null,[t(y),t(G,{color:e(ht)},null,8,["color"]),_t("main",{class:ft(e(Ce))},[t(Be),t(Re,{class:"header--desktop"}),t(Oe,{class:"header--mobile"}),e(Se)?S("",!0):(u(),p(Fe,{key:0})),t($e),t(Me),t(k,null,{default:d(()=>[!e(K)&&!e(v)?(u(),p(He,{key:0})):S("",!0)]),_:1}),t(qe),t(ze),t(k,null,{default:d(()=>[t(We)]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[t(j,{id:"confirmation__dialog",open:!!e(U),onClose:J},{default:d(()=>{var A;return[t(Ge,{title:e(s)("shoppinglist.confirmation.title")??"",subtitle:e(s)("shoppinglist.confirmation.subtitle")??"",description:e(s)("shoppinglist.confirmation.description",{name:e(Ct)(((A=e(E))==null?void 0:A.name)??e(s)("navigation.header.list")??"")})??"",loading:e($),"confirm-text":"common.buttons.delete",onConfirm:De,onCancel:J},null,8,["title","subtitle","description","loading"])]}),_:1},8,["open"])]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[t(Q,{name:"fade"},{default:d(()=>[e(x)?(u(),p(je,{key:0,open:e(x),"onUpdate:open":l[0]||(l[0]=A=>xt(x)?x.value=A:null),"current-multi-product":e(V)},null,8,["open","current-multi-product"])):S("",!0)]),_:1})]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[r.$device.isMobileOrTablet?(u(),p(j,{key:0,id:"list__dialog",open:e(te),onClose:l[1]||(l[1]=A=>e(ge)("bottom-sheet"))},{default:d(()=>[t(Ve,{onChangeName:Ne,onDeleteList:e(he),onSaveList:Pe},null,8,["onDeleteList"])]),_:1},8,["open"])):S("",!0)]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[e(M)?(u(),p(j,{key:0,id:"list__dialog",open:e(M),"show-back-btn":e(ne)===e(It).CREATE,onBack:l[2]||(l[2]=A=>ne.value=null),onClose:l[3]||(l[3]=A=>M.value=!1)},{default:d(()=>[t(Ke)]),_:1},8,["open","show-back-btn"])):S("",!0)]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[e(D)?(u(),p(j,{key:0,id:"assortment__dialog",open:e(D),onClose:e(L)},{default:d(()=>[t(Ue,{open:e(D),onClose:e(L)},null,8,["open","onClose"])]),_:1},8,["open","onClose"])):S("",!0)]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[t(Q,{name:"fade"},{default:d(()=>[e(O)?(u(),p(Je,{key:0,onSavePictureCake:Te,onEditorClosed:Ie})):S("",!0)]),_:1})]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[e(w)?(u(),p(Xe,{key:0,item:e(H)[e(T).NEWSLETTER],open:e(w)===e(T).NEWSLETTER},null,8,["item","open"])):S("",!0)]))]),_:1}),t(k,null,{default:d(()=>[(u(),p(P,{to:"body"},[e(w)===e(T).CONTENT?(u(),p(Qe,{key:0,open:e(w)===e(T).CONTENT,item:e(H)[e(T).CONTENT]},null,8,["open","item"])):S("",!0)]))]),_:1}),t(k,null,{default:d(()=>[t(Q,{name:"fade-slow"},{default:d(()=>[e(C)?(u(),p(Ye,{key:0,count:150,speed:4,"particle-size":8,color:"rgba(240,240,240,0.9)"})):S("",!0)]),_:1})]),_:1})],2)])}}}),Yo=Nt(oo,[["__scopeId","data-v-57eb0393"]]);export{Yo as default};
