1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1578],{13054:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/panier",function(){return n(63017)}])},63017:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return ec},default:function(){return ed}});var i=n(85893),r=n(96486),o=n.n(r),l=n(18745),a=n(61730),c=n(68573),d=n(56912),s=n(93646),u=n(40913),p=n(23818),m=n(53839),x=n(55895),h=n(96788),f=n(60990),g=n(51015),v=n(34598),y=n(94438),j=n(6316),Z=n(30766),b=n(69233),C=n(11032),P=n(28325),w=n(96095),A=e=>{var t;let{orderItem:n}=e,{state:r,dispatch:o}=(0,y.bp)(),l=(0,w.k)(),a=e=>()=>{e>0&&o({type:"CHANGE_CART_AMOUNT",payload:{...n,quantity:e}}),0===e&&l.onTrue()};return(0,i.jsxs)(Z.UK,{children:[(0,i.jsxs)(c.ZP,{container:!0,spacing:3,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[(0,i.jsx)(c.ZP,{item:!0,xs:2,children:(0,i.jsx)(x.Z,{alt:null==n?void 0:n.name,src:null==n?void 0:n.imageUrl,variant:"rounded"})}),(0,i.jsxs)(c.ZP,{item:!0,xs:6,children:[(0,i.jsxs)(h.Z,{className:"itemTitle",children:[(null==n?void 0:n.code)?"".concat(n.code,"."):"",null==n?void 0:n.name]}),(null==n?void 0:null===(t=n.itemQuestions)||void 0===t?void 0:t.length)>0?(0,i.jsx)(b.Z,{answers:(0,C.G0)(n).answers}):"",(0,i.jsxs)(f.Z,{sx:{display:{xs:"block",sm:"none"},fontSize:"13px",fontWeight:600},children:[(0,i.jsx)(u.Dr,{color:"primary.main",children:(0,j.Aq)((0,j.jD)(n))}),(null==n?void 0:n.specialPrice)>0&&(0,i.jsx)(u.Dr,{color:"grey.600",pl:1,children:(0,i.jsx)("del",{children:(0,j.Aq)((null==n?void 0:n.unitPrice)*(null==n?void 0:n.quantity))})})]})]}),(0,i.jsx)(c.ZP,{item:!0,xs:4,sm:2,children:(0,i.jsxs)(v.hs,{alignItems:"center",children:[(0,i.jsx)(g.Z,{color:"primary",sx:{p:"5px"},variant:"outlined",disabled:(null==n?void 0:n.quantity)===0,onClick:a((null==n?void 0:n.quantity)-1),children:(0,i.jsx)(p.Z,{fontSize:"small"})}),(0,i.jsx)(u.Dr,{mx:1,fontWeight:600,fontSize:15,children:null==n?void 0:n.quantity}),(0,i.jsx)(g.Z,{color:"primary",sx:{p:"5px"},variant:"outlined",onClick:a((null==n?void 0:n.quantity)+1),children:(0,i.jsx)(m.Z,{fontSize:"small"})})]})}),(0,i.jsxs)(c.ZP,{item:!0,sm:2,sx:{display:{xs:"none",sm:"block"}},textAlign:"right",children:[(0,i.jsx)(f.Z,{fontWeight:"600",color:"primary.main",children:(0,j.Aq)((0,j.jD)(n))}),(null==n?void 0:n.specialPrice)>0&&(0,i.jsx)(f.Z,{color:"grey.600",fontWeight:"600",children:(0,i.jsx)("del",{children:(0,j.Aq)((null==n?void 0:n.unitPrice)*(null==n?void 0:n.quantity))})})]})]}),(0,i.jsx)(P.Z,{open:l.value,onClose:l.onFalse,title:"Supprimer ".concat(null==n?void 0:n.name," ?"),content:"Voulez-vous vraiement supprimer ".concat(null==n?void 0:n.name," ?"),action:(0,i.jsx)(g.Z,{variant:"contained",color:"error",onClick:()=>{o({type:"CHANGE_CART_AMOUNT",payload:{...n,quantity:0}}),l.onFalse()},children:"Supprimer"})})]})},S=n(1837),I=n(67294),_=n(14934),k=n(68044),T=n(71191),M=n(88477),z=n(30236),N=n(86010),E=n(48551),q=n(28777);n(19331);var H=n(77527);let R=e=>{let{theme:t,showDots:n,dot_margin_top:i,showArrowOnHover:r}=e;return{width:40,border:0,height:40,borderRadius:"50%",alignItems:"center",position:"absolute",justifyContent:"center",transform:"translateY(-50%)",display:r?"none":"flex",boxShadow:"0px 10px 30px rgba(0, 0, 0, 0.1)",background:t.palette.secondary.main,color:t.palette.secondary.contrastText,top:"calc(50% - ".concat(n?i:"0px",")"),"&:disabled":{background:t.palette.text.disabled,color:t.palette.secondary.main,cursor:"not-allowed"},"&:hover:not(:disabled)":{background:t.palette.secondary.main,color:t.palette.secondary.contrastText},[t.breakpoints.down("xs")]:{display:"block !important"}}},D=(0,H.ZP)(q.sj)(e=>{let{spacing:t}=e;return{minWidth:0,position:"relative","& .focusRing___1airF.carousel__slide-focus-ring":{outline:"none !important"},"& .carousel__inner-slide":{margin:"auto",width:"calc(100% - ".concat(t||"0px",")")},"&:hover $arrowButton":{display:"flex"}}}),O=(0,H.ZP)(q.iR)(e=>{let{spacing:t}=e;return{marginLeft:"calc(-1 * ".concat(t||"0px"," / 2)"),marginRight:"calc(-1 * ".concat(t||"0px"," / 2)")}}
1),L=(0,H.ZP)(q.I5)(e=>{let{dot_margin_top:t}=e;return{display:"flex",justifyContent:"center",marginTop:t||"0px"}}),V=(0,H.ZP)("div")(e=>{let{dot_color:t,dot_active:n,theme:i}=e;return{width:16,height:16,borderRadius:300,margin:"0.25rem",cursor:"pointer",position:"relative",border:"1px solid ".concat(t||i.palette.secondary.main),"&:after":{width:9,height:9,top:"50%",left:"50%",content:'" "',borderRadius:300,position:"absolute",transform:"translate(-50%, -50%) scaleX(".concat(n?1:0,")"),backgroundColor:t||i.palette.secondary.main}}}),W=(0,H.ZP)(q.jp)(e=>{let{theme:t,showArrowOnHover:n,showDots:i,dot_margin_top:r}=e;return{...R({theme:t,showDots:i,showArrowOnHover:n,dot_margin_top:r}),[t.breakpoints.down("md")]:{height:"36px",width:"36px",left:"-12px"}}}),U=(0,H.ZP)(q.P1)(e=>{let{theme:t,showArrowOnHover:n,showDots:i,dot_margin_top:r}=e;return{...R({theme:t,showDots:i,showArrowOnHover:n,dot_margin_top:r}),[t.breakpoints.down("md")]:{height:"36px",width:"36px",right:"-12px"}}}),B=e=>{let{step:t,dotColor:n,totalSlides:r,currentSlide:o,visibleSlides:l,carouselStore:a}=e,c=[],d=r-l+1,s=(e,t)=>{a.setStoreState({autoPlay:t,currentSlide:e})};for(let e=0;e<d;e+=t)c.push((0,i.jsx)(V,{dot_color:n,onClick:()=>s(e,!1),dot_active:o===e?e+1:0},(Math.random()*e+Date.now()).toString())),d-(e+1)<t&&d-(e+1)!=0&&c.push((0,i.jsx)(V,{dot_color:n,dot_active:r-l,onClick:()=>s(r-l,!1)},(Math.random()*e+Date.now()).toString()));return c};var F=e=>{let{sx:t={},step:n=1,spacing:r="1.5rem",infinite:o=!1,children:l,autoPlay:a=!1,interval:c=2e3,showDots:d=!1,dotClass:s,dotColor:u,showArrow:p=!0,totalSlides:m,currentSlide:x,visibleSlides:h=5,leftButtonClass:f,leftButtonStyle:g={},arrowButtonClass:v,rightButtonClass:y,rightButtonStyle:j={},hasMasterSpinner:Z=!1,isIntrinsicHeight:b=!0,naturalSlideWidth:C=100,dotGroupMarginTop:P="2rem",naturalSlideHeight:w=125,arrowButtonColor:A="secondary"}=e,{settings:S}=(0,E.Z)();return(0,i.jsxs)(D,{sx:t,step:n,spacing:r,interval:c,infinite:o,isPlaying:a,totalSlides:m,currentSlide:x,visibleSlides:h,hasMasterSpinner:Z,isIntrinsicHeight:b,naturalSlideWidth:C||100,naturalSlideHeight:w||125,children:[(0,i.jsx)(O,{spacing:r,children:I.Children.map(l,(e,t)=>(0,i.jsx)(q.Mi,{index:t,children:e}))}),d&&(0,i.jsx)(L,{className:(0,N.Z)(s),dot_margin_top:P,renderDots:e=>B({...e,step:n,dotColor:u})}),p&&(0,i.jsxs)(I.Fragment,{children:[(0,i.jsx)(W,{id:"backArrowButton",sx:{left:"-20px"},style:g||{},className:(0,N.Z)(f,v),children:"ltr"===S.direction?(0,i.jsx)(M.Z,{fontSize:"small",color:"inherit"}):(0,i.jsx)(z.Z,{fontSize:"small",color:"inherit"})}),(0,i.jsx)(U,{id:"backForwardButton",sx:{right:"-20px"},style:j||{},className:(0,N.Z)(v,y),children:"ltr"===S.direction?(0,i.jsx)(z.Z,{fontSize:"small",color:"inherit"}):(0,i.jsx)(M.Z,{fontSize:"small",color:"inherit"})})]})]})},G=n(45544),Y=n(31038),Q=e=>{let{products:t}=e,n=(0,T.Z)(),[r,o]=(0,I.useState)(6);return((0,I.useEffect)(()=>{n<370?o(1):n<650?o(2):n<950?o(4):o(6)},[n]),t)?(0,i.jsx)(G.Z,{icon:(0,i.jsx)(k.Z,{}),title:"Recommander",seeMoreLink:"#",children:(0,i.jsx)(f.Z,{my:"-0.25rem",children:(0,i.jsx)(F,{totalSlides:null==t?void 0:t.length,autoPlay:!0,interval:6e3,visibleSlides:r,children:null==t?void 0:t.map(e=>(0,i.jsx)(f.Z,{py:.5,children:(0,i.jsx)(Y.Z,{product:e})},null==e?void 0:e.id))})})}):(0,i.jsxs)(f.Z,{children:[(0,i.jsx)(_.Z,{}),(0,i.jsx)(_.Z,{animation:"wave"}),(0,i.jsx)(_.Z,{animation:!1})]})},X=n(90184),K=n(4205),$=()=>(0,i.jsxs)(K.bP,{children:[(0,i.jsx)(X.Z,{icon:"bi:bag",width:64,sx:{my:3}}),(0,i.jsx)(u.H2,{children:"Votre panier est vide"}),(0,i.jsx)(h.Z,{children:"Consultez notre carte et ajoutez des produits \xe0 votre commande."}),(0,i.jsx)(g.Z,{href:"/carte",sx:{my:3},fullWidth:!0,color:"primary",variant:"contained",children:"Voir la carte"})]}),J=n(95852),ee=n(11163),et=n(84166),en=n(68789),ei=e=>{var t,n,r;let{product:o,cart:l}=e,{state:a,dispatch:d}=(0,y.bp)(),s=null===(t=a.cart)||void 0===t?void 0:t.filter(e=>e.productType!==en.fY.Accompaniement),x=(e,t)=>()=>{e.productType=en.fY.Accompaniement;var n,i,r=(0,j.ww)(e,t),c=0,s=o.unitPrice;if(l&&(null==l?void 0:l.additionalPrice)>0&&(s=l.unitPrice+l.additionalPrice),(null==o?void 0:null===(n=o.accompaniements)||void 0===n?void 0:n.length)>0){r.accompaniementId=null==l?void 0:l.id;let n=null===(i=a.cart)||void 0===i?void 0:i.filter(e=>e.accompaniementId&&e.accompaniementId===(null==l?void 0:l.id)),u=0;
1if(o.accompaniements.forEach(i=>{if(i.productId===e.productId&&i.accompaniementId===e.accompaniementId)u+=t;else{var r;let e=null===(r=n.find(e=>e.productId===i.accompaniementId))||void 0===r?void 0:r.quantity;e&&e>0&&(u+=e)}}),c=(null==l?void 0:l.maxQuantity)>0?u>l.maxQuantity?(u-l.maxQuantity)*s:0:u*s,(null==n?void 0:n.length)>1){let e=!1;if(n.forEach(n=>{n.productId===r.productId?(n.quantity=t,n.unitPrice=s,t>0&&!e&&c>0&&(e=!0,n.totalPrice=c,r.totalPrice=c),d({type:"CHANGE_CART_AMOUNT",payload:{...r}})):d({type:"CHANGE_CART_AMOUNT",payload:{...n,totalPrice:0}})}),!e&&c>0){let e=n.filter(e=>e.accompaniementId===r.accompaniementId&&e.quantity>0);e.length>0&&e.forEach((e,t)=>{0===t?(e.totalPrice=c,e.unitPrice=s,d({type:"CHANGE_CART_AMOUNT",payload:{...e,totalPrice:c}})):d({type:"CHANGE_CART_AMOUNT",payload:{...e,totalPrice:0}})})}}else n.forEach(e=>{d({type:"CHANGE_CART_AMOUNT",payload:{...e,totalPrice:0}})}),d({type:"CHANGE_CART_AMOUNT",payload:{...r,totalPrice:c,unitPrice:s}})}else c=(null==l?void 0:l.maxQuantity)>0?t>l.maxQuantity?(t-l.maxQuantity)*e.unitPrice:0:t*e.unitPrice,r.unitPrice=e.unitPrice,r.totalPrice=c,d({type:"CHANGE_CART_AMOUNT",payload:r})},h=e=>{let{product:t,cart:n,cartItem:r}=e;return(0,i.jsx)(Z.UK,{children:(0,i.jsxs)(c.ZP,{container:!0,spacing:3,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[(0,i.jsx)(c.ZP,{item:!0,xs:8,sm:6,children:(0,i.jsxs)(et.Z,{direction:"row",alignItems:"center",gap:1,children:[(null==t?void 0:t.icon)&&(0,i.jsx)(X.Z,{icon:null==t?void 0:t.icon,width:32}),(0,i.jsxs)(u.Dr,{ellipsis:!0,fontWeight:"500",fontSize:14,children:[null==t?void 0:t.name,(0,i.jsx)(f.Z,{sx:{display:{xs:"block",sm:"none"},fontSize:"13px"},children:(null==r?void 0:r.quantity)>0?(null==r?void 0:r.totalPrice)>0?"+ ".concat((0,j.Aq)(null==r?void 0:r.totalPrice)):"Gratuit":"--"})]})]})}),(0,i.jsx)(c.ZP,{item:!0,xs:4,children:(0,i.jsxs)(v.hs,{alignItems:"center",children:[(0,i.jsx)(g.Z,{color:"primary",sx:{p:"5px"},variant:"outlined",disabled:!((null==r?void 0:r.quantity)>0),onClick:x(t,((null==r?void 0:r.quantity)||0)-1),children:(0,i.jsx)(p.Z,{fontSize:"small"})}),(0,i.jsx)(u.Dr,{mx:1,fontWeight:600,fontSize:15,children:null==r?void 0:r.quantity}),(0,i.jsx)(g.Z,{color:"primary",sx:{p:"5px"},variant:"outlined",disabled:(null==s?void 0:s.length)===0,onClick:x(t,((null==r?void 0:r.quantity)||0)+1),children:(0,i.jsx)(m.Z,{fontSize:"small"})})]})}),(0,i.jsx)(c.ZP,{item:!0,sm:2,sx:{display:{xs:"none",sm:"block"}},textAlign:"right",children:(0,i.jsx)(f.Z,{fontWeight:"600",color:"primary.main",children:(null==r?void 0:r.quantity)>0?(null==r?void 0:r.totalPrice)>0?"+ ".concat((0,j.Aq)(null==r?void 0:r.totalPrice)):"Gratuit":"--"})})]})})};if((null==o?void 0:null===(n=o.accompaniements)||void 0===n?void 0:n.length)>0)return(0,i.jsx)(i.Fragment,{children:o.accompaniements.map(e=>{var t;let n=null===(t=a.cart)||void 0===t?void 0:t.find(t=>t.productId==e.accompaniementId);return(0,i.jsx)(h,{product:{...e,id:e.accompaniementId,unitPrice:o.unitPrice,productType:en.fY.Accompaniement},cart:l,cartItem:n},"acc_".concat(o.id,"_").concat(e.id))})});{let e=null===(r=a.cart)||void 0===r?void 0:r.find(e=>e.productId==(null==o?void 0:o.id));return(0,i.jsx)(h,{product:o,cart:l,cartItem:e})}},er=e=>{let{accompaniements:t,carts:n}=e;return(0,i.jsx)(f.Z,{children:null==t?void 0:t.map(e=>{let t=null==n?void 0:n.find(t=>t.accompaniementId===e.id);return(0,i.jsx)(ei,{product:e,cart:t},"acc_".concat(e.id))})})},eo=n(46604),el=n(54887);let ea={base:"/api/Families",getAll(e){return eo.ZP.get("".concat(this.base).concat(e?"?".concat(el.Z.stringify(e)):""))},getById(e){return eo.ZP.get("".concat(this.base,"/").concat(e))}};var ec=!0,ed=()=>{var e;let t=(0,l.Z)(),{push:n}=(0,ee.useRouter)(),[r,p]=(0,I.useState)([]),[m,x]=(0,I.useState)([]),[h,f]=(0,I.useState)(null),{state:g,restaurant:v,isAuthenticated:Z,accompaniements:b,dispatch:P}=(0,y.bp)(),w=g.cart,_=null==w?void 0:w.filter(e=>e.productType!==en.fY.Accompaniement).reduce((e,t)=>e+t.quantity,0),k=(0,a.Z)(t.breakpoints.down("xs")),T="/panier/informations";(0,I.useEffect)(()=>{M()},[_]);let M=(0,I.useCallback)(async()=>{var e=null==w?void 0:w.filter(e=>{var t;return(null===(t=e.accompaniements)||void 0===t?void 0:t.length)>0}).flatMap(e=>[...e.accompaniements]);let t=o().groupBy(e,"accompaniementId");p(o().map(t,e=>({...e[0],maxQuantity:o().sumBy(e,e=>{let t=w.find(t=>t.productId===e.productId),n=(null==t?void 0:t.quantity)?null==t?void 0:t.quantity:1;return e.maxQuantity*n}
1)})))},[_]);(0,I.useEffect)(()=>{z()},[]);let z=(0,I.useCallback)(async()=>{try{f("loading"),ea.getAll({orderBy:"position, name",pageSize:5,includeProduct:!0,available:!0,isRecommended:!0,activeCache:!1}).then(e=>{let t=e.data.records.flatMap(e=>e.products);x((0,C.zj)(t)),f("done")}).catch(e=>console.log(e))}catch(e){console.error(e)}},[null===(e=g.order)||void 0===e?void 0:e.shopId]),N=(0,I.useCallback)(()=>{if(console.log("initialDefaultAccompaniements run"),_>0&&(null==r?void 0:r.length)>0&&(null==b?void 0:b.length)>0){var e=[];r.forEach(t=>{var n;let i=null==b?void 0:b.find(e=>e.id===t.accompaniementId);if((null==i?void 0:null===(n=i.accompaniements)||void 0===n?void 0:n.length)>0){if(t.maxQuantity>1)i.accompaniements.forEach(n=>{var r=(0,j.ww)({...n,id:n.accompaniementId,unitPrice:i.unitPrice,productType:en.fY.Accompaniement},1);r.accompaniementId=t.id,e.push(r)});else{var r=(0,j.ww)({...i.accompaniements[0],id:i.accompaniements[0].accompaniementId,unitPrice:i.unitPrice,productType:en.fY.Accompaniement},1);r.accompaniementId=t.id,e.push(r)}}else{var r=(0,j.ww)(i,1);r.productType=en.fY.Accompaniement,e.push(r)}}),e.length>0&&P({type:"UPDATE_ACCOMPANIEMENTS",payload:e=e.filter(e=>e.productId)})}},[_,r,b]);(0,I.useEffect)(()=>{let e=null==w?void 0:w.filter(e=>e.productType===en.fY.Accompaniement);(null==e?void 0:e.length)===0&&_>0&&(null==r?void 0:r.length)>0&&(null==b?void 0:b.length)>0&&N()},[_,r,b]);let E=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.H2,{sx:{my:2,color:"grey.200"},children:"Vos produits"}),null==w?void 0:w.filter(e=>e.productType!==en.fY.Accompaniement).map((e,t)=>(0,i.jsx)(A,{orderItem:e},"shop_item_".concat(e.productId,"_").concat(t)))]}),q=(0,I.useRef)(null);return(0,i.jsxs)(S.Z,{handleConfirm:()=>{Z?n(T):q.current.toggleLogin()},restaurant:v,children:[(0,i.jsx)(s.Z,{title:"Mon panier"}),(0,i.jsxs)(c.ZP,{container:!0,spacing:3,children:[(0,i.jsx)(c.ZP,{item:!0,md:7,xs:12,children:(null==w?void 0:w.filter(e=>e.productType!==en.fY.Accompaniement).length)>0?E:(0,i.jsx)($,{})}),(0,i.jsx)(c.ZP,{item:!0,md:5,xs:12,children:b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.H2,{sx:{my:2,color:"grey.200"},children:"Accompagnements"}),(0,i.jsx)(er,{accompaniements:b,carts:r})]})})]}),(0,i.jsx)(d.Z,{sx:{my:4}}),"done"===h&&(null==m?void 0:m.length)>0&&(0,i.jsx)(Q,{products:m}),(0,i.jsx)(J.Z,{isMobile:k,ref:q,returnUrl:T})]})}},68044:function(e,t,n){"use strict";var i=n(85893),r=n(31589);n(67294),t.Z=e=>(0,i.jsx)(r.Z,{...e,viewBox:"0 0 22 20",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5354 0.87868C15.3638 -0.292893 13.4644 -0.292893 12.2928 0.87868L10.8786 2.29289C10.8183 2.35317 10.7611 2.41538 10.707 2.47931C10.653 2.41539 10.5958 2.3532 10.5355 2.29293L9.12132 0.878715C7.94975 -0.292858 6.05025 -0.292858 4.87868 0.878715C3.70711 2.05029 3.70711 3.94978 4.87868 5.12136L5.75732 6H0V12H2V20H20V12H22V6H15.6567L16.5354 5.12132C17.707 3.94975 17.707 2.05025 16.5354 0.87868ZM13.707 5.12132L15.1212 3.70711C15.5117 3.31658 15.5117 2.68342 15.1212 2.29289C14.7307 1.90237 14.0975 1.90237 13.707 2.29289L12.2928 3.70711C11.9023 4.09763 11.9023 4.7308 12.2928 5.12132C12.6833 5.51184 13.3165 5.51184 13.707 5.12132ZM9.12132 3.70714L7.70711 2.29293C7.31658 1.9024 6.68342 1.9024 6.29289 2.29293C5.90237 2.68345 5.90237 3.31662 6.29289 3.70714L7.70711 5.12136C8.09763 5.51188 8.7308 5.51188 9.12132 5.12136C9.51184 4.73083 9.51184 4.09767 9.12132 3.70714ZM20 8V10H2V8H20ZM11.9167 12H18V18H11.9167V12ZM10.0834 12V18H4V12H10.0834Z",fill:"#D23F57"})})},1837:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var i=n(85893),r=n(67294),o=n(11163),l=n(77527),a=n(60990),c=n(18745),d=n(61730),s=n(735),u=n(36795),p=n(88539),m=n(52857),x=n(96788),h=n(51015),f=n(56656),g=n(81873),v=n(34598),y=e=>{let{selectedStep:t=1,stepperList:n,isMobile:o,onChange:l}=e,[c,d]=(0,r.useState)(t-1),s=(e,t)=>()=>{!e.disabled&&(d(t),l&&l(t))};return(0,r.useEffect)(()=>{d(t-1)},[t]),(0,i.jsx)(v.b0,{flexWrap:"wrap",my:"-4px",children:n.map((e,t)=>(0,i.jsxs)(r.Fragment,{children:[(0,i.jsx)(g.Z,{disabled:e.disabled,label:"".concat(t+1).concat(e.disabled&&o?"":". ".concat(e.title)),onClick:s(e,t),sx:{backgroundColor:t<=c?"primary.main":"primary.light",color:t<=c?"primary.contrastText":"primary.main",p:"0.5rem",fontSize:"13px",fontWeight:"500",my:"4px","&:hover:not(:disabled)":{backgroundColor:"primary.main",color:"primary.contrastText"}}}),t<n.length-1&&(0,i.jsx)(a.Z,{width:o?"20px":"50px",height:"4px",bgcolor:t<c?"primary.main":"primary.light"})]},e.title))})},j=n(90184),Z=n(94438),b=n(62365),C=n(40913),P=n(11032),w=n(6316),A=n(31812),S=e=>{var t;let{status:n,handleConfirm:o}=e,{state:l}=(0,Z.bp)(),[a,c]=(0,r.useState)(0);(0,r.useEffect)(()=>{c((0,P.UR)(l))},[null==l?void 0:l.orderType]);let d=(0,P.m_)(null==l?void 0:l.cart,null==l?void 0:l.order,!1),s=(null==l?void 0:l.order)?(0,P.bb)(null==l?void 0:l.order):0;return(0,i.jsxs)(b.im,{children:[(0,i.jsxs)(b.D,{children:[(0,i.jsxs)(C.H3,{children:["Total : ",(0,w.Aq)(d-s)]}),a>0&&d<a&&(0,i.jsxs)(x.Z,{children:["Minimum de commande est ",(0,w.Aq)(a)," !"]})]}),(0,i.jsx)(b.D,{children:(0,i.jsx)(A.Z,{fullWidth:!0,color:"secondary",onClick:o,loading:n&&"loading"===n,loadingIndicator:"Veuillez patienter...",variant:"contained",disabled:a>0&&d<a||!((null==l?void 0:null===(t=l.cart)||void 0===t?void 0:t.length)>0)||0===d,children:(0,i.jsx)("span",{children:"Suivant"})})})]})};let I={fontSize:"14px","@media only screen and (max-width: 678px)":{display:"none"}};var _=n(22024);let k=(0,l.ZP)(a.Z)(e=>{let{theme:t}=e;return{height:"auto",color:t.palette.grey[200],background:t.palette.marron[900],paddingBottom:"120px","& header":{background:t.palette.marron[900]},"& .handle":{cursor:"pointer"},"& .content":{height:"100%"}}}),T=[{title:"Votre panier",disabled:!1},{title:"Vos informations",disabled:!0},{title:"Paiement",disabled:!0}];var M=e=>{let{returnPath:t,children:n,restaurant:l,status:a,disableNavbar:g,handleConfirm:v}=e,Z=(0,c.Z)(),b=(0,d.Z)(Z.breakpoints.down(678)),[C,P]=(0,r.useState)(0),w=(0,o.useRouter)(),{pathname:A}=w;return((0,r.useEffect)(()=>{switch(A){case"/panier":P(1);break;case"/panier/informations":P(2);break;case"/panier/paiement":case"/panier/paiement/payzenv1/return/[id]":P(3)}},[A]),l&&!1===l.isOpen)?(0,i.jsx)(_.Z,{}):(0,i.jsxs)(k,{children:[(0,i.jsx)(s.Z,{styles:{body:{backgroundColor:Z.palette.marron[900]}}}),(0,i.jsx)(u.Z,{sx:{position:"relative",mb:3},children:(0,i.jsxs)(p.Z,{children:[(0,i.jsxs)(m.Z,{href:t||"/carte",edge:"start",color:"inherit",sx:I,children:[(0,i.jsx)(j.Z,{icon:"mingcute:left-fill",width:32})," Retour"]}
1),(0,i.jsx)(x.Z,{sx:{ml:2,flex:1},variant:"h6",component:"div",children:(0,i.jsx)(y,{stepperList:T,selectedStep:C,onChange:e=>{switch(e){case 0:w.push("/panier");break;case 1:w.push("/panier/informations");break;case 2:w.push("/panier/paiement");break;case 3:w.push("/orders")}},isMobile:b})}),(0,i.jsx)(h.Z,{href:"/carte",autoFocus:!0,color:"inherit",children:(0,i.jsx)(j.Z,{icon:"line-md:close",width:32})})]})}),(0,i.jsx)(f.Z,{className:"content",children:n}),!g&&(0,i.jsx)(S,{status:a,handleConfirm:v})]})}},62365:function(e,t,n){"use strict";n.d(t,{D:function(){return d},im:function(){return c}});var i=n(77527),r=n(60990),o=n(70178),l=n(32451),a=n(3685);let c=(0,i.ZP)(r.Z)(e=>{let{theme:t}=e;return{left:0,right:0,bottom:0,display:"flex",position:"fixed",width:"100vw",justifyContent:"space-around",zIndex:t.zIndex.drawer+1,color:t.palette.grey[200],height:a.P.mobileNavHeight,backgroundColor:t.palette.marron[700],boxShadow:"0px 1px 4px 3px rgba(0, 0, 0, 0.1)"}});(0,i.ZP)(l.OL)({flex:"1 1 0",display:"flex",fontSize:"13px",alignItems:"center",flexDirection:"column",justifyContent:"center"});let d=(0,i.ZP)(r.Z)(e=>{let{theme:t}=e;return{flex:"1 1 0",display:"flex",fontSize:"13px",alignItems:"left",flexDirection:"column",justifyContent:"center",padding:"0px 20px","& button":{height:"40px",fontSize:"18px",color:t.palette.grey[200]},".Mui-disabled":{color:t.palette.grey[300]}}});(0,i.ZP)(o.ZP)(e=>{let{theme:t,totalheight:n}=e;return{width:250,flexShrink:0,"& .MuiDrawer-paper":{width:250,boxSizing:"border-box",boxShadow:t.shadows[2]}}})},4205:function(e,t,n){"use strict";n.d(t,{Bw:function(){return u},a9:function(){return p},bP:function(){return s},m4:function(){return c},qh:function(){return a},x4:function(){return d}});var i=n(85893),r=n(77527),o=n(60990),l=n(60762);let a=(0,r.ZP)(o.Z)(e=>{let{theme:t}=e;return{margin:"auto",height:"auto",paddingTop:50,maxWidth:"650px","& .MuiTab-root":{fontSize:"18px",fontWeight:"700"},"& .MuiInputBase-root, .MuiInputAdornment-root p, .MuiCheckbox-root":{color:t.palette.grey[200]},"& .MuiFormLabel-root":{color:t.palette.grey[500]},"& .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.marron[200]},"& .MuiOutlinedInput-notchedOutline::hover":{borderColor:t.palette.marron[200]},"& .MuiListItem-root":{margin:"10px 0px",padding:"5px 0px",backgroundColor:t.palette.marron[700],borderRadius:"5px"},"& .MuiSkeleton-root":{backgroundColor:t.palette.grey[600]}}}),c=(0,r.ZP)(l.Z)(e=>{let{theme:t}=e;return{boxShadow:"none",cursor:"pointer",border:"1px solid",position:"relative",backgroundColor:t.palette.marron[700],"&.card-checked":{backgroundColor:t.palette.marron[400],color:t.palette.grey[200]},"& .MuiCardHeader-root":{padding:"10px"},"& .MuiCardContent-root":{padding:"0px 10px 10px"}}}),d=e=>{let{children:t,value:n,index:r,...l}=e;return(0,i.jsx)("div",{role:"tabpanel",hidden:n!==r,id:"full-width-tabpanel-".concat(r),"aria-labelledby":"full-width-tab-".concat(r),...l,children:n===r&&(0,i.jsx)(o.Z,{sx:{p:3},bgcolor:"marron.800",children:t})})},s=(0,r.ZP)(o.Z)(e=>{let{theme:t}=e;return{paddingBottom:"120px",color:t.palette.grey[200],margin:"auto",height:650,maxWidth:350,padding:20,paddingTop:100,textAlign:"center","& h2":{fontSize:24,textAlign:"center",marginBottom:20,lineHeight:1.3,color:t.palette.grey[200]},"& p":{color:t.palette.marron.main}}}),u={"& .MuiTab-root":{fontSize:"16px"}},p={width:"100%","& .MuiListItemIcon-root":{minWidth:"25px"},"@media only screen and (max-width: 678px)":{"& .MuiListItemText-root p":{fontSize:"14px"}}}}},function(e){e.O(0,[3662,4255,5302,8050,8573,8939,6310,788,604,7279,3372,5415,3749,5664,3475,2888,9774,179],function(){return e(e.s=13054)}),_N_E=e.O()}]);
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.