(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7556],{48450:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/recommendations",function(){return n(45030)}])},45030:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return z},default:function(){return P}});var i=n(52322),r=n(11919),a=n(91012),o=n(40110),l=n(81927),s=n(53738),d=n(56133),c=n(50390),u=n(72033),x=n(86365),m=n(85635),h=n(15824),f=n(52692),p=n(34638),g=n(86656),b=n(2784),j=n(5406),v=n(93372),w=n(9893),y=n(20343);function k(e){let{label:t}=e,n=(0,p.ff)("white","gray.dark.500");return(0,i.jsx)(s.xu,{minWidth:12,minHeight:{base:12,md:"3.25rem"},borderRadius:"lg",bg:n,display:"flex",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(a.x,{fontSize:"2xl",fontWeight:"black",children:t})})}var S=function(e){let{name:t,position:n}=e;return(0,i.jsxs)(r.k,{width:{base:"full",md:"23.313rem"},gap:4,"data-testid":"recommendation-item",children:[(0,i.jsx)(k,{label:n}),(0,i.jsx)(a.x,{alignSelf:"center",noOfLines:2,textOverflow:"ellipsis",fontSize:"lg",children:t})]})},E=n(86230);let C=new Map,N=e=>{let[t,n]=(0,b.useState)(null),[i,r]=(0,b.useState)(!1),a=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{if(!a.current)return;let t=new AbortController;return(async()=>{try{let i=C.get(e);if(i){let e=await i;n(e);return}r(!0);let a=await fetch("".concat("/api/restaurant/recommendations","/").concat(e),{method:"GET",signal:t.signal});if(!a.ok){let e=JSON.stringify({message:"Error fetching reviews",status:a.status});throw Error(e)}let o=(await a.json()).recommendations;C.set(e,o),n(o),r(!1)}catch(t){r(!1),t.name,(0,E.H)(t,"Error fetching recommendations",{businessEntityId:e})}})(),()=>{t.abort()}},[e]),(0,b.useEffect)(()=>{a.current=!0},[]),{loading:i,recommendations:t}};function I(){return(0,i.jsxs)(r.k,{direction:"column",alignItems:"center",mt:"2.5rem","data-testid":"zero-state-recommendations",children:[(0,i.jsx)(w.P,{src:"/assets/open-box.svg",width:73,height:73,alt:"no recommendations"}),(0,i.jsx)(a.x,{fontSize:"lg",fontWeight:"bold",textAlign:"center",mt:6,mb:"0.688rem",children:"NO RECOMMENDATIONS"}),(0,i.jsx)(a.x,{variant:"muted",children:"Please allow us some time, and kindly return later."}),(0,i.jsx)(o.i,{maxWidth:"38rem",width:"87.2%",mt:8})]})}function W(){let e=Array.from({length:4},(e,t)=>t);return(0,i.jsx)(r.k,{flexDir:"column",alignItems:"center",gap:6,mt:12,children:e.map(e=>(0,i.jsx)(l.O,{borderRadius:"lg",maxWidth:"37.75rem",width:"full",startColor:"gray.100",endColor:"gray.200",height:{base:"4.75rem",md:"7.063rem"}},e))})}function _(e){let{title:t,items:n,defaultOpen:o,icon:l}=e,{isOpen:m,onToggle:h}=(0,f.q)({defaultIsOpen:null!=o&&o}),j=(0,p.ff)("1px solid var(--gray-200, #E2E2E2)"," 1px solid var(--dm-gray-400, #434343)"),v=(0,p.ff)("black","white");return n&&0!==n.length?(0,i.jsx)(r.k,{borderBottom:j,"data-testid":"recommendation-section",children:(0,i.jsxs)(r.k,{flexDir:"column",children:[(0,i.jsx)(s.xu,{height:{base:"4.75rem",md:"7.063rem"},as:"button",_hover:{cursor:"pointer"},onClick:h,w:"100vw","data-testid":"recommendation-section-button",children:(0,i.jsx)(d.W,{maxWidth:"1260px",height:"auto",overflow:"auto",children:(0,i.jsxs)(r.k,{width:"full",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsxs)(r.k,{gap:4,children:[(0,i.jsx)(s.xu,{w:{base:6,md:8},height:{base:6,md:8},position:"relative",children:(0,i.jsx)(w.P,{src:l,alt:"icon",fill:!0,sizes:"30rem, (max-width: 765px) 32rem"})}),(0,i.jsx)(c.X,{as:"h3",fontSize:{base:"lg",md:"1.75rem"},pb:"1px","data-testid":"recommendation-section-title",children:t})]}),(0,i.jsxs)(r.k,{alignItems:"center",gap:2,children:[(0,i.jsx)(u.c,{below:"md",children:(0,i.jsx)(a.x,{textDecoration:"underline",fontSize:"sm","data-testid":"collapse-text",children:m?"Collapse":"View all (".concat(n.length,")")})}),(0,i.jsx)(g.g8,{width:6,height:6,transition:"transform .3s",transform:m?"rotate(0)":"rotate(180)",color:v})]})]})})}),(0,i.jsx)(x.U,{in:m,animateOpacity:!0,children:(0,i.jsx)(d.W,{maxWidth:"1260px",height:"auto",overflow:"auto",children:(0,i.jsx)(r.k,{mb:{base:6,md:10},flexWrap:"wrap",flexDir:{base:"column",md:"row"},rowGap:8,columnGap:{base:4,md:10},children:n.map((e,t)=>(0,i.jsx)(b.Fragment,{children:(0,i.jsx)(S,{name:e.menuItemName,position:t+1})},e.menuItemId))})})})]})}):null}let O=(e,t,n,i)=>(e||[]).length>0||(i||[]).length>0||(t||[]).length>0||(n||[]).length>0;var z=!0,P=function(e){let{initialRecommendations:t,rtData:n}=e,o=(0,p.ff)("1px solid var(--gray-200, #E2E2E2)"," 1px solid var(--dm-gray-400, #434343)"),l=(0,p.ff)("white","black"),x=(0,v.GP)(e=>e.templateDefinition.recommendations),[f,g]=(0,b.useState)(n[0].entityId),{recommendations:w,loading:k}=N(f),{featuredItemsByFlavor:S,featuredItemsByPortionSize:E,featuredItemsByPresentation:C,featuredItemsByPopularity:z}=null!=w?w:t,P=O(S,E,C,z),R=n.map(e=>{let{name:t,entityId:n}=e;return{label:t,value:n}}),H=R.find(e=>e.value===f)||R[0],D=e=>{let{value:t}=e;g(t)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.c2,{}),(0,i.jsxs)(s.xu,{bg:(0,p.ff)("offWhite","black"),minH:{base:"94vh",md:"90vh"},"data-testid":"recommendations-page",children:[n.length>1&&(0,i.jsx)(u.c,{above:"md",children:(0,i.jsx)(r.k,{px:6,justifyContent:"center",alignItems:"center",height:24,borderBottom:o,bg:l,children:(0,i.jsx)(m.a,{width:"full",onChange:D,options:R,value:R[0],"data-testid":"rt-select-mobile"})})}),(0,i.jsx)(r.k,{alignItems:"center",minHeight:{base:"4.75rem",md:"7rem"},height:"auto",py:{base:"1rem",lg:"0"},borderBottom:o,bg:l,children:(0,i.jsxs)(d.W,{maxWidth:"1230px",marginInline:"auto",paddingInline:6,display:"flex",children:[(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(c.X,{"data-testid":"recommendations-heading",as:"h2",fontWeight:"bold",fontSize:{base:"2xl",md:"5xl"},children:(null==x?void 0:x.title)||"Recommendations"}),(0,i.jsx)(a.x,{color:"grey",fontWeight:600,children:(null==x?void 0:x.subtitle)||"Trying to decide what to eat? Browse the most ordered and highest rated items on our menu."})]}),n.length>1&&(0,i.jsx)(u.c,{below:"md",children:(0,i.jsx)(m.a,{marginLeft:"auto",alignSelf:"center",onChange:D,options:R,value:H,"data-testid":"rt-select"})})]})}),k&&(0,i.jsx)(W,{}),!k&&!P&&(0,i.jsx)(I,{}),!k&&(0,i.jsx)(_,{title:"Most Popular",items:z,icon:"/assets/MostPopular.svg",defaultOpen:!0}),!k&&(0,i.jsx)(_,{title:"Highest Rated for Flavor",items:S,icon:"/assets/Flavor.svg",defaultOpen:!0}),!k&&(0,i.jsx)(_,{title:"Highest Rated for Portion Size",items:E,icon:"/assets/Portion%20Size.svg",defaultOpen:!0}),!k&&(0,i.jsx)(_,{title:"Highest Rated for Presentation",items:C,icon:"/assets/Presentation.svg",defaultOpen:!0})]}),(0,i.jsx)(j.GN,{}),(0,i.jsx)(h.d,{below:"md",children:(0,i.jsx)(y.h,{})})]})}},86365:function(e,t,n){"use strict";n.d(t,{U:function(){return x}});var i=n(21056),r=n(31053),a=n(94589),o=n(75009),l=n(2784),s=n(52322),d=e=>null!=e&&parseInt(e.toString(),10)>0,c={exit:{height:{duration:.2,ease:i.Lj.ease},opacity:{duration:.3,ease:i.Lj.ease}},enter:{height:{duration:.3,ease:i.Lj.ease},opacity:{duration:.4,ease:i.Lj.ease}}},u={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{...e&&{opacity:d(t)?1:0},height:t,transitionEnd:null==r?void 0:r.exit,transition:null!=(o=null==n?void 0:n.exit)?o:i.p$.exit(c.exit,a)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:null==r?void 0:r.enter,transition:null!=(o=null==n?void 0:n.enter)?o:i.p$.enter(c.enter,a)}}},x=(0,l.forwardRef)((e,t)=>{let{in:n,unmountOnExit:i,animateOpacity:d=!0,startingHeight:c=0,endingHeight:x="auto",style:m,className:h,transition:f,transitionEnd:p,...g}=e,[b,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>{j(!0)});return()=>clearTimeout(e)},[]),(0,r.ZK)({condition:Number(c)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});let v=parseFloat(c.toString())>0,w={startingHeight:c,endingHeight:x,animateOpacity:d,transition:b?f:{enter:{duration:0}},transitionEnd:{enter:null==p?void 0:p.enter,exit:i?null==p?void 0:p.exit:{...null==p?void 0:p.exit,display:v?"block":"none"}}},y=!i||n,k=n||i?"enter":"exit";return(0,s.jsx)(a.M,{initial:!1,custom:w,children:y&&(0,s.jsx)(o.E.div,{ref:t,...g,className:(0,r.cx)("chakra-collapse",h),style:{overflow:"hidden",display:"block",...m},custom:w,variants:u,initial:!!i&&"exit",animate:k,exit:"exit"})})});x.displayName="Collapse"},85635:function(e,t,n){"use strict";n.d(t,{a:function(){return c}});var i=n(86656),r=n(34638),a=n(53738),o=n(91012),l=n(40110),s=n(2784),d=n(52322);function c(e){let{onChange:t,value:n,options:c,defaultLabel:u="Select","data-testid":x,isDisabled:m,...h}=e,[f,p]=(0,s.useState)(!1),g=(0,r.ff)("gray.200","gray.dark.400"),b=(0,r.ff)("black","white"),j=(0,r.ff)("white","gray.dark.500"),v=(0,r.ff)("gray.200","gray.dark.600"),w=(null==n?void 0:n.label)||u,y=e=>{t(e),p(!1)};return(0,d.jsxs)(a.xu,{className:"wrapper",w:80,h:"48px",borderRadius:f?"6px 6px 0 0":"md",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:f?b:g,_hover:{borderColor:b,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)"},bg:j,transition:"300ms ease all",style:m?{pointerEvents:"none",opacity:"0.4"}:{},...h,children:[(0,d.jsxs)(a.xu,{display:"flex",alignItems:"center",className:"input-placeholder",borderRadius:f?"6px 6px 0 0":"md",h:"100%",onClick:()=>p(!f),backgroundColor:f?j:"transparent",pl:4,pr:3,children:[(0,d.jsx)(o.x,{className:"label","data-testid":x||"",fontSize:"18px",flexGrow:1,children:w}),(0,d.jsxs)(o.x,{className:"icon",fontSize:"25px",children:[!f&&(0,d.jsx)(i.v4,{}),f&&(0,d.jsx)(i.g8,{})]})]}),f&&(0,d.jsx)(a.xu,{zIndex:1e3,className:"menu",borderWidth:"1px",borderStyle:"solid",borderColor:b,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:"0 0 12px 12px",ml:"-1px",w:"calc(100% + 2px)",position:"absolute",cursor:"pointer",maxHeight:"300px",overflowY:"auto",overflowX:"hidden",backgroundColor:j,children:null==c?void 0:c.map((e,t)=>(0,d.jsxs)("div",{"data-testid":"".concat(x,"-option-").concat(t),children:[(0,d.jsx)(o.x,{className:"menu-item",height:"52px",p:4,display:"flex",flexDirection:"column",justifyContent:"center",backgroundColor:e.value===(null==n?void 0:n.value)?v:j,fontSize:"18px",_hover:{fontWeight:"700",backgroundColor:v},onClick:()=>y(e),children:e.label}),t<c.length-1&&(0,d.jsx)(l.i,{opacity:1,my:0,mx:4})]},e.label))})]})}}},function(e){e.O(0,[6525,4424,8092,9097,1904,679,243,9414,5195,9577,8922,3474,9919,7188,655,5319,343,2888,9774,179],function(){return e(e.s=48450)}),_N_E=e.O()}]);