(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"+89e":function(e,t){},"+9EZ":function(e,t,n){"use strict";n.r(t),n.d(t,"mapResponsiveImageSetContentModelToResponsiveImageProps",(function(){return r}));var r=function(e){return{src:e.small.file.url,mdSrc:e.medium&&e.medium.file.url,lgSrc:e.large&&e.large.file.url}}},"+hSc":function(e,t){},"//bI":function(e,t){},"/u5P":function(e,t){},"02Mq":function(e,t){},"0UC8":function(e,t){},"0bbM":function(e,t){},"0dqJ":function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("AxPg");t.default=function(e){var t=e.baseModel;return o.createElement("div",{className:"flex-grow-1",style:{maxWidth:r.breakpoints.large,margin:"0 auto"}},o.createElement(r.ResponsiveVideoEmbed,{src:Object(i.buildVideoUrl)(t.source,t.videoId),allowFullScreen:!0}))}},"1+pq":function(e,t,n){"use strict";n.r(t);var r,o=n("p+7n"),i=n("q1tI"),a=n("TSYQ"),c=n.n(a),l=n("IujW"),u=n.n(l),s=n("AxPg"),d=n("CQ3q"),m=n("9538");!function(e){e.Video="Leading",e.Text="Trailing",e.Equal="None"}(r||(r={}));var f=function(e,t){return e===r.Equal?"col-12 col-lg-6":e===t?"col-12 col-lg-8":"col-12 col-lg-4"},p=function(e){var t=e.id,n=e.title,a=e.backgroundColor,l=e.text,p=e.textColor,g=e.textAlignment,v=void 0===g?o.Alignment.Left:g,b=e.button,h=e.videoSource,C=e.videoId,S=e.videoOnRight,y=e.skew,P=void 0===y?r.Equal:y,k=Object(m.a)(),w="py-0",x="py-4 py-lg-5";n&&(w=void 0,x="py-4 py-lg-0");var E="px-0 px-lg-4";return a&&(E="px-3 px-lg-4"),i.createElement(o.PageSection,{id:t,title:n,verticalSpaceClassName:w,childrenContainerClassName:S?"flex-lg-row-reverse":""},i.createElement("div",{className:c()("d-flex flex-column",E,x,f(P,r.Video),Object(o.getFlexAlignmentClasses)(o.Alignment.Center,"col")),style:{color:p,backgroundColor:a}},i.createElement(o.ResponsiveVideoEmbed,{src:Object(s.buildVideoUrl)(Object(s.stringToVideoSource)(h),C)})),i.createElement("div",{className:c()("d-flex flex-column",E,x,f(P,r.Text),Object(o.getFlexAlignmentClasses)(v,"col")),style:{color:p,backgroundColor:a}},i.createElement(u.a,{className:"w-100",source:l,allowedTypes:["root","text","break","paragraph","emphasis","strong","thematicBreak","blockquote","delete","link","image","linkReference","list","listItem","heading"],unwrapDisallowed:!0,renderers:k}),b&&i.createElement(d.a,b)))},g=n("wlLi"),v=n("RJQD");t.default=function(e){var t,n=e.baseModel,a=n.callToAction&&Object(g.mapActionButton)(n.callToAction),c=n.childContentfulVideoTwoColumnSectionTextTextNode?n.childContentfulVideoTwoColumnSectionTextTextNode.text:"";return i.createElement(p,{id:n.id,backgroundColor:Object(v.getColor)(n.backgroundColor),title:n.title,text:c,button:a,textAlignment:Object(o.mapAlignment)(n.textAlignment),textColor:Object(v.getColor)(n.textColor),skew:(t=n.skew,r[t]),videoOnRight:n.videoOnRight,videoId:n.videoId,videoSource:n.videoSource})}},"1i8N":function(e,t,n){"use strict";n.r(t),n.d(t,"mapHeroCardContentModelToProp",(function(){return o}));var r=n("E8HI"),o=function(e,t){return{title:e.title,image:Object(r.getImageModel)(e.image),description:e.description,type:null!=t?t:e.cardType}}},"1xVR":function(e,t){},"2Kix":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u}));var r=n("mNz5"),o=n.n(r),i=n("Yfyt"),a="//via.placeholder.com",c={small:"576x300",medium:i.a.Medium+"x400",large:i.a.Large+"x650"},l=o()("picture"),u={large:{src:a+"/"+c.large,id:l+"-fallback-lg"},medium:{src:a+"/"+c.medium,id:l+"-fallback-md"},small:{src:a+"/"+c.small,id:l+"-fallback-sm"}}},"2xBr":function(e,t,n){"use strict";n.r(t),n.d(t,"getSelectedBrand",(function(){return o})),n.d(t,"getSelectedSku",(function(){return i}));var r=n("FFKw"),o=function(){if("undefined"!=typeof window)try{return new URLSearchParams(window.location.search).get(r.QueryParams.selectedBrand)}catch(e){console.error(e)}},i=function(){if("undefined"!=typeof window)try{return new URLSearchParams(window.location.search).get(r.QueryParams.sku)}catch(e){console.error(e)}}},"3L66":function(e,t,n){var r=n("MMmD"),o=n("ExA7");e.exports=function(e){return o(e)&&r(e)}},"3RUi":function(e,t){},"3cYt":function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},"3qt6":function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n("q1tI"),o=n("TJpk"),i=n.n(o),a=n("vOnD"),c=a.default.div.withConfig({displayName:"ratingsReviewsIo__StyledRatingsWidgetMedium",componentId:"sc-18pu5t9-0"})(["@media (max-width:1024px){display:none;}height:67px;pointer-events:none;"]),l=a.default.div.withConfig({displayName:"ratingsReviewsIo__StyledRatingsWidgetSmall",componentId:"sc-18pu5t9-1"})(["@media (min-width:1024px){display:none;}height:61px;pointer-events:none;"]),u=function(){var e=r.useState(""),t=e[0],n=e[1],o=r.useState(""),a=o[0],u=o[1];return r.useEffect((function(){var e,t;null!==(e=document.getElementById("ratings-widget-medium"))&&void 0!==e&&e.hasChildNodes()||n('\n        reviewsBadgeRibbon("ratings-widget-medium", {\n          store: "myfoodbag-co-nz",\n          size: "medium",\n        });\n          '),null!==(t=document.getElementById("ratings-widget-small"))&&void 0!==t&&t.hasChildNodes()||u('\n        reviewsBadgeRibbon("ratings-widget-small", {\n          store: "myfoodbag-co-nz",\n          size: "small",\n        });\n      ')}),[]),r.createElement(r.Fragment,null,r.createElement(i.a,null,r.createElement("script",null,t),r.createElement("script",null,a)),r.createElement("div",{className:"d-flex w-100 justify-content-center flex-wrap"},r.createElement(c,{id:"ratings-widget-medium"}),r.createElement(l,{id:"ratings-widget-small"})))}},"3vk5":function(e,t){},"3y7o":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=function(e){var t=e.question,n=e.answer;return r.createElement("div",{className:"col-12 col-md-6 py-4 px-0 px-md-3"},r.createElement("h4",null,t),r.createElement("p",{className:"m-0"},n))};t.default=function(e){var t=e.baseModel;return r.createElement(o,{question:t.question,answer:t.answer.answer})}},"40Is":function(e,t){},"4rPF":function(e,t,n){"use strict";n.r(t);for(var r=n("q1tI"),o=n("T33S"),i={},a=o.default.length-1;a>=0;a--)i[o.default[a].name]=n("epGF")(""+o.default[a].path).default;t.default=function(e,t,n){return e&&e.map((function(e,o){return function(e,t,n,o){if(i.hasOwnProperty(e.__typename)){var a=i[e.__typename];e.position=o;var c={baseModel:e};t&&(c.pageSettings=t),n&&(c.navProps=n);var l=9999*Math.random();return r.createElement(a,Object.assign({key:e.__typename+"-"+e.id+"-"+l},c))}return null}(e,t,n,o+1)})).filter((function(e){return e}))}},"5Yvf":function(e,t){},"5npC":function(e,t){},"6E1d":function(e,t){},"6FQD":function(e,t,n){"use strict";n.r(t)},"6IB/":function(e,t,n){"use strict";n.r(t)},"6l8G":function(e,t){},"6nK8":function(e,t,n){var r=n("dVn5"),o=n("fo6e"),i=n("dt0z"),a=n("9NmV");e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?a(e):r(e):e.match(t)||[]}},"6rZg":function(e,t){},"7/KX":function(e,t){},"7bJe":function(e,t,n){"use strict";n.r(t)},"8F2k":function(e,t){},"8q8R":function(e,t,n){"use strict";n.r(t);var r=n("HaE+"),o=n("Y+p1"),i=n.n(o),a=n("afOK"),c=n.n(a),l=(n("ToJy"),n("o0o1")),u=n.n(l),s=n("z0sf"),d=n("p+7n"),m=n("Wbzz"),f=n("q1tI"),p=n("QWMy"),g=n("ZmDi"),v=n("Vjiz"),b=n("MIz4"),h=n("GFwS"),C=n("ShJo"),S=function(e){var t,n=e.baseModel,o=e.pageSettings,a=e.renderAs,l=e.site,m=e.allProductDb,S=n,y=null;"undefined"!=typeof window&&(y=new URLSearchParams(window.location.search).get("sku"));var P=f.useState((function(){return S.products.map((function(e){return Object(g.getProductModel)(e,m,l.siteMetadata.gatewayUrl)})).filter(d.isNotNullOrUndefined)}))[0],k=Object(s.useStock)()[1],w=f.useState([]),x=w[0],E=w[1];f.useEffect((function(){(function(){var e=Object(r.a)(u.a.mark((function e(){var t,n,r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(t=new h.a).setApiKey("31d648fc-7d81-41fa-9e9a-65e34bd36aa0","",""),n=new h.b(t,"https://test-scullery.myfoodbag.co.nz/website",C.b),r=P.map((function(e){return e.sku})).join(","),e.next=7,n.productsStockByskusAvailability(r).then((function(e){return e}));case 7:return e.abrupt("return",e.sent);case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load primary product addons. "+e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}})()().then((function(e){var t=null==e?void 0:e.filter((function(e){return e.hasStockAvailable})).map((function(e){return e.sku}));E(null!=t?t:[])}))}),[]);var M=function(e,t,n){var r;return 1===t.length?c()(t):n?c()(t.filter((function(e){return e.sku===n}))):null!==(r=c()(t.filter((function(t){return t.proteins&&e.every((function(e){var n;return null===(n=t.proteins)||void 0===n?void 0:n.includes(e)}))}))))&&void 0!==r?r:c()(t)},O={generateLink:function(e){var t=P.find((function(t){return t.sku===e})),n=l.siteMetadata.accountUrl+"/manage/subscriptions/extras/addbysku/"+e;return Object(b.getProductSelectEventPath)(n,V,t)}},T=function(e,t){var n,r,o,a,l,u=c()(P.filter((function(e){return e.sku===t})));if(t&&u)return null!==(a=null===(l=c()(e.products.filter((function(e){return e.sku===u.itemNumber}))))||void 0===l?void 0:l.protein)&&void 0!==a?a:[];var s,m=null!==(n=null===(r=e.defaultProductGroupProteins)||void 0===r||null===(o=r.map((function(e){return e.proteinName})).filter(d.isNotNullOrUndefined))||void 0===o?void 0:o.sort())&&void 0!==n?n:[],f=P.filter((function(e){return x.includes(e.sku)})).map((function(e){return{sku:e.sku,itemNumber:e.itemNumber}})),p=e.products.filter((function(e){return f.some((function(t){return t.sku===e.sku||t.itemNumber===e.sku}))})),g=p.find((function(e){var t;return i()(null===(t=e.protein)||void 0===t?void 0:t.sort(),m.sort())}));return m.length>0&&p.length>0&&!g?null===(s=c()(p))||void 0===s?void 0:s.protein:m},j=f.useState(T(S,y)),N=j[0],I=j[1],F=f.useState(M(N,P)),A=F[0],B=F[1],R=f.useState(N),L=R[0],D=R[1],H=Object(v.getProductGroupModel)(S,P.filter((function(e){return e.sku===(null==A?void 0:A.sku)})));f.useEffect((function(){I(T(S,y))}),[x]),f.useEffect((function(){B(M(N,P))}),[N]);var G=Object(v.getProteinSelectors)(S.productGroupProtein,N),q=Object.assign({},H,{description:H.description,hidePrice:P.length>1&&N.length<2,proteinSelector:G?{maxCheckCount:2,proteinSelectors:G,proteinSelectionOrder:L,onClick:function(e){var t,n,r;i()(N,e.sort())||(D((t=e,n=N.filter((function(e){return t.includes(e)})),r=t.filter((function(e){return!n.includes(e)})),n.concat(r))),I(e))}}:void 0,preselectedPeople:o&&o.preselectedPeople,preselectedDinners:o&&o.preselectedDinners,productType:null!==(t=null==A?void 0:A.productType)&&void 0!==t?t:s.ProductType.Primary,productSelectEvent:O,position:S.position}),U="section"===a||!1,K=A&&(null==A?void 0:A.availableFrequency);f.useEffect((function(){K&&K===s.AvailableFrequency.OneOff&&P.forEach((function(e){return k({type:s.StockActionType.registerOneOff,sku:e.sku})}))}),[K,k,P]),f.useEffect((function(){K&&K===s.AvailableFrequency.OneOff&&A&&A.productType===s.ProductType.Primary&&(localStorage.removeItem(p.c),localStorage.removeItem(p.b))}),[K,A]);var V=(null==A?void 0:A.productType)===s.ProductType.Primary;H.products.map((function(e){var t;return e.recipeCollections=null===(t=e.recipeCollections)||void 0===t?void 0:t.map((function(e){return e.collections=e.collections.map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e})),e})),e}));var z={showSelector:!1,products:q.products.map((function(e){return Object.assign({},e,{description:""})}))};return U?f.createElement(f.Fragment,null,f.createElement(s.ProductGroupSection,Object.assign({},q,{isRecipeModalEnabled:!0}))):f.createElement(s.ProductGroupCard,Object.assign({},q,V?{}:z,{cardType:s.ProductGroupCardLayout[S.cardType]}))};t.default=function(e){return f.createElement(m.b,{query:"3353766699",render:function(t){return f.createElement(S,Object.assign({},e,t))}})}},9538:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("q1tI"),o=n("IujW"),i=n.n(o).a.renderers.heading,a=function(){return{heading:function(e){var t;switch(e.level){case 1:t="display-3";break;case 2:t="display-4"}return r.cloneElement(i(e),{className:t})}}}},"9NmV":function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",a="[a-z\\xdf-\\xf6\\xf8-\\xff]",c="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",s="[A-Z\\xc0-\\xd6\\xd8-\\xde]",d="(?:"+a+"|"+c+")",m="(?:"+s+"|"+c+")",f="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",p="[\\ufe0e\\ufe0f]?"+f+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",l,u].join("|")+")[\\ufe0e\\ufe0f]?"+f+")*"),g="(?:"+[i,l,u].join("|")+")"+p,v=RegExp([s+"?"+a+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,s,"$"].join("|")+")",m+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,s+d,"$"].join("|")+")",s+"?"+d+"+(?:['’](?:d|ll|m|re|s|t|ve))?",s+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,g].join("|"),"g");e.exports=function(e){return e.match(v)||[]}},"9PsL":function(e,t,n){"use strict";n.r(t);var r=n("7tbW"),o=n.n(r),i=n("q1tI"),a=n("p+7n"),c=n("AVYR"),l=n("OQbj"),u=function(e){var t=e.shortCode,n=e.style,r="https://instagram.com/p/"+t+"/media/?size=m";return i.createElement("a",{href:"https://instagram.com/p/"+t+"/",target:"_blank",rel:"noopener noreferrer"},i.createElement("img",{src:r,alt:t,width:"100%",style:n}))},s=function(e){var t=e.id,n=e.title,r=e.shortCodes,o=e.iconUrl,s=e.profileHandle;return i.createElement(a.PageSection,{id:t,wrap:!0},i.createElement(c.a,{classNames:"d-flex flex-wrap justify-content-center align-items-center",link:"https://instagram.com/"+s+"/"},o&&i.createElement(l.a,{classNames:"pr-3",image:o,style:{maxHeight:"3em",maxWidth:"3em"}}),n&&i.createElement("h1",{className:"display-3 mx-auto text-center "},n)),r&&r.length>1&&i.createElement("div",{className:"d-flex justify-content-center flex-wrap pt-4 w-100"},r.map((function(e,t){return i.createElement("div",{className:"col-6 p-1 col-md-3 p-md-0",key:"instagram-"+t+"-"+e},i.createElement(u,{shortCode:e}))}))))};t.default=function(e){var t=e.baseModel,n=new RegExp("/p/([^/]+)/"),r=t.postLinks&&t.postLinks.length>=4&&o()(t.postLinks),a=r&&r.map((function(e){var t=n.exec(e);return t&&t[t.length-1]||""})).filter((function(e){return""!==e})),c=a&&a.length>=4?a.slice(0,4):[];return i.createElement(s,{id:t.id,profileHandle:t.profileHandle,shortCodes:c,title:t.title,iconUrl:t.icon&&t.icon.file.url})}},A28u:function(e,t,n){"use strict";n.r(t)},AVYR:function(e,t,n){"use strict";var r=n("p+7n"),o=n("q1tI");t.a=function(e){var t=e.link,n=e.classNames,i=e.style,a=e.children;return o.createElement(r.SmartLink,{className:n,href:t,style:Object.assign({},i,{textDecoration:"inherit",color:"inherit",cursor:t?"pointer":"default"})},a&&o.createElement(o.Fragment,null,a))}},AxPg:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"VideoSource",(function(){return r})),n.d(t,"stringToVideoSource",(function(){return o})),n.d(t,"buildVideoUrl",(function(){return i})),function(e){e.YouTube="YouTube",e.Vimeo="Vimeo"}(r||(r={}));var o=function(e){return r[e]},i=function(e,t){switch(e){case r.YouTube:return"https://youtube.com/embed/"+t+"?rel=0";case r.Vimeo:return"https://player.vimeo.com/video/"+t+"?title=0&portrait=0&byline=0"}}},BTFV:function(e,t){},Bqjl:function(e,t){},BsSj:function(e,t){},Bw8J:function(e,t,n){"use strict";n.r(t)},"C+De":function(e,t){},CQ3q:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n("dI71"),o=n("p+7n"),i=n("TSYQ"),a=n.n(i),c=n("q1tI"),l=n("pg3q"),u=function(e){function t(){return e.apply(this,arguments)||this}Object(r.a)(t,e);var n=t.prototype;return n.handleClick=function(){var e=this.props.scrollTarget;e&&Object(l.b)(e)},n.render=function(){var e=this,t=this.props,n=t.url,r=t.label,i=t.scrollTarget,l=t.buttonType,u=t.className,s="";switch(l){case"Primary":s="btn-primary";break;case"Secondary":s="btn-secondary";break;case"Made":s="btn-made";break;default:s="btn-primary"}return c.createElement(c.Fragment,null,n&&c.createElement(o.SmartLink,{className:a()("btn",s,u),href:n},r),i&&c.createElement("button",{name:"button",type:"button",value:r,onClick:function(){return e.handleClick()},className:a()("btn",s,u)},r))},t}(c.PureComponent)},CaaT:function(e,t){},ChCS:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){var n,r=e&&(null!==(n=e.edges.find((function(e){return e.node.sku===t})))&&void 0!==n?n:e.edges.find((function(e){return e.node.itemNumber===t})));return r&&r.node}},Cu3c:function(e,t){},"D56/":function(e,t,n){"use strict";n.r(t)},DU8A:function(e,t){},F17q:function(e,t,n){"use strict";n.r(t),n.d(t,"handleCampaignToggleDefaultState",(function(){return o})),n.d(t,"handleCampaignToggle",(function(){return i})),n.d(t,"removeCampaignCodeFromUrl",(function(){return a}));var r=n("FFKw"),o=function(e){if("undefined"!=typeof window)try{var t=new URLSearchParams(window.location.search).get(r.QueryParams.campaignCode);return!(!t||t!==e)}catch(n){console.error(n)}return!1},i=function(e,t){if("undefined"!=typeof window)try{var n=new URL(window.location.origin),o=new URLSearchParams(window.location.search);t?(o.delete(r.QueryParams.campaignCode),o.append(r.QueryParams.campaignCode,e)):o.has(r.QueryParams.campaignCode)&&o.delete(r.QueryParams.campaignCode),o.forEach((function(e,t){n.searchParams.append(t,e)})),window.history.pushState({},"",n)}catch(i){console.error(i)}},a=function(e){if("undefined"!=typeof window)try{var t=new URL(window.location.origin),n=new URLSearchParams(window.location.search),o=n.get(r.QueryParams.campaignCode);o&&o===e&&n.delete(r.QueryParams.campaignCode),n.forEach((function(e,n){t.searchParams.append(n,e)})),window.history.pushState({},"",t)}catch(i){console.error(i)}}},FFKw:function(e,t,n){"use strict";n.r(t),n.d(t,"QueryParams",(function(){return o}));var r,o,i=n("HaE+"),a=n("7tbW"),c=n.n(a),l=n("FyPc"),u=n.n(l),s=n("noZS"),d=n.n(s),m=n("zZ0H"),f=n.n(m),p=n("TYy9"),g=n.n(p),v=n("afOK"),b=n.n(v),h=n("J2m7"),C=n.n(h),S=n("zqxM"),y=n.n(S),P=n("o0o1"),k=n.n(P),w=(n("XbcX"),n("c9m3"),n("z0sf")),x=n("p+7n"),E=n("Wbzz"),M=n("q1tI"),O=n("vOnD"),T=n("RJQD"),j=n("ZmDi"),N=n("MIz4"),I=n("TSYQ"),F=n.n(I),A=n("3qt6"),B=n("eZYV"),R=n("F17q"),L=n("2xBr"),D=((r={})[x.Brand.MFB]="My Choice",r[x.Brand.RMM]="Ready Made",r[x.Brand.FS]="Fresh Start",r[x.Brand.BB]="Bargain Box",r);!function(e){e.campaignCode="campaignCode",e.selectedBrand="selectedBrand",e.sku="sku"}(o||(o={}));var H="38",G="40",q="41",U=["37","49","50"],K={38:"Veggie & Plant Based",40:"Gluten Free",41:"Gourmet"},V={"My Choice":{blurb:"Something for everyone with 30+ delicious recipes.",skus:["K00000005","K00000008","K00000006","K00000009","K00000007","K00000010","K00000041","K00000042","K00000043"],valuePropositions:[]},"Fresh Start":{blurb:"Deliciously healthy calorie-controlled meals for weight loss.",skus:["K00000020","K00000021","K00000022","K00000023","K00000024","K00000025","K00000032","K00000033","K00000034"],valuePropositions:[]},"Veggie & Plant Based":{blurb:"A delicious variety of vegetarian and plant-based recipes.",skus:["K00000026","K00000027","K00000028","K00000029","K00000030","K00000031"],valuePropositions:[]},"Bargain Box":{blurb:"Choose from our range of family faves and crowd pleasers.",skus:["K00000017","K00000011","K00000014","K00000018","K00000012","K00000015","K00000019","K00000013","K00000016"],valuePropositions:[]},"Gluten Free":{blurb:"Gluten free recipes.",skus:["K00000049","K00000050","K00000051","K00000052","K00000053","K00000054"],valuePropositions:[]},Gourmet:{blurb:"Gourmet dishes.",skus:["M00000019","M00000157"],valuePropositions:[]},"Ready Made":{blurb:"Fresh and fast ready made meals by My Food Bag.",skus:["K00000001","K00000002","K00000003","K00000004"],valuePropositions:[{imageUrl:"https://mfbstatic.blob.core.windows.net/value-propositions/made-meals-full-1.jpg",headerText:"MADE for You",bodyText:"Choose from 15+ meals each week to suit all tastes & lifestyles."},{imageUrl:"https://mfbstatic.blob.core.windows.net/value-propositions/made-meals-full-2.jpg",headerText:"MADE Fresh",bodyText:"Freshly made each week from local free range or free farmed ingredients."},{imageUrl:"https://mfbstatic.blob.core.windows.net/value-propositions/made-meals-full-3.jpg",headerText:"MADE by Hand",bodyText:"Handmade in New Zealand and delivered straight to your door."}]}},z=Object(O.default)(w.BagSelector).withConfig({displayName:"ContentfulBagSelector__StyledBagSelector",componentId:"sc-1igsgxv-0"})(["&&{[role='toolbar']{&.btn-toolbar{@media ","{margin-right:3em;}}}}"],x.LegoBaseTheme.layout.deviceMediaQueries.min.lg),J=O.default.div.withConfig({displayName:"ContentfulBagSelector__RatingsWrapper",componentId:"sc-1igsgxv-1"})(["margin-top:48px;@media ","{margin-top:32px;}"],(function(e){return e.theme.layout.deviceMediaQueries.max.md}));t.default=function(e){var t,n,r,o,a,l,s=e.baseModel,m=e.pageSettings,p=void 0===m?{}:m,v=Object(B.c)().sortByArray,h=s,S=Object(L.getSelectedSku)(),P=Object(L.getSelectedBrand)(),O={},I=h.bagSelectorVariant!==w.BagSelectorLayoutVariant.default,_=M.useState(),Q=_[0],W=_[1];h.abTestId&&(O["data-ab-test-id"]=h.abTestId),h.isHidden&&(O.role="presentation");var Y=M.useState({recipeCollections:[],showDateSelector:null!==(t=h.carouselWeekSelector)&&void 0!==t&&t,disableDetails:null!==(n=h.carouselDisableRecipeDetail)&&void 0!==n&&n,carouselItemVariant:null!==(r=b()(h.carouselItemStyle))&&void 0!==r?r:x.RecipeCarouselItemVariants.Default,showEmptySrcImages:!1}),Z=Y[0],X=Y[1],$=Object(w.useDiscountContext)(),ee=$.discount,te=$.isLoading,ne=Object(B.a)().trackDataLayerEvent,re=M.useState(),oe=re[0],ie=re[1],ae=M.useState([]),ce=ae[0],le=ae[1],ue=Object(E.e)("3680153258"),se=ue.allProductDb,de=ue.site,me=ue.allPreferences,fe=h.brand,pe="e88abcd7-6ca8-4334-90a0-2b27658629a8",ge="0defb70f-d802-4432-a464-dc21106ce827",ve=M.useState("default"===fe?de.siteMetadata.brand:fe),be=ve[0],he=ve[1],Ce=((o={})[x.Brand.BB]="BARGAIN",o[x.Brand.FS]="FRESH",o[x.Brand.MFB]="MFB",o[x.Brand.RMM]="RMM",o),Se=me.edges.flatMap((function(e){return e.node})),ye=Se.map((function(e){var t,n=void 0;return e.preferenceId===Number(q)?n="Premium option":e.preferenceId===Number(G)&&(n="NEW"),{brand:e.brand,sortOrder:e.sortOrder,preferenceId:null!==(t=e.preferenceId)&&void 0!==t?t:0,displayName:e.displayName,description:e.description,preferenceName:e.preferenceName,iconSvg:e.iconSvg,state:x.StateType.default,pillBadge:n}})),Pe=Se.filter((function(e){return e.brand===Ce[be]})),ke=se.edges.flatMap((function(e){return e.node})).map((function(e){return Object(j.getProductModel)({__typename:h.__typename,description:"",sku:e.sku,dinners:e.numberOfNights,people:e.numberOfPeopleToFeed,id:e.id,hideServingPrice:!1,isSoldOut:!1},se,de.siteMetadata.gatewayUrl)})).filter((function(e){return Boolean(e)})),we=d()(V,(function(e){return h.disabledSkus?e.skus.filter((function(e){return!h.disabledSkus.includes(e)})):e.skus})),xe=(new w.ProductsMappingService).groupProductModelCollectionByItemNumber(ke,we),Ee=new w.BagSelectorStateService(xe,[D[x.Brand.RMM]]),Me=p.preselectedPeople,Oe=xe.filter((function(e){return e.productGroupName===D[be]})).flatMap((function(e){return e.products})).find((function(e){return e.itemNumber===S})),Te=xe.filter((function(e){return e.productGroupName===D[be]})).flatMap((function(e){return e.products})).filter((function(e){return e.serves===Me})),je=null!==(a=null==Oe?void 0:Oe.sku)&&void 0!==a?a:null===(l=u()(Te,(function(e){return e.night})))||void 0===l?void 0:l.sku,Ne=I?"Meals per week":"How many nights?",Ie=function(){var e;return null===(e=Object.entries(V).map((function(e){return{groupName:e[0],data:e[1]}})).find((function(e){return e.groupName===D[be]})))||void 0===e?void 0:e.data.valuePropositions},Fe=M.useState({title:"Select your plan",skuSelectorService:Ee,productsLabel:"Tell us what you like.",nightsLabel:I?"Meals per week":"How many nights?",servingsLabel:I?"Number of people":"Number of people?",skuOverride:je,hideDisabled:{nights:h.hideDisabledStateForNights,servings:h.hideDisabledStateForServings},valuePropositions:Ie()}),Ae=Fe[0],Be=Fe[1];M.useEffect((function(){P&&he(P)}),[P]),M.useEffect((function(){var e=be===x.Brand.RMM;Be(Object.assign({},Ae,{productOverride:Q||D[be],isReadyMadeMeal:e,hideDisabled:{nights:e,servings:e},nightsLabel:e?"Single serve meals per week":Ne,valuePropositions:Ie()}))}),[Q,be]);var Re=M.useState(),Le=Re[0],De=Re[1],He=M.useCallback((function(e){var t,n=ke.find((function(t){return t.itemNumber===e})),r=C()(V,(function(e){return e.skus.findIndex((function(e){return e===(null==n?void 0:n.itemNumber)}))>=0})),o=null!==(t=null==n?void 0:n.recipeCollections)&&void 0!==t?t:[],i=g()(o.map((function(e){return e.collections})));return{product:n,productMetadata:r,recipeCollections:i}}),[]),Ge=M.useCallback((function(e){var t,n,r=He(null==e?void 0:e.itemNumber),o=r.product,i=r.productMetadata,a=r.recipeCollections;if(I&&!Q||(X(Object.assign({},Z,{recipeCollections:a})),Be(Object.assign({},Ae,{productsLabel:h.productBlurb||(null==i?void 0:i.blurb),isReadyMadeMeal:be===x.Brand.RMM,valuePropositions:Ie()}))),o){var c=Object(w.calculateDiscount)(ee,o),l=c.price,u=c.serving,s=null!==(t=o.productType)&&void 0!==t?t:w.ProductType.Primary,d=l.original!==l.discounted,m=Boolean(u&&s===w.ProductType.Primary),f=o.deliveryPrice,p=f>0,g=(parseFloat(l.discounted)+f).toFixed(2),v={showPricePerPlateDiscount:d,showPricePerWeekDiscount:d,pricePerWeek:"$"+l.discounted,pricePerWeekBeforeDiscount:"$"+l.original,pricePerPlate:m?"$"+(null==u?void 0:u.discounted):void 0,pricePerPlateBeforeDiscount:m?"$"+(null==u?void 0:u.original):void 0,deliveryPrice:p?"$"+f.toFixed(2):void 0,totalPrice:p?"$"+g:void 0,primaryButtonText:null!==(n=h.productPurchaseCtaText)&&void 0!==n?n:"Continue",pricePerPlateStringFormat:"Per Plate",pricePerWeekStringFormat:"Per Week"};De(v),ie(e)}}),[h,ee,te,He,be,Q,Ae.productOverride]),qe=function(e){var t=ke.find((function(t){return t.sku===e})),n=Boolean(t&&t.productType===w.ProductType.Primary),r=de.siteMetadata.accountUrl+"/manage/subscriptions/extras/addbysku/"+e,o=Pe.filter((function(e){return ce.find((function(t){return t&&e&&t===""+e.preferenceId}))})).filter(f.a),i=new URLSearchParams,a=Ue();if(a&&i.set("campaignCode",a),ce.some((function(e){return U.includes(e)}))&&i.set("ebd","1"),I){var c=o.filter((function(e){return""+e.preferenceId!==q}));i.set("prefs",c.map((function(e){return e.preferenceId})).join(",")),i.set("ss","1")}ne("add_to_cart",{campaign_code:a,subscription_people:null==t?void 0:t.people.toString(),subscription_nights:null==t?void 0:t.dinners.toString(),selected_brand:be,bag_sku:e,preferences:o.map((function(e){return null==e?void 0:e.displayName})).join("|")});var l=i.toString();return Object(N.getProductSelectEventPath)(r,n,t,l)},Ue=function(){var e=window.location.search;return new URLSearchParams(e).get("campaignCode")},Ke=function(){var e=Object(i.a)(k.a.mark((function e(){var t;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:oe&&(t=h.useV4OrderForm?"/signup/personal-details?sku="+oe.sku:qe(oe.sku),window.open(t,"_self"));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=M.useCallback((function(e){var t=Pe.filter((function(t){return e.includes(""+t.preferenceId)})),n=null==oe?void 0:oe.itemNumber,r=t.flatMap((function(e){return e.filters})).flatMap((function(e){return null==e?void 0:e.recipes})).flatMap((function(e){return null==e?void 0:e.items})).map((function(e){var t;return null!==(t=null==e?void 0:e.itemNumber)&&void 0!==t?t:""})).filter(f.a);return{heroSku:n,recipeNumbers:c()(r)}}),[null==oe?void 0:oe.itemNumber]);M.useEffect((function(){if(I&&!Q){var e=Ve(ce),t=e.heroSku,n=e.recipeNumbers,r=He(t).recipeCollections.map((function(e){return Object.assign({},e,{recipes:v(e.recipes,n,(function(e){return e.rnumber}))})}));X(Object.assign({},Z,{recipeCollections:r}))}}),[ce,Ve,I]);var ze=M.useState(Object(R.handleCampaignToggleDefaultState)(pe)),Je=ze[0],_e=ze[1],Qe=M.useState(Object(R.handleCampaignToggleDefaultState)(ge)),We=(Qe[0],Qe[1]),Ye=function(){_e(Object(R.handleCampaignToggleDefaultState)(pe)),We(Object(R.handleCampaignToggleDefaultState)(ge))},Ze=void 0;"FS"===be&&(Ze={ribbonText:"GET RESULTS FASTER",header:"Join The 8-week Reset",description:"Get 50% off your 8th bag",termsAndConditions:"T&C's apply",onChange:function(e){Object(R.handleCampaignToggle)(pe,e),Ye()},isChecked:Je});var Xe={title:I?h.title:"Let's get cooking!",blurb:function(){var e;if("MFB"===x.Brand.MFB&&I)return null===(e=Object.entries(V).map((function(e){return{groupName:e[0],data:e[1]}})).find((function(e){return e.groupName===D[be]})))||void 0===e?void 0:e.data.blurb}(),recipeCarouselContext:Z,productPriceDisplayContext:Le,variant:h.bagSelectorVariant,primaryCtaLabel:{desktop:"Continue this plan",mobile:"Continue"},reviews:M.createElement(J,null,M.createElement(A.a,null)),preferenceSelectorContext:{selectedBrand:be,title:"Choose your preference",preferenceSelections:ye,onClick:function(e){return function(e){void 0===e&&(e=[]);var t=e.map((function(e){return e.toString()})),n=y()(t,ce)[0],r=y()(ce,t)[0];if(n||r){var o=n?"selected":"unselected",i="selected"===o?n:r,a=ye.find((function(e){return e.preferenceId===Number(i)})),c=ye.filter((function(e){return t.find((function(t){return t===""+e.preferenceId}))})).filter((function(e){return e&&e.brand===Ce[be]})).filter(f.a);ne("preferences_"+o,{preferences:c.map((function(e){return null==e?void 0:e.displayName})).join("|"),preference_modified:null==a?void 0:a.displayName}),"singleSelectHardPreference"===h.bagSelectorVariant?(W("Veggie & Plant Based"),t.includes(H)?W(K[H]):t.includes(G)?W(K[G]):t.includes(q)?W(K[q]):W(void 0)):W(void 0),le(t)}}([e])},useQueryParams:!0},recipeSurchargeNotice:"Please note that certain recipes featured may be subject to a surcharge. Pricing information will be clearly displayed in your account area when selecting recipes.",mealPreferenceSelectorLayoutOptions:{isPrimaryCtaOffset:!0,displayValuePropositions:!0},skuSelectorContext:Ae,skuSelectorOnResult:Ge,campaignToggle:Ze,productPricePrimaryOnClickAsync:Ke};return M.createElement("div",Object.assign({className:F()("container-fluid",h.isHidden?"d-none":"d-flex","justify-content-center p-0")},O,{style:{backgroundColor:I?"transparent":Object(T.getColor)(h.backgroundColor)}}),M.createElement("div",{style:{width:"100%",maxWidth:"1370px"}},M.createElement(x.BrandSelector,{visible:"default"!==fe&&h.bagSelectorVariant!==w.BagSelectorLayoutVariant.default,selectedBrand:be,onClickCallback:function(e){e!==x.Brand.FS&&Ue()===pe&&(Object(R.removeCampaignCodeFromUrl)(pe),Ye()),e!==x.Brand.BB&&Ue()===ge&&(Object(R.removeCampaignCodeFromUrl)(ge),Ye()),he(e)}},M.createElement(z,Object.assign({},Xe,{className:"px-4 my-0 my-md-3"})))))}},FKh5:function(e,t){},Fn46:function(e,t,n){"use strict";n.r(t);var r=n("q1tI");t.default=function(){return r.createElement("div",{className:"w-100"})}},FyPc:function(e,t,n){var r=n("dunj"),o=n("V9xz"),i=n("ut/Y");e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},G4GL:function(e,t,n){"use strict";n.r(t)},GCAQ:function(e,t,n){"use strict";n.r(t)},GFwS:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return p}));var r=n("kHIg"),o=n("dI71");function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c=function(e){function t(t,n,r){var o;return(o=e.call(this,t)||this).jsonParseReviver=void 0,o.http=r||window,o.baseUrl=null!=n?n:"http://localhost:7043",o}Object(o.a)(t,e);var n=t.prototype;return n.campaignBycode=function(e){var t=this,n=this.baseUrl+"/campaign/bycode/{campaignCode}";if(null==e)throw new Error("The parameter 'campaignCode' must be defined.");n=(n=n.replace("{campaignCode}",encodeURIComponent(""+e))).replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(e){return t.http.fetch(n,e)})).then((function(e){return t.processCampaignBycode(e)}))},n.processCampaignBycode=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=""===e?null:JSON.parse(e,t.jsonParseReviver);return l.fromJS(n)})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.healthAvailability=function(){var e=this,t=this.baseUrl+"/_health/availability";t=t.replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(n){return e.http.fetch(t,n)})).then((function(t){return e.processHealthAvailability(t)}))},n.processHealthAvailability=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=""===e?null:JSON.parse(e,t.jsonParseReviver);return void 0!==n?n:null})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.healthFrontdoor=function(){var e=this,t=this.baseUrl+"/_health/frontdoor";t=t.replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(n){return e.http.fetch(t,n)})).then((function(t){return e.processHealthFrontdoor(t)}))},n.processHealthFrontdoor=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=""===e?null:JSON.parse(e,t.jsonParseReviver);return void 0!==n?n:null})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.healthClock=function(){var e=this,t=this.baseUrl+"/_health/clock";t=t.replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(n){return e.http.fetch(t,n)})).then((function(t){return e.processHealthClock(t)}))},n.processHealthClock=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=""===e?null:JSON.parse(e,t.jsonParseReviver);return void 0!==n?n:null})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.productsByskuAddonsActive=function(e){var t=this,n=this.baseUrl+"/products/bysku/{sku}/addons/active";if(null==e)throw new Error("The parameter 'sku' must be defined.");n=(n=n.replace("{sku}",encodeURIComponent(""+e))).replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(e){return t.http.fetch(n,e)})).then((function(e){return t.processProductsByskuAddonsActive(e)}))},n.processProductsByskuAddonsActive=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=null,r=""===e?null:JSON.parse(e,t.jsonParseReviver);if(Array.isArray(r)){n=[];for(var o,a=i(r);!(o=a()).done;){var c=o.value;n.push(s.fromJS(c))}}else n=null;return n})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.productsAllAddonsActive=function(){var e=this,t=this.baseUrl+"/products/all/addons/active";t=t.replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(n){return e.http.fetch(t,n)})).then((function(t){return e.processProductsAllAddonsActive(t)}))},n.processProductsAllAddonsActive=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=null,r=""===e?null:JSON.parse(e,t.jsonParseReviver);if(Array.isArray(r)){n=[];for(var o,a=i(r);!(o=a()).done;){var c=o.value;n.push(s.fromJS(c))}}else n=null;return n})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},n.productsStockByskusAvailability=function(e){var t=this,n=this.baseUrl+"/products/stock/byskus/{skus}/availability";if(null==e)throw new Error("The parameter 'skus' must be defined.");n=(n=n.replace("{skus}",encodeURIComponent(""+e))).replace(/[?&]$/,"");return this.transformOptions({method:"GET",headers:{Accept:"application/json"}}).then((function(e){return t.http.fetch(n,e)})).then((function(e){return t.processProductsStockByskusAvailability(e)}))},n.processProductsStockByskusAvailability=function(e){var t=this,n=e.status,r={};return e.headers&&e.headers.forEach&&e.headers.forEach((function(e,t){return r[t]=e})),200===n?e.text().then((function(e){var n=null,r=""===e?null:JSON.parse(e,t.jsonParseReviver);if(Array.isArray(r)){n=[];for(var o,a=i(r);!(o=a()).done;){var c=o.value;n.push(d.fromJS(c))}}else n=null;return n})):200!==n&&204!==n?e.text().then((function(e){return f("An unexpected server error occurred.",n,e,r)})):Promise.resolve(null)},t}((function(e){var t=this;this.transformOptions=function(e){return t.config.applyTransformToRequest(e),Promise.resolve(e)},this.config=e})),l=function(){function e(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}var t=e.prototype;return t.init=function(e){e&&(this.isValidCampaign=e.isValidCampaign,this.joinTitle=e.joinTitle,this.joinDescription=e.joinDescription,this.brand=e.brand,this.campaignCode=e.campaignCode)},e.fromJS=function(t){t="object"==typeof t?t:{};var n=new e;return n.init(t),n},t.toJSON=function(e){return(e="object"==typeof e?e:{}).isValidCampaign=this.isValidCampaign,e.joinTitle=this.joinTitle,e.joinDescription=this.joinDescription,e.brand=this.brand,e.campaignCode=this.campaignCode,e},e}(),u=function(){function e(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}var t=e.prototype;return t.init=function(e){e&&(this.primarySku=e.primarySku,this.historicSku=e.historicSku)},e.fromJS=function(t){t="object"==typeof t?t:{};var n=new e;return n.init(t),n},t.toJSON=function(e){return(e="object"==typeof e?e:{}).primarySku=this.primarySku,e.historicSku=this.historicSku,e},e}(),s=function(){function e(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}var t=e.prototype;return t.init=function(e){if(e){if(this.addOnSku=e.addOnSku,this.addOnHistoricSku=e.addOnHistoricSku,Array.isArray(e.primaryProductInfo)){this.primaryProductInfo=[];for(var t,n=i(e.primaryProductInfo);!(t=n()).done;){var r=t.value;this.primaryProductInfo.push(u.fromJS(r))}}this.marketingTitle=e.marketingTitle,this.marketingDescription=e.marketingDescription,this.recipeImage=e.recipeImage,this.hasStockAvailable=e.hasStockAvailable,this.hasUnlimitedBufferStock=e.hasUnlimitedBufferStock,this.numberOfPeopleToFeed=e.numberOfPeopleToFeed,this.numberOfNights=e.numberOfNights,this.active=e.active}},e.fromJS=function(t){t="object"==typeof t?t:{};var n=new e;return n.init(t),n},t.toJSON=function(e){if((e="object"==typeof e?e:{}).addOnSku=this.addOnSku,e.addOnHistoricSku=this.addOnHistoricSku,Array.isArray(this.primaryProductInfo)){e.primaryProductInfo=[];for(var t,n=i(this.primaryProductInfo);!(t=n()).done;){var r=t.value;e.primaryProductInfo.push(r.toJSON())}}return e.marketingTitle=this.marketingTitle,e.marketingDescription=this.marketingDescription,e.recipeImage=this.recipeImage,e.hasStockAvailable=this.hasStockAvailable,e.hasUnlimitedBufferStock=this.hasUnlimitedBufferStock,e.numberOfPeopleToFeed=this.numberOfPeopleToFeed,e.numberOfNights=this.numberOfNights,e.active=this.active,e},e}(),d=function(){function e(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}var t=e.prototype;return t.init=function(e){e&&(this.sku=e.sku,this.itemNumber=e.itemNumber,this.hasStockAvailable=e.hasStockAvailable)},e.fromJS=function(t){t="object"==typeof t?t:{};var n=new e;return n.init(t),n},t.toJSON=function(e){return(e="object"==typeof e?e:{}).sku=this.sku,e.itemNumber=this.itemNumber,e.hasStockAvailable=this.hasStockAvailable,e},e}(),m=function(e){function t(t,n,r,o,i){var a;return(a=e.call(this)||this).isWebsiteClientException=!0,a.message=t,a.status=n,a.response=r,a.headers=o,a.result=i,a}return Object(o.a)(t,e),t.isWebsiteClientException=function(e){return!0===e.isWebsiteClientException},t}(Object(r.a)(Error));function f(e,t,n,r,o){throw null!=o?o:new m(e,t,n,r,null)}var p=function(){function e(){this._apiKey="",this._apiHeader="Ocp-Apim-Subscription-Key",this._apiPlatformHeader="x-mfb-platform",this._apiPlatformValue="",this._apiVersionHeader="x-mfb-app-version",this._apiVersionValue=""}var t=e.prototype;return t.setApiKey=function(e,t,n){this._apiKey=e,this._apiPlatformValue=t,this._apiVersionValue=n},t.applyTransformToRequest=function(e){var t=e.headers||{};t[this._apiHeader]=this._apiKey,t[this._apiPlatformHeader]=this._apiPlatformValue,t[this._apiVersionHeader]=this._apiVersionValue,e.headers=t},e}()},GN6j:function(e,t){},GZDz:function(e,t,n){"use strict";n.r(t)},GoNP:function(e,t){},"H+ae":function(e,t,n){"use strict";n.r(t)},HEOd:function(e,t){},IDh5:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("2Kix"),i=n("OQbj"),a=n("E8HI");t.default=function(e){var t=e.baseModel,n=t?{small:Object(a.getImageModel)(t.small),medium:Object(a.getImageModel)(t.medium),large:Object(a.getImageModel)(t.large)}:o.c;return r.createElement(i.a,{imageSet:n,alt:t.alternateText})}},Jl6Y:function(e,t){},Jz4a:function(e,t,n){"use strict";n.r(t)},KR7t:function(e,t){},Kecl:function(e,t){},Kf58:function(e,t,n){"use strict";n.r(t)},KtLF:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("p+7n"),i=n("A3CJ"),a=n("CQ3q"),c=n("TSYQ"),l=n.n(c),u=function(e){var t=e.classNames,n=e.style,o=e.children,i=e.width,a=Object.assign({boxShadow:"0 5px 0 #d5d0c9"},n),c=l()(t,"card mx-md-2 mb-4 rounded-0 border-0");if(!o)return null;var u=r.createElement(r.Fragment,null,o);return r.createElement(r.Fragment,null,r.createElement("div",{className:l()("d-md-block d-none",c),style:Object.assign({width:i||"20em"},a)},u),r.createElement("div",{className:l()("d-block d-md-none w-100",c),style:a},u))},s=function(e){var t=e.id,n=e.title,c=e.description,l=e.button,s=e.image;return r.createElement(u,null,r.createElement("div",{className:"d-md-flex h-100 flex-column"},s&&r.createElement(o.ResponsiveSquare,{id:t,paddingSizes:{small:"60%"}},r.createElement(i,{src:s.src,alt:s.alt,loader:r.createElement(o.Placeholder,{outerWidth:360,id:"placeholder-image-"+t}),className:"h-100 w-100",style:o.imageFillStyle})),r.createElement("div",{className:"d-flex flex-column justify-content-md-between p-3 pb-2 w-100 h-100"},r.createElement("div",{className:"d-flex flex-column align-items-center justify-content-start text-center w-100"},r.createElement("h4",null,n),r.createElement("p",{className:"w-75 mb-0 mb-lg-3"},c)),r.createElement("div",{className:"text-center w-100 mt-2"},l&&r.createElement(a.a,Object.assign({},l,{className:"btn-block"}))))))},d=n("wlLi");t.default=function(e){var t=e.baseModel,n={id:t.id,title:t.title,button:t.callToAction&&Object(d.mapActionButton)(t.callToAction),description:t.description,image:{src:t.image.file.url,alt:t.image.description,id:t.image.id,caption:t.image.description}};return r.createElement(s,n)}},LAUS:function(e,t){},LCEI:function(e,t){},LbEA:function(e,t,n){"use strict";n.r(t),n.d(t,"PureContentfulProductCartSection",(function(){return y}));var r=n("Wbzz"),o=n("q1tI"),i=n("HaE+"),a=n("dI71"),c=n("o0o1"),l=n.n(c),u=n("z0sf"),s=n("bTjV"),d=n("4wU3"),m=n("GFwS"),f=n("ShJo"),p=function(e,t){var n=[];return e.forEach((function(e){var r=t.find((function(t){return t.addOnSku===e.sku}));(e.locked||r)&&(e.outOfStock=r&&!r.hasStockAvailable,n.push(e))})),n},g=function(e){function t(t){var n;return(n=e.call(this,t)||this).mounted=!1,n.state={items:[],isLoading:!0,shouldContinueToOrderForm:!1},n}Object(a.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){var e=Object(i.a)(l.a.mark((function e(){var t,n,r,o,i,a,c=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mounted=!0,t=this.props.items.find((function(e){return e.locked}))){e.next=5;break}return this.setState({isLoading:!1},(function(){console.error("No primaryProduct sku found",window.history.state)})),e.abrupt("return");case 5:return n=[],e.prev=6,(r=new m.a).setApiKey("31d648fc-7d81-41fa-9e9a-65e34bd36aa0","",""),o=new m.b(r,"https://test-scullery.myfoodbag.co.nz/website",f.b),e.next=12,o.productsByskuAddonsActive(t.sku);case 12:n=e.sent,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(6),console.log("Failed to load primary product addons. "+e.t0.message);case 18:return e.prev=18,this.mounted&&(i=n?n.filter((function(e){return null!==e||void 0!==e})):[],a=0===(l=i).length||!l.some((function(e){return e.hasStockAvailable})),this.setState({items:p(this.props.items,i),isLoading:!1,shouldContinueToOrderForm:a},(function(){a&&window.location.assign(c.props.orderLink)}))),e.finish(18);case 21:case"end":return e.stop()}var l}),e,this,[[6,15,18,21]])})));return function(){return e.apply(this,arguments)}}(),n.componentWillUnmount=function(){this.mounted=!1},n.handleMealsSelected=function(){var e=Object(i.a)(l.a.mark((function e(t){var n,o,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o in this.setState({isLoading:!0}),n=[],t)t.hasOwnProperty(o)&&n.push({sku:o,quantity:t[o]});return e.prev=3,e.next=6,new d.a(this.props.gatewayUrl).createCart({lines:n});case 6:i=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.log("Failed to create cart. "+e.t0.message);case 12:return e.prev=12,i&&i.id?window.location.assign(this.props.orderLink+"?cart="+i.id):Object(r.d)("/error",{replace:!0}),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[3,9,12,15]])})));return function(t){return e.apply(this,arguments)}}(),n.handleCancel=function(){window.history.back()},n.render=function(){var e=this,t=this.state,n=t.items,r=t.isLoading,a=t.shouldContinueToOrderForm;return r?o.createElement("div",{className:"d-flex align-items-center justify-content-center",style:{height:"60vh"}},o.createElement(s.a,{style:{width:"3rem",height:"3rem"},color:"primary"})):a?null:o.createElement(u.CartSection,{title:this.props.title,items:n,maxWidth:"1600px",desktopSummaryMaxHeight:"calc(100vh - 270px)",disableModal:!0,responsiveCardsPerRow:{small:1,medium:2,large:2,extraLarge:3},cartTitle:{desktop:"Your items",mobile:"Select items"},onSubmit:function(){var t=Object(i.a)(l.a.mark((function t(n){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.handleMealsSelected(n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),onCancel:function(){return e.handleCancel()},height:"calc(var(--vh, 1vh) * 100 - 76px)"})},t}(o.Component),v="undefined"!=typeof window,b=function(){if(v){var e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",e+"px")}},h=n("Bu+q"),C=n("iiTp"),S=n("vD5k"),y=function(e){var t=e.title,n=e.defaultSku,r=e.allDbProducts,i=e.allContentfulProducts,a=e.gatewayUrl;b(),Object(o.useEffect)((function(){if(v)return window.addEventListener("resize",b),function(){window.removeEventListener("resize",b)}}));var c=o.useState(),l=c[0],u=c[1];if(o.useEffect((function(){var e=Object(C.getSkuFromQueryParams)();e?u(e):n?u(n):(console.error("No sku loaded",window.history.state),u(void 0))}),[n]),!l)return null;var s=Object(S.mergeToCartProducts)(l,r,i),d=a+"/order/"+l;return o.createElement(g,{items:s,orderLink:d,title:t,gatewayUrl:a})};t.default=function(e){var t=e.navProps,n=e.baseModel;return o.createElement(r.b,{query:"3535798881",render:function(e){var r=n,i=Object(h.a)(e.allProductDb),a=Object(h.a)(e.allContentfulProduct);return o.createElement(y,{defaultSku:t&&t.sku,title:r.title,allDbProducts:i,allContentfulProducts:a,gatewayUrl:e.site.siteMetadata.gatewayUrl})}})}},Lnx5:function(e,t){},LqpT:function(e,t,n){var r=n("1hJj"),o=n("jbM+"),i=n("Xt/L"),a=n("eUgh"),c=n("sEf8"),l=n("xYSL");e.exports=function(e,t,n,u){var s=-1,d=o,m=!0,f=e.length,p=[],g=t.length;if(!f)return p;n&&(t=a(t,c(n))),u?(d=i,m=!1):t.length>=200&&(d=l,m=!1,t=new r(t));e:for(;++s<f;){var v=e[s],b=null==n?v:n(v);if(v=u||0!==v?v:0,m&&b==b){for(var h=g;h--;)if(t[h]===b)continue e;p.push(v)}else d(t,b,u)||p.push(v)}return p}},M1lA:function(e,t){},MG3A:function(e,t){},MIz4:function(e,t,n){"use strict";n.r(t),n.d(t,"allowsRecipeSelection",(function(){return i})),n.d(t,"getProductSelectEventPath",(function(){return a}));var r=n("p+7n"),o=n("O2s4"),i=function(e){switch(e){case o.b.Single:case o.b.Multiple:return!0;default:return!1}},a=function(e,t,n,o){if(!t)return e;if(o&&Object(r.isNotNullOrUndefined)(n))try{var i=new URL(n.cartLink||""+window.location.origin+n.orderLink);if(new URLSearchParams(o).forEach((function(e,t){i.searchParams.append(t,e)})),n.cartLink)return i.href;if(n.orderLink)return""+i.pathname+i.search}catch(a){console.error(a)}return Object(r.isNotNullOrUndefined)(n)?n.cartLink||n.orderLink:"/"}},N1om:function(e,t,n){var r=n("sgoq")((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));e.exports=r},NjgH:function(e,t,n){"use strict";n.r(t),n.d(t,"getSelectedBrand",(function(){return o})),n.d(t,"getSelectedSku",(function(){return i}));var r=n("aTJK"),o=function(){if("undefined"!=typeof window)try{return new URLSearchParams(window.location.search).get(r.QueryParams.selectedBrand)}catch(e){console.error(e)}},i=function(){if("undefined"!=typeof window)try{return new URLSearchParams(window.location.search).get(r.QueryParams.sku)}catch(e){console.error(e)}}},O6xf:function(e,t){},OIC7:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("p+7n"),i=function(e){var t=e.title,n=e.subtitleBulletPoints,i=e.backgroundColor;return r.createElement("div",{className:"container-fluid pt-5 pb-2",style:{backgroundColor:i}},r.createElement("h1",{className:"display-1 w-100 text-center"},t),n&&r.createElement("div",{className:"d-flex justify-content-center align-items-center flex-wrap"},r.createElement(o.OvercomeHesitation,{options:n,isHorizontal:!0})))},a=n("RJQD");t.default=function(e){var t=e.baseModel;return r.createElement(i,{title:t.title,subtitleBulletPoints:t.subtitleBulletPoints,backgroundColor:Object(a.getColor)(t.backgroundColor)})}},OQbj:function(e,t,n){"use strict";var r=n("q1tI"),o=n("2Kix"),i=n("Yfyt");t.a=function(e){var t=e.classNames,n=e.imageSet,a=e.image,c=e.alt,l=e.style;if(!n)return r.createElement("picture",{className:t},r.createElement("source",{srcSet:a+"?fm=avif",type:"image/avif"}),r.createElement("source",{srcSet:a+"?fm=webp",type:"image/webp"}),r.createElement("source",{srcSet:a+"?fm=jpg",type:"image/jpeg"}),r.createElement("source",{srcSet:a+"?fl=progressive"}),r.createElement("img",{src:a,alt:c,className:"w-100",style:l}));var u=n.large||o.c.large,s=n.medium||o.c.medium,d=n.small||o.c.small;return r.createElement("picture",{className:t},u.src&&r.createElement(r.Fragment,null,r.createElement("source",{srcSet:u.src+"?fm=avif",media:"(min-width: "+i.a.Large+")",type:"image/avif"}),r.createElement("source",{srcSet:u.src+"?fm=webp",media:"(min-width: "+i.a.Large+")",type:"image/webp"}),r.createElement("source",{srcSet:u.src+"?fm=jpg",media:"(min-width: "+i.a.Large+")",type:"image/jpeg"}),r.createElement("source",{srcSet:u.src+"?fl=progressive",media:"(min-width: "+i.a.Large+")"})),s.src&&r.createElement(r.Fragment,null,r.createElement("source",{srcSet:s.src+"?fm=avif",media:"(min-width: "+i.a.Medium+")",type:"image/avif"}),r.createElement("source",{srcSet:s.src+"?fm=webp",media:"(min-width: "+i.a.Medium+")",type:"image/webp"}),r.createElement("source",{srcSet:s.src+"?fm=jpg",media:"(min-width: "+i.a.Medium+")",type:"image/jpeg"}),r.createElement("source",{srcSet:s.src+"?fl=progressive",media:"(min-width: "+i.a.Medium+")"})),d.src?r.createElement(r.Fragment,null,r.createElement("source",{srcSet:d.src+"?fm=avif",type:"image/avif"}),r.createElement("source",{srcSet:d.src+"?fm=webp",type:"image/webp"}),r.createElement("source",{srcSet:d.src+"?fm=jpg",type:"image/jpeg"}),r.createElement("img",{src:d.src,alt:c,className:"w-100",style:l})):r.createElement("img",{src:o.a+"/"+o.b.small,alt:"Image not available",className:"w-100",style:l}))}},Ohk0:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("TSYQ"),a=n.n(i),c=n("IujW"),l=n.n(c),u=n("CQ3q"),s=n("9538"),d=function(e,t){return t?e?"col-12 col-lg-8":"col-12 col-lg-4":"col-12 col-lg-6"},m=function(e){var t=e.title,n=e.text,i=e.button,c=e.images,m=e.imageOnLeftLayout,f=e.backgroundColor,p=e.id,g=e.textAlignment,v=e.textColor,b=e.skewed,h=Object(s.a)(),C="py-0",S="py-4 py-lg-5";t&&(C=void 0,S="py-4 py-lg-0");var y="px-0 px-lg-4";f&&(y="px-3 px-lg-4");var P={small:"70%"};return o.createElement(r.PageSection,{id:p,title:t,verticalSpaceClassName:C,childrenContainerClassName:m?"":"flex-lg-row-reverse"},o.createElement("div",{className:a()("px-0 d-flex flex-column",Object(r.getFlexAlignmentClasses)(r.Alignment.Center,"col"),d(!0,b)),style:{backgroundColor:f}},o.createElement("div",{className:"w-100"},o.createElement(r.Carousel,{items:c.map((function(e){return Object(r.mapImageCarouselItem)(e,P)})),itemClassName:"d-block",showArrows:!0}))),o.createElement("div",{className:a()("d-flex flex-column",y,S,d(!1,b),Object(r.getFlexAlignmentClasses)(g,"col")),style:{color:v,backgroundColor:f}},o.createElement(l.a,{className:"w-100",source:n,allowedTypes:["root","text","break","paragraph","emphasis","strong","thematicBreak","blockquote","delete","link","image","linkReference","list","listItem","heading"],unwrapDisallowed:!0,renderers:h}),i&&o.createElement(u.a,i)))},f=n("wlLi"),p=n("E8HI"),g=n("RJQD");t.default=function(e){var t=e.baseModel,n=t.images.filter((function(e){return e.large})).map((function(e){return Object(p.getImageModel)(e.large)})).filter(r.isNotNullOrUndefined),i=t.callToAction&&Object(f.mapActionButton)(t.callToAction),a=t.childContentfulTwoColumnSectionTextTextNode&&t.childContentfulTwoColumnSectionTextTextNode.text||"",c=Object(r.mapAlignment)(t.textAlignment)||r.Alignment.Left;return o.createElement(m,{id:t.id,backgroundColor:Object(g.getColor)(t.backgroundColor),title:t.title,text:a,images:n,button:i,imageOnLeftLayout:t.imageOnLeftLayout,textAlignment:c,textColor:Object(g.getColor)(t.textColor),skewed:t.skewed})}},P7MK:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i={small:"",medium:"",large:""},a=n("wlLi"),c=n("RJQD"),l=n("4rPF");t.default=function(e){var t,n,u,s,d=e.baseModel,m=e.pageSettings,f=e.navProps,p=d,g=p.backgroundImage?{small:p.backgroundImage.small&&p.backgroundImage.small.file.url,medium:p.backgroundImage.medium&&p.backgroundImage.medium.file.url,large:p.backgroundImage.large&&p.backgroundImage.large.file.url}:i,v=p.actionButton&&Object(a.mapActionButton)(p.actionButton),b=p.childContentfulPageSectionSubtitleTextNode,h=p.childContentfulPageSectionDescriptionTextNode;return o.createElement(r.PageSection,{id:p.id,title:p.title,subtitle:b&&b.subtitle,backgroundStyle:{backgroundColor:Object(c.getColor)(p.backgroundColor)},wrap:p.wrapContent,description:h&&h.description,backgroundImage:g,button:v,fullWidth:p.fullWidth,variant:p.variant,leftImageSrc:null===(t=p.leftImage)||void 0===t||null===(n=t.large)||void 0===n?void 0:n.file.url,rightImageSrc:null===(u=p.rightImage)||void 0===u||null===(s=u.large)||void 0===s?void 0:s.file.url},Object(l.default)(p.content,m,f))}},PLbB:function(e,t){},PT62:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("AVYR"),a=n("dvv6"),c=n("+9EZ");t.default=function(e){var t=e.baseModel,n=t.name,l=t.secondName,u=t.firstLink,s=t.firstResponsiveImageSet,d=t.secondLink,m=t.secondResponsiveImageSet,f=s&&Object(c.mapResponsiveImageSetContentModelToResponsiveImageProps)(s),p=m&&Object(c.mapResponsiveImageSetContentModelToResponsiveImageProps)(m);return f&&p?o.createElement(o.Fragment,null,o.createElement("div",{className:"my-2 mx-lg-2","data-category":"merchandising","data-action":"click-double-merch-slot","data-label":n+" - first-double-merch-slot"},o.createElement(i.a,{link:Object(a.getContentfulLink)(u)},o.createElement(r.ResponsiveImage,f))),o.createElement("div",{className:"my-2 mx-lg-2","data-category":"merchandising","data-action":"click-double-merch-slot","data-label":l+" - second-double-merch-slot"},o.createElement(i.a,{link:Object(a.getContentfulLink)(d)},o.createElement(r.ResponsiveImage,p)))):null}},PjvT:function(e,t){},Psa5:function(e,t){},RI75:function(e,t){},ShJo:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var r,o,i,a=n("HaE+"),c=n("o0o1"),l=n.n(c),u=n("oY9k"),s=n.n(u),d=(r=Object(a.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign({},n,{headers:{"X-CoreApiKey":{}.API_KEY||""}}),e.next=3,s()(t,r||void 0);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),{fetch:(o=Object(a.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign({},n),t+="?"+new URLSearchParams({code:"a9190f58-6b59-4ff9-9cc9-6ef0fd6dbba5"}).toString(),e.next=4,s()(t,r||void 0);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)}))),function(e,t){return o.apply(this,arguments)})}),m={fetch:(i=Object(a.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign({},n),e.next=3,s()(t,r||void 0);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})}},"T/i5":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n.n(r),i=n("p+7n"),a=new RegExp("(?<icon>({TICK}|{CROSS}|{GIFT}))(?<transform>(?:{BOLD})?)(?<proposition>[a-zA-Z0-9-/].+)");t.default=function(e){var t,n,r,c=e.baseModel,l={id:c.id,ribbonText:c.ribbonText,header:c.title,subheader:c.description,price:c.price,pricePrefix:c.pricePrefix,pricePostfix:c.pricePostfix,valuePropositions:(t=c.valuePropositions,n=function(e){return{"{TICK}":o.a.createElement(i.SvgSubscriptionPlanTick,null),"{CROSS}":o.a.createElement(i.SvgSubscriptionPlanCross,null),"{GIFT}":o.a.createElement(i.SvgSubscriptionPlanGift,null)}[e]},r=[],t.map((function(e){var t=a.exec(e);if(t&&t.groups){var o=t.groups,i=o.icon,c=o.transform,l=o.proposition;try{r.push({prefixIcon:n(i),proposition:l,isBold:!!c})}catch(u){console.error("Invalid value proposition for "+e+" "+u.message)}}})),r),action:{label:c.actionButton.label||"",onAction:function(){var e,t,n;e=c.actionButton.link.relativePath,t=window.location.href,n=new URL(t).searchParams.toString(),e&&""!==n?window.location.href=e+"&"+n:e&&(window.location.href=e)}},sortOrder:c.sortOrder,sortOrderMobile:c.sortOrderMobile};return o.a.createElement(i.SubscriptionPlanCard,{subscription:l,header:o.a.createElement(i.SubscriptionPlanCard.Header,null),info:o.a.createElement(i.SubscriptionPlanCard.Info,null,o.a.createElement(i.SubscriptionPlanCard.Price,null),o.a.createElement(i.SubscriptionPlanCard.ValuePropositions,null)),action:o.a.createElement(i.SubscriptionPlanCard.Action,null),variant:c.isHero?"hero":"default"})}},T33S:function(e,t,n){"use strict";n.r(t),t.default=[{name:"ContentfulJumbotron",path:"./jumbotron/ContentfulJumbotron"},{name:"ContentfulSimpleJumbotron",path:"./jumbotron/ContentfulSimpleJumbotron"},{name:"ContentfulPageSection",path:"./pageSection/ContentfulPageSection"},{name:"ContentfulFaqCard",path:"./faqCard/ContentfulFaqCard"},{name:"ContentfulHeroCard",path:"./heroCard/ContentfulHeroCard"},{name:"ContentfulRenderRawHtml",path:"./calorieCalculatorRender/ContentfulRawHtmlRender"},{name:"ContentfulMerchandising",path:"./merchandising/ContentfulMerchandising"},{name:"ContentfulLineBreak",path:"./lineBreak/ContentfulLineBreak"},{name:"ContentfulResponsiveImageSet",path:"./responsiveImageSet/ContentfulResponsiveImageSet"},{name:"ContentfulInstagramSection",path:"./instagramSection/ContentfulInstagramSection"},{name:"ContentfulProductGroup",path:"./productGroup/ContentfulProductGroup"},{name:"ContentfulProductGroupHero",path:"./productGroupHero/ContentfulProductGroupHero"},{name:"ContentfulSimpleHeader",path:"./simpleHeader/ContentfulSimpleHeader"},{name:"ContentfulTermsAndConditionsSection",path:"./termsAndConditionsSection/ContentfulTermsAndConditionsSection"},{name:"ContentfulBulletPointCard",path:"./bulletPointCard/ContentfulBulletPointCard"},{name:"ContentfulProduct",path:"./product/ContentfulProduct"},{name:"ContentfulTwoColumnSection",path:"./twoColumnSection/ContentfulTwoColumnSection"},{name:"ContentfulVideoTwoColumnSection",path:"./twoColumnSection/ContentfulVideoTwoColumnSection"},{name:"ContentfulRecipeCarousel",path:"./recipeCarousel/ContentfulRecipeCarousel"},{name:"ContentfulMealSelector",path:"./mealSelector/ContentfulMealSelector"},{name:"ContentfulCallToActionCard",path:"./callToActionCard/ContentfulCallToActionCard"},{name:"ContentfulProductCartSection",path:"./productCartSection/ContentfulProductCartSection"},{name:"ContentfulMarkdown",path:"./markdown/ContentfulMarkdown"},{name:"ContentfulVideoEmbed",path:"./videoEmbed/ContentfulVideoEmbed"},{name:"ContentfulMerchSlot",path:"./merchSlot/ContentfulMerchSlot"},{name:"ContentfulDoubleMerchSlot",path:"./doubleMerchSlot/ContentfulDoubleMerchSlot"},{name:"ContentfulBagSelector",path:"./bagSelector/ContentfulBagSelector"},{name:"ContentfulProductSelectorTabset",path:"./productSelectorTabSet/ContentfulProductSelectorTabset"},{name:"ContentfulSubscriptionPlan",path:"./subscriptionPlan/ContentfulSubscriptionPlan"}]},T71h:function(e,t,n){"use strict";n.r(t)},TKrE:function(e,t,n){var r=n("qRkn"),o=n("dt0z"),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(a,"")}},TpFE:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n.n(r);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=["html","dangerouslySetInnerHTML"];var c=function(e){var t=e.html,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,a),c=Object(r.useRef)(null),l=Object(r.useRef)(!0);return Object(r.useEffect)((function(){if(!t||!c.current)throw new Error("html prop cant't be null");if(l.current){l.current=!1;var e=document.createRange().createContextualFragment(t);c.current.innerHTML="",c.current.appendChild(e)}}),[t,c]),o.a.createElement("div",i({},n,{ref:c}))},l=n("vOnD"),u=Object(l.default)(c).withConfig({displayName:"ContentfulRawHtmlRender__RenderHtml",componentId:"sc-1x2uey4-0"})(["width:100%;"]);t.default=function(e){var t,n,o=e.baseModel;return r.createElement(u,{html:null!==(t=null===(n=o.html)||void 0===n?void 0:n.html)&&void 0!==t?t:"<div></div>"})}},U2oN:function(e,t){},UGk3:function(e,t){},UOL7:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("wlLi"),a=n("RJQD");t.default=function(e){var t=e.baseModel,n=t.backgroundImage&&{small:t.backgroundImage.small&&t.backgroundImage.small.file.url,medium:t.backgroundImage.medium&&t.backgroundImage.medium.file.url,large:t.backgroundImage.large&&t.backgroundImage.large.file.url},c=t.actionButton&&Object(i.mapActionButton)(t.actionButton);return o.createElement(r.Jumbotron,{id:t.id,title:t.title,logo:t.logo&&t.logo.file.url,description:t.childContentfulJumbotronSubtitleTextNode&&t.childContentfulJumbotronSubtitleTextNode.subtitle,img:n,button:c,minHeight:t.minHeight,backgroundColor:Object(a.getColor)(t.backgroundColor),textColor:Object(a.getColor)(t.textColor),alignment:Object(r.mapAlignment)(t.alignment),splitOnMobile:t.useAlternateMobileLayout})}},Uskz:function(e,t){},V8Yo:function(e,t,n){"use strict";n.r(t);var r=n("TYy9"),o=n.n(r),i=n("z0sf"),a=n("p+7n"),c=n("Wbzz"),l=n("q1tI"),u=n("ChCS"),s=n("wlLi"),d=n("RJQD");t.default=function(e){var t=e.baseModel;return l.createElement(c.b,{query:"3593756770",render:function(e){var n,r=Object(u.a)(e.allProductDb,t.sku),c=r&&r.recipeCollections&&r.recipeCollections.length>0&&r.recipeCollections[0].productName||"",m=r&&r.recipeCollections&&r.recipeCollections.length>0&&r.recipeCollections;if((null==r?void 0:r.brand)===a.Brand.RMM){var f,p=m&&m.map((function(e,t){if(0!==t)return e.collections[0]})).filter((function(e){return void 0!==e}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"w-100 mx-auto",style:{maxWidth:"1600px"}},l.createElement("h1",{className:"display-3 w-100 mx-auto text-center"},"What we're serving up"),l.createElement("div",{className:"w-100 d-flex flex-column align-items-center justify-content-center p-5 pl-2"},p&&p.length>0&&l.createElement(i.RecipeWeeks,{key:r.id,id:r.id,title:r.name,showWeekSelector:!1,recipeCollections:p,isRecipeModalEnabled:!0,selectedDate:p&&(null===(f=p[0])||void 0===f?void 0:f.date.toString())}))))}var g=function(){var e,t;if(m&&0!==m.length){var n=m[1];if(null===(e=n.collections)||void 0===e?void 0:e.map((function(e){return e.recipes.length>0})).some((function(e){return e})))return n.collections.map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e}));var r=m.find((function(e){return e.collections.find((function(e){return e.recipes.length>0}))}));return null==r||null===(t=r.collections)||void 0===t?void 0:t.map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e}))}}();return g&&g.length>0&&l.createElement(i.RecipeWeeks,{id:t.id,title:t.autoGenerateTitle?c:t.titleOverride,backgroundColor:Object(d.getColor)(t.backgroundColor),recipeCollections:o()(g),button:t.button&&Object(s.mapActionButton)(t.button),showWeekSelector:!t.hideWeekSelector,isRecipeModalEnabled:!0,selectedDate:g&&(null===(n=g[0])||void 0===n?void 0:n.date.toString())})}})}},V9xz:function(e,t){e.exports=function(e,t){return e>t}},VUwh:function(e,t){},Vjiz:function(e,t,n){"use strict";n.r(t),n.d(t,"getProductGroupModel",(function(){return u})),n.d(t,"getProteinSelectors",(function(){return s}));var r=n("afOK"),o=n.n(r),i=n("z0sf"),a=n("p+7n"),c=n("E8HI"),l=n("RJQD"),u=function(e,t){var n={text:e.tabText,color:Object(l.getColor)(e.tabColor)},r=e.images&&e.images.map(c.getImageModel).filter(a.isNotNullOrUndefined)||[],u=e.recipeImages&&e.recipeImages.map(c.getImageModel).filter(a.isNotNullOrUndefined)||[],s=e.additionalPaths?e.additionalPaths.map((function(e){return e.relativePath||""})).filter((function(e){return""!==e})):[],d=o()(t),m=d&&d.availableFrequency,f=d&&d.productType===i.ProductType.Primary,p=m===i.AvailableFrequency.OneOff,g=1===t.length&&f&&p;return{id:e.id,title:e.title,subtitle:e.subtitle,tag:n,images:r,products:t,defaultPath:e.relativePath.relativePath||"",additionalPaths:s,overcomingHesitation:e.overcomingHesitation,recipeImages:u,showSelector:!g,isCollapseDisabled:e.isCollapseDisabled,isSoldOut:e.isSoldOut,disclaimer:e.disclaimer,description:e.description,shouldHideSeeMenuLink:e.shouldHideSeeMenuLink}},s=function(e,t){return e?e.map((function(e,n){var r;return{id:e.proteinName||n,label:e.description||"No description available",iconUrl:null===(r=e.image)||void 0===r?void 0:r.file.url,variant:"withImage",state:null!=t&&t.some((function(t){return t===e.proteinName}))?"active":"default"}})):[]}},WPtl:function(e,t,n){"use strict";n.r(t)},Wa6b:function(e,t){},X21I:function(e,t){},XKfS:function(e,t){},"Y+p1":function(e,t,n){var r=n("wF/u");e.exports=function(e,t){return r(e,t)}},Yfyt:function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e.Medium="768px",e.Large="992px"}(r||(r={}))},YxO1:function(e,t){},ZVYO:function(e,t){},ZlMb:function(e,t,n){"use strict";n.r(t)},ZmDi:function(e,t,n){"use strict";n.r(t),n.d(t,"getProductModel",(function(){return f}));var r=n("44Ds"),o=n.n(r),i=n("z0sf"),a=n("O2s4"),c=n("ChCS"),l=n("Bjc/"),u=n("WLZk"),s=n("E8HI"),d=n("RJQD"),m=n("dvv6"),f=(o()((function(e){return e.map((function(e){var t=Object(u.a)(),n=Object(l.a)(e.collections).filter((function(e){return e!==t})),r=e.collections.filter((function(e){return n.includes(e.day)}));return Object.assign({},e,{collections:r})}))})),function(e,t,n){var r=e.id,o=e.sku,l=e.dinners,u=e.people,f=e.description,p=e.productOverview,g=e.tabText,v=e.tabColor,b=e.image,h=e.productPageLink,C=e.isSkipRecipeSelection,S=e.variant,y=(e.protein,e.hasPreferences,Object(c.a)(t,o));if(void 0!==y){var P=y.price,k=y.recipeCollections,w=y.deliveryPrice,x=(y.quantityPerLine,y.brand),E=y.productType,M=y.availableFrequency,O=y.recipeSelectionMode,T=y.name,j=y.itemNumber,N=y.sku,I=new URLSearchParams,F=p&&{title:p.title,image:Object(s.getImageModel)(p.image),pointsAsMarkdown:p.pointsAsMarkdown.pointsAsMarkdown},A=null==k?void 0:k.slice(1),B=l,R=u,L=E===a.a.Extra||E===a.a.OneOff||E===a.a.Donation;if(l>0&&u>0||L)return C&&I.set("ss","1"),{id:r,people:R,dinners:B,description:f,sku:N,itemNumber:j,price:P,recipeCollections:A,cardTag:{text:g,color:Object(d.getColor)(v)},deliveryPrice:w,productOverview:F,cartLink:Object(m.getContentfulLink)(h),orderLink:(n||"")+"/order/"+N+"?"+I.toString(),image:Object(s.getImageModel)(b),brand:x,productType:L?i.ProductType.Extra:i.ProductType.Primary,showServingPrice:!e.hideServingPrice,availableFrequency:M,recipeSelectionMode:O,isSoldOut:e.isSoldOut,name:T,variant:S,proteins:e.protein}}})},a8bL:function(e,t){},aTJK:function(e,t,n){"use strict";n.r(t),n.d(t,"QueryParams",(function(){return B}));var r,o=n("HaE+"),i=n("7tbW"),a=n.n(i),c=n("FyPc"),l=n.n(c),u=n("zZ0H"),s=n.n(u),d=n("TYy9"),m=n.n(d),f=n("zqxM"),p=n.n(f),g=n("o0o1"),v=n.n(g),b=(n("XbcX"),n("c9m3"),n("E9XD"),n("z0sf")),h=n("p+7n"),C=n("Wbzz"),S=n("q1tI"),y=n("vOnD"),P=n("ZmDi"),k=n("MIz4"),w=n("TSYQ"),x=n.n(w),E=n("3qt6"),M=n("eZYV"),O=n("NjgH"),T=n("1i8N"),j=n("ShJo"),N=n("GFwS"),I=function(){var e=Object(o.a)(v.a.mark((function e(t){var n,r,o;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new N.a).setApiKey("31d648fc-7d81-41fa-9e9a-65e34bd36aa0","",""),r=new N.b(n,"https://test-scullery.myfoodbag.co.nz/website",j.a),e.next=5,r.campaignBycode(t);case 5:return o=e.sent,e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var B,R=((r={})[h.Brand.MFB]="CHOICE",r[h.Brand.RMM]="MADE",r[h.Brand.FS]="FSCHOICE",r[h.Brand.BB]="BBCHOICE",r);!function(e){e.selectedBrand="selectedBrand",e.sku="sku"}(B||(B={}));var L=Object(y.default)(b.BagSelector).withConfig({displayName:"ContentfulProductSelectorTabset__StyledBagSelector",componentId:"sc-1pce1zd-0"})(["&&{[role='toolbar']{&.btn-toolbar{@media ","{margin-right:3em;}}}}"],h.LegoBaseTheme.layout.deviceMediaQueries.min.lg),D=y.default.div.withConfig({displayName:"ContentfulProductSelectorTabset__RatingsWrapper",componentId:"sc-1pce1zd-1"})(["margin-top:48px;@media ","{margin-top:32px;}"],(function(e){return e.theme.layout.deviceMediaQueries.max.md}));t.default=function(e){var t,n,r,i=e.baseModel,c=Object(M.c)().sortByArray,u=i,d=Object(O.getSelectedSku)(),f=Object(O.getSelectedBrand)(),g=u.productSelector[0],y=S.useState({recipeCollections:[],showDateSelector:!1,disableDetails:!1,carouselItemVariant:h.RecipeCarouselItemVariants.RecipeCard,showEmptySrcImages:!1}),w=y[0],j=y[1],N=Object(b.useDiscountContext)(),A=N.discount,B=N.isLoading,H=Object(M.a)().trackDataLayerEvent,G=S.useState(),q=G[0],U=G[1],K=Object(C.e)("2874938835"),V=K.allProductDb,z=K.site,J=K.allPromotedCampaignForBrands,_=K.allPreferenceProduct,Q=K.allPreferences,W=K.allGroupedPreferences,Y=g.brand,Z=S.useState("default"===Y?z.siteMetadata.brand:Y),X=Z[0],$=Z[1],ee=_.edges.flatMap((function(e){return e.node})),te=J.edges.flatMap((function(e){return e.node})),ne=["GOURMET","GLUTEN"],re=S.useCallback((function(){return u.productSelector.find((function(e){return e.brand===X}))}),[X,u.productSelector]),oe=S.useCallback((function(){var e,t=re();return null!==(e=null==t?void 0:t.displayType)&&void 0!==e?e:"Preference"}),[re]),ie="Preference"===(r=oe())?Q.edges.flatMap((function(e){return e.node})).map((function(e){var t=e.filters&&e.filters[0];return Object.assign({},e,{recipes:t})})):"Preference Tiles"===r||"Preference Nested"===r||"Preference Flat"===r||"Proof Points"===r?W.edges.flatMap((function(e){return e.node})):[],ae=ie.map((function(e){return function e(t){var n,r;return{brand:t.brand,sortOrder:t.sortOrder,preferenceId:null!==(n=t.preferenceId)&&void 0!==n?n:0,displayName:t.displayName,description:t.description,preferenceName:t.preferenceName,iconSvg:t.iconSvg,state:h.StateType.default,DefaultProductCollectionCode:t.defaultProductCollectionCode,pillBadge:"GOURMET"===t.defaultProductCollectionCode?"+$3.99 Per Plate":void 0,childPreferences:null===(r=t.childPreferences)||void 0===r?void 0:r.map((function(t){return e(t)}))}}(e)})),ce=function e(t){for(var n,r=[],o=F(t);!(n=o()).done;){var i=n.value;i.childPreferences&&0!==i.childPreferences.length?r=r.concat(e(i.childPreferences)):r.push(i)}return r}(ie).filter((function(e){return e.brand===X})),le=V.edges.flatMap((function(e){return e.node})).map((function(e){return Object(P.getProductModel)({__typename:u.__typename,description:"",sku:e.sku,dinners:e.numberOfNights,people:e.numberOfPeopleToFeed,id:e.id,hideServingPrice:!1,isSoldOut:!1},V,z.siteMetadata.gatewayUrl)})).filter((function(e){return Boolean(e)})),ue=new b.ProductsMappingService,se=ee.filter((function(e){return void 0!==e.sku})).reduce((function(e,t){var n=t.code,r=t.sku;return n&&r&&(e[n]=e[n]||[],e[n].push(r)),e}),{});se.MADE=["K00000001","K00000002","K00000003","K00000004"],se.DIABETES=["K00000005","K00000006","K00000007","K00000008","K00000009","K00000010"];var de=ue.assignProductModelsToCollection(le,se),me=new b.BagSelectorStateService(de,[R[h.Brand.RMM]]),fe=de.filter((function(e){return e.productGroupName===R[X]})).flatMap((function(e){return e.products})).find((function(e){return e.itemNumber===d})),pe=de.filter((function(e){return e.productGroupName===R[X]})).flatMap((function(e){return e.products})).filter((function(e){return 4===e.serves})),ge=null!==(t=null==fe?void 0:fe.sku)&&void 0!==t?t:null===(n=l()(pe,(function(e){return e.night})))||void 0===n?void 0:n.sku,ve=function(e){if("Preference"===oe()){if("undefined"!=typeof window){var t=(new URLSearchParams(window.location.search).get("preference")||"").split(",");return ce.filter((function(n){var r;return n.brand===e&&t.includes(null!==(r=n.preferenceName)&&void 0!==r?r:"")&&void 0!==n.preferenceId})).map((function(e){return e.preferenceId.toString()}))}return[]}var n=re(),r=ce.filter((function(e){return e.preferenceName===(null==n?void 0:n.preferencePreSelectedOption)})).map((function(e){var t;return null===(t=e.preferenceId)||void 0===t?void 0:t.toString()}));return r||[]},be=S.useState(ve(X)),he=be[0],Ce=be[1],Se=S.useCallback((function(){var e=re();return null==e?void 0:e.adminCampaignId}),[re]),ye=function(){var e,t=re();return null==t||null===(e=t.proofPoints)||void 0===e?void 0:e.map((function(e){return Object(T.mapHeroCardContentModelToProp)(e,h.HeroCardType.ProofPoint)}))},Pe=function(){var e,t;return null!==(e=null===(t=re())||void 0===t?void 0:t.enrollToCampaign)&&void 0!==e&&e},ke=function(e){var t,n,r,o=re();switch(e){case"heading":return null!==(t=null==o?void 0:o.heading)&&void 0!==t?t:"Tell us what you like";case"preference":return null!==(n=null==o?void 0:o.preferenceSectionHeading)&&void 0!==n?n:"Choose your preference";case"skuSelector":return null!==(r=null==o?void 0:o.nightPeopleSectionHeading)&&void 0!==r?r:"Select your plan";default:return"Section not found"}},we=S.useState({title:ke("skuSelector"),skuSelectorService:me,productsLabel:"Tell us what you like.",nightsLabel:"Meals per week",servingsLabel:"Number of people",skuOverride:ge,hideDisabled:{nights:!0,servings:!0},proofPoints:ye()}),xe=we[0],Ee=we[1];S.useEffect((function(){f&&$(f)}),[f]),S.useEffect((function(){Ce(ve(X))}),[X]);var Me=S.useCallback((function(e){return ce.find((function(t){var n,r;return e.includes(null!==(n=null===(r=t.preferenceId)||void 0===r?void 0:r.toString())&&void 0!==n?n:"")}))}),[ce]),Oe=function(e){var t=ce.find((function(t){var n,r;return e.includes(null!==(n=null===(r=t.preferenceId)||void 0===r?void 0:r.toString())&&void 0!==n?n:"")}));return"MFBDiabetes"===(null==t?void 0:t.preferenceName)?"DIABETES":null==t?void 0:t.defaultProductCollectionCode},Te=S.useState(Oe(he)),je=Te[0],Ne=Te[1];S.useEffect((function(){Ne(Oe(he));var e=X===h.Brand.RMM;Ee(Object.assign({},xe,{title:ke("skuSelector"),productOverride:null!=je?je:R[X],isReadyMadeMeal:e,hideDisabled:{nights:e,servings:e},nightsLabel:e?"Single serve meals per week":"Meals per week",proofPoints:ye()}))}),[he,je,X]);var Ie=S.useState(),Fe=Ie[0],Ae=Ie[1],Be=S.useCallback((function(e){var t,n=le.find((function(t){return t.itemNumber===e})),r=null!==(t=null==n?void 0:n.recipeCollections)&&void 0!==t?t:[];return{product:n,recipeCollections:m()(r.map((function(e){return e.collections})))}}),[]),Re=S.useState(!1),Le=Re[0],De=(Re[1],S.useCallback((function(e){var t,n=Be(null==e?void 0:e.itemNumber),r=n.product,o=n.recipeCollections;if(Le&&(j(Object.assign({},w,{recipeCollections:o})),Ee(Object.assign({},xe,{isReadyMadeMeal:X===h.Brand.RMM,proofPoints:ye()}))),r){var i=Object(b.calculateDiscount)(A,r),a=i.price,c=i.serving,l=null!==(t=r.productType)&&void 0!==t?t:b.ProductType.Primary,u=a.original!==a.discounted,s=Boolean(c&&l===b.ProductType.Primary),d=r.deliveryPrice,m=d>0,f=(parseFloat(a.discounted)+d).toFixed(2),p={showPricePerPlateDiscount:u,showPricePerWeekDiscount:u,pricePerWeek:"$"+a.discounted,pricePerWeekBeforeDiscount:"$"+a.original,pricePerPlate:s?"$"+(null==c?void 0:c.discounted):void 0,pricePerPlateBeforeDiscount:s?"$"+(null==c?void 0:c.original):void 0,deliveryPrice:m?"$"+d.toFixed(2):void 0,totalPrice:m?"$"+f:void 0,primaryButtonText:"Continue",pricePerPlateStringFormat:"Per Plate",pricePerWeekStringFormat:"Per Week"};Ae(p),U(e)}}),[u,A,B,Be,X,Le,xe.productOverride])),He=function(e){var t=le.find((function(t){return t.sku===e})),n=Boolean(t&&t.productType===b.ProductType.Primary),r=z.siteMetadata.accountUrl+"/manage/subscriptions/extras/addbysku/"+e,o=ce.filter((function(e){return he.find((function(t){return t&&e&&t===""+e.preferenceId}))})).filter(s.a),i=new URLSearchParams,a=Qe;a&&i.set("campaignCode",a);var c,l,u=o.filter((function(e){var t,n;return!ne.includes(null!==(t=null===(n=e.defaultProductCollectionCode)||void 0===n?void 0:n.toString())&&void 0!==t?t:"")})),d=Me(he);d&&d.preferenceName&&(l=re(),null!==(c=null==l?void 0:l.excludePreferencesFromInWeekSales)&&void 0!==c?c:[]).includes(d.preferenceName)&&i.set("ebd","1"),d&&"MFBDiabetes"===d.preferenceName&&i.set("har","1"),i.set("prefs",u.map((function(e){return e.preferenceId})).join(",")),i.set("ss","1"),H("add_to_cart",{campaign_code:a,subscription_people:null==t?void 0:t.people.toString(),subscription_nights:null==t?void 0:t.dinners.toString(),selected_brand:X,bag_sku:e,preferences:o.map((function(e){return null==e?void 0:e.displayName})).join("|")});var m=i.toString();return Object(k.getProductSelectEventPath)(r,n,t,m)},Ge=function(){var e=Object(o.a)(v.a.mark((function e(){var t;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:q&&(t=He(q.sku),window.open(t,"_self"));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=S.useCallback((function(e){var t=ce.filter((function(t){return e.includes(""+t.preferenceId)})),n=null==q?void 0:q.itemNumber,r=t.flatMap((function(e){return e.recipes})).flatMap((function(e){return null==e?void 0:e.items})).map((function(e){var t;return null!==(t=null==e?void 0:e.itemNumber)&&void 0!==t?t:""})).filter(s.a);return{heroSku:n,recipeNumbers:a()(r)}}),[null==q?void 0:q.itemNumber]);S.useEffect((function(){if(!Le){var e=qe(he),t=e.heroSku,n=e.recipeNumbers,r=Be(t).recipeCollections.map((function(e){return Object.assign({},e,{recipes:c(e.recipes,n,(function(e){return e.rnumber}))})}));j(Object.assign({},w,{recipeCollections:r}))}}),[Le,he,qe]);var Ue=S.useState(Pe()),Ke=Ue[0],Ve=Ue[1],ze=function(e,t){var n;if(e)return null===(n=te.find((function(e){return e.brand===t})))||void 0===n?void 0:n.campaignCode},Je=function(e,t){if(e)return t},_e=S.useState(ze(Pe(),X)),Qe=_e[0],We=_e[1];S.useEffect((function(){We(ze(Pe(),X)),Ve(Pe())}),[X]);var Ye=S.useState(null),Ze=Ye[0],Xe=Ye[1],$e=S.useRef(null);S.useEffect((function(){if(u.productSelector.length>0){var e=Se();e&&I(e).then((function(t){var n;null!=t&&t.isValidCampaign&&t.brand===X&&($e.current=e,Xe(t),Ke&&We(Je(Ke,null!==(n=$e.current)&&void 0!==n?n:"")))}))}}),[Ke,X,Se,u.productSelector]);var et,tt,nt={title:g.heading,blurb:ke("heading"),hideRecipeCarousel:null!==(et=null===(tt=re())||void 0===tt?void 0:tt.hideRecipeCarousel)&&void 0!==et&&et,recipeCarouselContext:w,productPriceDisplayContext:Fe,variant:b.BagSelectorLayoutVariant.mealPreferencesPreferenceFirst,primaryCtaLabel:function(){var e,t,n=re();return{desktop:null!==(e=null==n?void 0:n.primaryCallToActionText)&&void 0!==e?e:"Continue this plan",mobile:null!==(t=null==n?void 0:n.primaryCallToActionText)&&void 0!==t?t:"Continue"}}(),reviews:S.createElement(D,null,S.createElement(E.a,null)),preferenceSelectorContext:{selectedBrand:X,title:ke("preference"),preferenceSelections:ae,onClick:function(e){return function(e){void 0===e&&(e=[]);var t=e.map((function(e){return e.toString()})),n=p()(t,he)[0],r=p()(he,t)[0];if(n||r){var o=n?"selected":"unselected",i="selected"===o?n:r,a=ce.find((function(e){return e.preferenceId===Number(i)})),c=ce.filter((function(e){return t.find((function(t){return t===""+e.preferenceId}))})).filter(s.a);H("preferences_"+o,{preferences:c.map((function(e){return null==e?void 0:e.displayName})).join("|"),preference_modified:null==a?void 0:a.displayName}),Ce(t),Ne(Oe(t))}}([e])},variant:function(){switch(oe()){case"Preference Tiles":return"tiles";case"Preference Nested":return"nested";default:return"default"}}(),useQueryParams:!0,specialBagHeadingText:"OR select Special Bags"},recipeSurchargeNotice:"Please note that certain recipes featured may be subject to a surcharge. Pricing information will be clearly displayed in your account area when selecting recipes.",mealPreferenceSelectorLayoutOptions:{isPrimaryCtaOffset:!0,displayProofPoints:"Proof Points"===oe()},skuSelectorContext:xe,skuSelectorOnResult:De,campaignToggle:function(e){if(n=re(),null!==(t=null==n?void 0:n.showBrandCampaign)&&void 0!==t&&t){var t,n;if(null!=Ze&&null!=$e.current)return{header:Ze.joinTitle,description:Ze.joinDescription,termsAndConditions:"T&C's apply",onChange:function(e){var t;Ve(e),We(Je(e,null!==(t=$e.current)&&void 0!==t?t:""))},isChecked:Ke};var r=te.find((function(t){return t.brand===e}));if(r)return{header:r.joinTitle,description:r.joinDescription,termsAndConditions:"T&C's apply",onChange:function(t){Ve(t),We(ze(t,e))},isChecked:Ke}}}(X),productPricePrimaryOnClickAsync:Ge};return S.createElement("div",Object.assign({className:x()("container-fluid","d-flex","justify-content-center p-0")},{},{style:{backgroundColor:"transparent"}}),S.createElement("div",{style:{width:"100%",maxWidth:"1370px"}},S.createElement(h.BrandSelector,{visible:u.productSelector.length>1,selectedBrand:X,onClickCallback:function(e){$(e)}},S.createElement(L,Object.assign({},nt,{className:"px-4 my-0 my-md-3"})))))}},asDA:function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},au2c:function(e,t,n){"use strict";n.r(t)},"be+8":function(e,t){},"cXj/":function(e,t,n){"use strict";n.r(t)},cYuE:function(e,t){},cn9q:function(e,t){},"d2B/":function(e,t){},d6nk:function(e,t,n){"use strict";n.r(t)},dI55:function(e,t,n){"use strict";n.r(t)},dVn5:function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},dunj:function(e,t,n){var r=n("/9aa");e.exports=function(e,t,n){for(var o=-1,i=e.length;++o<i;){var a=e[o],c=t(a);if(null!=c&&(void 0===l?c==c&&!r(c):n(c,l)))var l=c,u=a}return u}},e6Oj:function(e,t){},epGF:function(e,t,n){var r={"./BaseContentModel":"02Mq","./BaseContentModel.ts":"02Mq","./BaseInfoFragment":"+89e","./BaseInfoFragment.ts":"+89e","./ComponentConfig":"T33S","./ComponentConfig.ts":"T33S","./ComponentIndex":"4rPF","./ComponentIndex.tsx":"4rPF","./ContentfulBaseProps":"g1E3","./ContentfulBaseProps.ts":"g1E3","./FeaturesFragment":"Uskz","./FeaturesFragment.ts":"Uskz","./GatsbyNavProps":"Bw8J","./GatsbyNavProps.ts":"Bw8J","./PathRulesHoc":"ymsD","./PathRulesHoc.tsx":"ymsD","./SiteMetadataFragment":"C+De","./SiteMetadataFragment.ts":"C+De","./SiteMetadataHoc":"GztK","./SiteMetadataHoc.tsx":"GztK","./SiteMetadataQueryModel":"WPtl","./SiteMetadataQueryModel.ts":"WPtl","./WebsiteCookbook":"iEW7","./WebsiteCookbook.ts":"iEW7","./actionButton/ActionButtonContentModel":"wlLi","./actionButton/ActionButtonContentModel.ts":"wlLi","./actionButton/ActionButtonFragment":"PLbB","./actionButton/ActionButtonFragment.ts":"PLbB","./asset/AssetContentModel":"E8HI","./asset/AssetContentModel.ts":"E8HI","./asset/AssetFragment":"MG3A","./asset/AssetFragment.ts":"MG3A","./bagSelector/BagSelectorContentModel":"BTFV","./bagSelector/BagSelectorContentModel.ts":"BTFV","./bagSelector/BagSelectorFragment":"KR7t","./bagSelector/BagSelectorFragment.ts":"KR7t","./bagSelector/CampaignToggle":"F17q","./bagSelector/CampaignToggle.ts":"F17q","./bagSelector/ContentfulBagSelector":"FFKw","./bagSelector/ContentfulBagSelector.tsx":"FFKw","./bagSelector/PreSelectedBag":"2xBr","./bagSelector/PreSelectedBag.ts":"2xBr","./bagSelector/PreferencesFragment":"vRIT","./bagSelector/PreferencesFragment.ts":"vRIT","./brandGroup/BrandGroupContentModel":"au2c","./brandGroup/BrandGroupContentModel.ts":"au2c","./brandGroup/BrandGroupFragment":"HEOd","./brandGroup/BrandGroupFragment.ts":"HEOd","./bulletPointCard/BulletPointCardContentModel":"Kecl","./bulletPointCard/BulletPointCardContentModel.ts":"Kecl","./bulletPointCard/BulletPointCardFragment":"Psa5","./bulletPointCard/BulletPointCardFragment.ts":"Psa5","./bulletPointCard/ContentfulBulletPointCard":"n4EW","./bulletPointCard/ContentfulBulletPointCard.tsx":"n4EW","./callToActionCard/CallToActionCardFragment":"xKB1","./callToActionCard/CallToActionCardFragment.ts":"xKB1","./callToActionCard/ContentfulCallToActionCard":"KtLF","./callToActionCard/ContentfulCallToActionCard.tsx":"KtLF","./callToActionCard/ContentfulCallToActionCardContentModel":"6IB/","./callToActionCard/ContentfulCallToActionCardContentModel.ts":"6IB/","./calorieCalculatorRender/CalorieCalculatorRenderFragment":"p5oy","./calorieCalculatorRender/CalorieCalculatorRenderFragment.ts":"p5oy","./calorieCalculatorRender/ContentfulRawHtmlRender":"TpFE","./calorieCalculatorRender/ContentfulRawHtmlRender.tsx":"TpFE","./calorieCalculatorRender/ContentfulRawHtmlRenderModel":"d2B/","./calorieCalculatorRender/ContentfulRawHtmlRenderModel.ts":"d2B/","./color/ColorContentModel":"RJQD","./color/ColorContentModel.ts":"RJQD","./color/ColorFragment":"BsSj","./color/ColorFragment.ts":"BsSj","./doubleMerchSlot/ContentfulDoubleMerchSlot":"PT62","./doubleMerchSlot/ContentfulDoubleMerchSlot.tsx":"PT62","./doubleMerchSlot/DoubleMerchSlotContentModel":"0bbM","./doubleMerchSlot/DoubleMerchSlotContentModel.ts":"0bbM","./doubleMerchSlot/DoubleMerchSlotFragment":"Bqjl","./doubleMerchSlot/DoubleMerchSlotFragment.ts":"Bqjl","./faqCard/ContentfulFaqCard":"3y7o","./faqCard/ContentfulFaqCard.tsx":"3y7o","./faqCard/FaqCardContentModel":"5Yvf","./faqCard/FaqCardContentModel.ts":"5Yvf","./faqCard/FaqCardFragment":"i38A","./faqCard/FaqCardFragment.ts":"i38A","./footer/ContentfulFooter":"P80x","./footer/ContentfulFooter.tsx":"P80x","./footer/FooterContentModel":"yO05","./footer/FooterContentModel.ts":"yO05","./footer/footerFragment":"3RUi","./footer/footerFragment.ts":"3RUi","./heroCard/ContentfulHeroCard":"tfZ7","./heroCard/ContentfulHeroCard.tsx":"tfZ7","./heroCard/HeroCardContentModel":"LAUS","./heroCard/HeroCardContentModel.ts":"LAUS","./heroCard/HeroCardFragment":"tAQo","./heroCard/HeroCardFragment.ts":"tAQo","./heroCard/ModelToPropMapper":"1i8N","./heroCard/ModelToPropMapper.ts":"1i8N","./instagramSection/ContentfulInstagramSection":"9PsL","./instagramSection/ContentfulInstagramSection.tsx":"9PsL","./instagramSection/InstagramSectionContentModel":"Jz4a","./instagramSection/InstagramSectionContentModel.ts":"Jz4a","./jumbotron/ContentfulJumbotron":"UOL7","./jumbotron/ContentfulJumbotron.tsx":"UOL7","./jumbotron/ContentfulSimpleJumbotron":"v277","./jumbotron/ContentfulSimpleJumbotron.tsx":"v277","./jumbotron/JumbotronContentModel":"XKfS","./jumbotron/JumbotronContentModel.ts":"XKfS","./jumbotron/JumbotronFragment":"a8bL","./jumbotron/JumbotronFragment.ts":"a8bL","./jumbotron/SimpleJumbotronContentModel":"M1lA","./jumbotron/SimpleJumbotronContentModel.ts":"M1lA","./jumbotron/SimpleJumbotronFragment":"ihA0","./jumbotron/SimpleJumbotronFragment.ts":"ihA0","./labeledLink/LabelLinkFragment":"FKh5","./labeledLink/LabelLinkFragment.ts":"FKh5","./labeledLink/LabeledLinkContentModel":"RI75","./labeledLink/LabeledLinkContentModel.ts":"RI75","./landingPage/LandingPageContentModel":"f8aN","./landingPage/LandingPageContentModel.ts":"f8aN","./landingPage/LandingPageFragment":"/u5P","./landingPage/LandingPageFragment.ts":"/u5P","./lineBreak/ContentfulLineBreak":"Fn46","./lineBreak/ContentfulLineBreak.tsx":"Fn46","./lineBreak/LineBreakContentModel":"G4GL","./lineBreak/LineBreakContentModel.ts":"G4GL","./lineBreak/LineBreakFragment":"yZTi","./lineBreak/LineBreakFragment.ts":"yZTi","./link/LinkContentModel":"dvv6","./link/LinkContentModel.ts":"dvv6","./link/LinkFragment":"VUwh","./link/LinkFragment.ts":"VUwh","./markdown/ContentfulMarkdown":"n7uy","./markdown/ContentfulMarkdown.tsx":"n7uy","./markdown/MarkdownContentModel":"H+ae","./markdown/MarkdownContentModel.ts":"H+ae","./markdown/MarkdownFragment":"CaaT","./markdown/MarkdownFragment.ts":"CaaT","./mealSelector/ContentfulMealSelector":"s+QH","./mealSelector/ContentfulMealSelector.tsx":"s+QH","./mealSelector/MealSelectorContentModel":"dI55","./mealSelector/MealSelectorContentModel.ts":"dI55","./mealSelector/MealSelectorFragment":"5npC","./mealSelector/MealSelectorFragment.ts":"5npC","./menu/ContentfulMenu":"znXw","./menu/ContentfulMenu.tsx":"znXw","./menu/MenuContentModel":"7bJe","./menu/MenuContentModel.ts":"7bJe","./menu/MenuFragment":"lrLE","./menu/MenuFragment.ts":"lrLE","./merchSlot/ContentfulMerchSlot":"xzqD","./merchSlot/ContentfulMerchSlot.tsx":"xzqD","./merchSlot/MerchSlotContentModel":"Wa6b","./merchSlot/MerchSlotContentModel.ts":"Wa6b","./merchSlot/MerchSlotFragment":"Lnx5","./merchSlot/MerchSlotFragment.ts":"Lnx5","./merchandising/ContentfulMerchandising":"rEa+","./merchandising/ContentfulMerchandising.tsx":"rEa+","./merchandising/MerchandisingContentModel":"cn9q","./merchandising/MerchandisingContentModel.ts":"cn9q","./merchandising/MerchandisingFragment":"U2oN","./merchandising/MerchandisingFragment.ts":"U2oN","./metadata/MetadataContentModel":"T71h","./metadata/MetadataContentModel.ts":"T71h","./metadata/MetadataFragment":"Jl6Y","./metadata/MetadataFragment.ts":"Jl6Y","./pageSection/ContentfulPageSection":"P7MK","./pageSection/ContentfulPageSection.tsx":"P7MK","./pageSection/PageSectionContentModel":"g3ON","./pageSection/PageSectionContentModel.ts":"g3ON","./pageSection/PageSectionFragment":"X21I","./pageSection/PageSectionFragment.ts":"X21I","./pageSettings/PageSettingsContentModel":"uXQ0","./pageSettings/PageSettingsContentModel.ts":"uXQ0","./pageSettings/PageSettingsFragment":"LCEI","./pageSettings/PageSettingsFragment.ts":"LCEI","./product/ContentfulProduct":"wJr2","./product/ContentfulProduct.tsx":"wJr2","./product/ProductContentModel":"d6nk","./product/ProductContentModel.ts":"d6nk","./product/ProductFragment":"40Is","./product/ProductFragment.ts":"40Is","./product/getProductModel":"ZmDi","./product/getProductModel.ts":"ZmDi","./productCard/AllProductsQueryModel":"GCAQ","./productCard/AllProductsQueryModel.ts":"GCAQ","./productCard/ProductCardContentModel":"UGk3","./productCard/ProductCardContentModel.ts":"UGk3","./productCard/ProductDbFragment":"fvgL","./productCard/ProductDbFragment.ts":"fvgL","./productCard/ProductRecipeCollectionFragment":"6E1d","./productCard/ProductRecipeCollectionFragment.ts":"6E1d","./productCartSection/ContentfulProductCartSection":"LbEA","./productCartSection/ContentfulProductCartSection.tsx":"LbEA","./productCartSection/ProductCartQueryModel":"m+rq","./productCartSection/ProductCartQueryModel.tsx":"m+rq","./productCartSection/ProductCartSectionContentModel":"pVkj","./productCartSection/ProductCartSectionContentModel.ts":"pVkj","./productCartSection/ProductCartSectionFragment":"yioD","./productCartSection/ProductCartSectionFragment.ts":"yioD","./productCartSection/__mocks__/getSkuFromQueryParams":"xoYE","./productCartSection/__mocks__/getSkuFromQueryParams.ts":"xoYE","./productCartSection/getSkuFromQueryParams":"iiTp","./productCartSection/getSkuFromQueryParams.ts":"iiTp","./productCartSection/mergeToCartProducts":"vD5k","./productCartSection/mergeToCartProducts.tsx":"vD5k","./productGroup/ContentfulProductGroup":"8q8R","./productGroup/ContentfulProductGroup.tsx":"8q8R","./productGroup/ProductGroupContentModel":"GZDz","./productGroup/ProductGroupContentModel.ts":"GZDz","./productGroup/ProductGroupFragment":"tA2Z","./productGroup/ProductGroupFragment.ts":"tA2Z","./productGroup/getProductGroupModel":"Vjiz","./productGroup/getProductGroupModel.ts":"Vjiz","./productGroup/getProductSelectEventPath":"MIz4","./productGroup/getProductSelectEventPath.ts":"MIz4","./productGroupHero/ContentfulProductGroupHero":"uqsa","./productGroupHero/ContentfulProductGroupHero.tsx":"uqsa","./productGroupHero/ProductGroupHeroContentModel":"6FQD","./productGroupHero/ProductGroupHeroContentModel.ts":"6FQD","./productGroupHero/ProductGroupHeroFragment":"GoNP","./productGroupHero/ProductGroupHeroFragment.ts":"GoNP","./productGroupProtein/ContentfulProductGroupProtein":"gFc8","./productGroupProtein/ContentfulProductGroupProtein.tsx":"gFc8","./productGroupProtein/ProductGroupProteinContentModel":"YxO1","./productGroupProtein/ProductGroupProteinContentModel.ts":"YxO1","./productGroupProtein/ProductGroupProteinFragment":"8F2k","./productGroupProtein/ProductGroupProteinFragment.ts":"8F2k","./productSelectorTabSet/ContentfulProductSelectorTabset":"aTJK","./productSelectorTabSet/ContentfulProductSelectorTabset.tsx":"aTJK","./productSelectorTabSet/GroupedPreferencesFragment":"7/KX","./productSelectorTabSet/GroupedPreferencesFragment.ts":"7/KX","./productSelectorTabSet/PreSelectedBag":"NjgH","./productSelectorTabSet/PreSelectedBag.ts":"NjgH","./productSelectorTabSet/PreSelectedProduct":"1xVR","./productSelectorTabSet/PreSelectedProduct.ts":"1xVR","./productSelectorTabSet/ProductSelectorTabSetContentModel":"A28u","./productSelectorTabSet/ProductSelectorTabSetContentModel.ts":"A28u","./productSelectorTabSet/ProductSelectorTabSetFragment":"Cu3c","./productSelectorTabSet/ProductSelectorTabSetFragment.ts":"Cu3c","./productSelectorTabSet/PromotedCampaignForBrandsFragment":"0UC8","./productSelectorTabSet/PromotedCampaignForBrandsFragment.ts":"0UC8","./productSelectorTabSet/preferenceProductFragment":"6l8G","./productSelectorTabSet/preferenceProductFragment.ts":"6l8G","./recipeCarousel/ContentfulRecipeCarousel":"V8Yo","./recipeCarousel/ContentfulRecipeCarousel.tsx":"V8Yo","./recipeCarousel/RecipeCarouselContentModel":"wsBB","./recipeCarousel/RecipeCarouselContentModel.ts":"wsBB","./recipeCarousel/RecipeCarouselFragment":"3vk5","./recipeCarousel/RecipeCarouselFragment.ts":"3vk5","./referralSection/imageLinkFragment":"ndAZ","./referralSection/imageLinkFragment.ts":"ndAZ","./referralSection/imageLinkModel":"6rZg","./referralSection/imageLinkModel.ts":"6rZg","./referralSection/referralSectionModel":"O6xf","./referralSection/referralSectionModel.ts":"O6xf","./responsiveImageSet/ContentfulResponsiveImageSet":"IDh5","./responsiveImageSet/ContentfulResponsiveImageSet.tsx":"IDh5","./responsiveImageSet/ResponsiveImageSetContentModel":"+9EZ","./responsiveImageSet/ResponsiveImageSetContentModel.ts":"+9EZ","./responsiveImageSet/ResponsiveImageSetFragment":"mnvD","./responsiveImageSet/ResponsiveImageSetFragment.ts":"mnvD","./reviewSection/AllReviewQueryModel":"D56/","./reviewSection/AllReviewQueryModel.ts":"D56/","./reviewSection/ReviewFragment":"nhfR","./reviewSection/ReviewFragment.ts":"nhfR","./simpleHeader/ContentfulSimpleHeader":"OIC7","./simpleHeader/ContentfulSimpleHeader.tsx":"OIC7","./simpleHeader/SimpleHeaderContentModel":"+hSc","./simpleHeader/SimpleHeaderContentModel.ts":"+hSc","./simpleHeader/SimpleHeaderFragment":"ZVYO","./simpleHeader/SimpleHeaderFragment.ts":"ZVYO","./subscriptionPlan/ContentfulSubscriptionPlan":"T/i5","./subscriptionPlan/ContentfulSubscriptionPlan.tsx":"T/i5","./subscriptionPlan/SubscriptionPlanContentModel":"cYuE","./subscriptionPlan/SubscriptionPlanContentModel.ts":"cYuE","./subscriptionPlan/SubscriptionPlanFragment":"oIfz","./subscriptionPlan/SubscriptionPlanFragment.ts":"oIfz","./termsAndConditionsSection/ContentfulTermsAndConditionsSection":"qJXn","./termsAndConditionsSection/ContentfulTermsAndConditionsSection.tsx":"qJXn","./termsAndConditionsSection/TermsAndConditionsSectionContentModel":"ZlMb","./termsAndConditionsSection/TermsAndConditionsSectionContentModel.ts":"ZlMb","./termsAndConditionsSection/TermsAndConditionsSectionFragment":"be+8","./termsAndConditionsSection/TermsAndConditionsSectionFragment.ts":"be+8","./termsSection/TermsSectionContentModel":"cXj/","./termsSection/TermsSectionContentModel.ts":"cXj/","./termsSection/TermsSectionFragment":"GN6j","./termsSection/TermsSectionFragment.ts":"GN6j","./termsSubsection/TermsSubsectionContentModel":"oNq4","./termsSubsection/TermsSubsectionContentModel.ts":"oNq4","./termsSubsection/TermsSubsectionFragment":"DU8A","./termsSubsection/TermsSubsectionFragment.ts":"DU8A","./twoColumnSection/ContentfulTwoColumnSection":"Ohk0","./twoColumnSection/ContentfulTwoColumnSection.tsx":"Ohk0","./twoColumnSection/ContentfulVideoTwoColumnSection":"1+pq","./twoColumnSection/ContentfulVideoTwoColumnSection.tsx":"1+pq","./twoColumnSection/TwoColumnSectionContentModel":"gTfX","./twoColumnSection/TwoColumnSectionContentModel.ts":"gTfX","./twoColumnSection/TwoColumnSectionFragment":"PjvT","./twoColumnSection/TwoColumnSectionFragment.ts":"PjvT","./twoColumnSection/VideoTwoColumnSectionContentModel":"Kf58","./twoColumnSection/VideoTwoColumnSectionContentModel.ts":"Kf58","./twoColumnSection/VideoTwoColumnSectionFragment":"e6Oj","./twoColumnSection/VideoTwoColumnSectionFragment.ts":"e6Oj","./videoEmbed/ContentfulVideoEmbed":"0dqJ","./videoEmbed/ContentfulVideoEmbed.tsx":"0dqJ","./videoEmbed/VideoEmbedFragment":"//bI","./videoEmbed/VideoEmbedFragment.ts":"//bI","./videoEmbed/VideoEmbedModel":"mVk8","./videoEmbed/VideoEmbedModel.ts":"mVk8","./videoEmbed/VideoSource":"AxPg","./videoEmbed/VideoSource.ts":"AxPg"};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id="epGF"},f8aN:function(e,t){},fo6e:function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},fvgL:function(e,t){},g1E3:function(e,t,n){"use strict";n.r(t)},g3ON:function(e,t){},gFc8:function(e,t){},gTfX:function(e,t,n){"use strict";n.r(t)},hypo:function(e,t,n){var r=n("O0oS");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},i38A:function(e,t){},ihA0:function(e,t){},iiTp:function(e,t,n){"use strict";n.r(t),n.d(t,"getSkuFromQueryParams",(function(){return r}));var r=function(){return new URLSearchParams(window.location.search).get("sku")||void 0};t.default={getSkuFromQueryParams:r}},lrLE:function(e,t){},"m+rq":function(e,t,n){"use strict";n.r(t)},mNz5:function(e,t,n){var r=n("dt0z"),o=0;e.exports=function(e){var t=++o;return r(e)+t}},mVk8:function(e,t){},mnvD:function(e,t){},n4EW:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("E8HI");t.default=function(e){var t=e.baseModel;return o.createElement(r.BulletPointCard,{className:"my-2",title:t.title,image:Object(i.getImageModel)(t.image),pointsAsMarkdown:t.pointsAsMarkdown.pointsAsMarkdown.trim()})}},n7uy:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("RJQD");t.default=function(e){var t=e.baseModel;return o.createElement(r.Markdown,{text:t.childContentfulMarkdownTextTextNode.text,alignment:Object(r.mapAlignment)(t.alignment),fontColor:Object(i.getColor)(t.fontColor)})}},ndAZ:function(e,t){},nhfR:function(e,t){},noZS:function(e,t,n){var r=n("hypo"),o=n("JC6p"),i=n("ut/Y");e.exports=function(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,o,t(e,o,i))})),n}},oIfz:function(e,t){},oNq4:function(e,t){},oY9k:function(e,t,n){"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,t.default=r.fetch.bind(r),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},p5oy:function(e,t){},pVkj:function(e,t){},qJXn:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("dI71"),i=n("TSYQ"),a=n.n(i),c=n("p+7n"),l=n("IujW"),u=n.n(l),s=n("wdn8"),d=n.n(s),m=function(e){var t=e.id,n=e.text,o=e.title,i=(0,e.onSectionNumberAssignment)();return r.createElement("section",{key:t},r.createElement(c.Bold,null,r.createElement("p",{id:"condition-"+i},i+". "+o)),r.createElement("div",{className:""+d.a.condition},r.createElement(u.a,{source:n,allowedTypes:["root","text","break","paragraph","emphasis","strong","thematicBreak","blockquote","delete","link","image","linkReference","imageReference","list","listItem","heading"],unwrapDisallowed:!0})))},f=function(e){var t=e.id,n=e.subsections,o=e.title,i=e.onSectionNumberAssignment,a=encodeURIComponent(o.replace(/[^a-zA-Z0-9\- ]/g,"").trim().replace(/\s/g,"-").toLowerCase());return r.createElement("section",{key:t},r.createElement("h1",{className:"h1 display-4",id:a},o),n&&n.filter((function(e){return e.text&&""!==e.text})).map((function(e,t){return r.createElement(m,{key:e.id+"-"+t,id:e.id,title:e.title,onSectionNumberAssignment:i,text:e.text})})))},p=function(e){function t(t){var n;return(n=e.call(this,t)||this).sectionNumber=0,n}return Object(o.a)(t,e),t.prototype.render=function(){var e=this,t=this.props.sections.filter((function(e){return e.subsections&&e.subsections.length>0})),n=function(){return e.sectionNumber+=1,e.sectionNumber};return r.createElement("article",{className:a()("container pt-4 px-5")},t.map((function(e,t){return r.createElement(f,{key:e.id+"-"+t,id:e.id,title:e.title,subsections:e.subsections,onSectionNumberAssignment:n})})))},t}(r.Component);t.default=function(e){var t=e.baseModel,n=t.terms.map((function(e){return{subsections:e.subsections.map((function(e){return{id:e.id,title:e.title,text:e.childContentfulTermsSubsectionTextTextNode&&e.childContentfulTermsSubsectionTextTextNode.text||""}})),title:e.title,id:e.id}}));return r.createElement(p,{id:t.id,title:t.title,sections:n})}},qRkn:function(e,t,n){var r=n("3cYt")({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},"rEa+":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("p+7n"),i=n("OQbj"),a=function(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},r.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.createElement("path",{fill:"white",d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}))},c=function(e){var t=e.img,n=e.tag,c=e.title,l=e.subtitle,u=e.backgroundColor,s=e.mediaLink;return r.createElement("div",{className:"row w-100",style:{backgroundColor:u}},r.createElement("div",{className:"col-12 col-lg-6 text-white px-0"},r.createElement(o.CardTag,Object.assign({className:"mx-5 p-1 rounded-bottom"},n)),r.createElement("div",{className:"m-5 my-lg-0 row pt-4"},r.createElement("div",{className:"col-md-10 px-0"},r.createElement("h1",{className:"display-3 px-0 mb-4"},c),r.createElement("p",{className:"px-0 mb-2"},l),s&&s.url&&r.createElement("a",{rel:"noopener noreferrer",href:s.url,target:"_blank",className:"d-flex align-items-center text-uppercase text-white"},r.createElement("small",{className:"mr-1"},r.createElement(o.Bold,null,s.label)," "),r.createElement(a,null))))),r.createElement("div",{className:"col-12 col-lg-6 px-0"},r.createElement(i.a,{alt:c,image:t})))},l=n("AVYR"),u=function(e){var t=e.id,n=e.img,i=e.title,a=e.subtitle,c=e.backgroundColor,u=e.mediaLink,s=u&&u.url;return r.createElement("div",{className:"col-12 col-md-4 px-0 py-2 text-white p-md-2"},r.createElement(l.a,{link:s,style:{backgroundColor:c}},r.createElement(o.ResponsiveSquare,{id:t},r.createElement(o.ResponsiveBackground,{className:"justify-content-end align-items-center w-100 h-100 p-2",id:t,image:n,backgroundStyle:{gradient:"linear-gradient(to top, rgba(33,33,33,0.6) 0%, rgba(0,0,0,0) 75%)"}},r.createElement(r.Fragment,null,r.createElement("h1",{className:"h4 pb-2 p-lg-4 text-center"},a),r.createElement(o.ResponsiveTitle,{id:t,text:i,className:"text-center display-1 pb-0 pb-md-2",fontSizes:{small:"4rem",large:"5.5rem"}}))))))},s=n("wlLi"),d=n("RJQD"),m="Full-Width Video",f="Square";t.default=function(e){var t=e.baseModel,n=t.mediaLink&&Object(s.mapActionButton)(t.mediaLink),o={text:t.tabText,color:Object(d.getColor)(t.tabColor)},i={id:t.id,title:t.title,tag:o,subtitle:t.subtitle,img:t.image.file.url,backgroundColor:t.backgroundColor.colorHex,mediaLink:t.mediaLink&&n};switch(t.cardType){case m:return r.createElement(c,i);case f:return r.createElement(u,i);default:return null}}},"s+QH":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return b}));var r=n("dI71"),o=n("Wbzz"),i=n("q1tI"),a=n("HaE+"),c=n("o0o1"),l=n.n(c),u=n("z0sf"),s=n("p+7n"),d=n("bTjV"),m=n("O2s4"),f=n("4wU3"),p=n("APsI"),g=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={recipes:[],isLoading:!0,deliveryDateDescription:void 0,productName:void 0},n}Object(r.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){var e=Object(a.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,new f.e("").upcomingSelectionRecipes(this.props.sku);case 3:t=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.log("Failed to load recipe information. "+e.t0.message);case 9:return e.prev=9,t&&t.recipes&&t.recipes.length>0?this.setState({recipes:t.recipes,isLoading:!1,deliveryDateDescription:t.deliveryDateDescription,productName:t.productName}):this.setState({recipes:[],isLoading:!1},(function(){Object(o.d)("/error",{replace:!0})})),e.finish(9);case 12:case"end":return e.stop()}}),e,this,[[0,6,9,12]])})));return function(){return e.apply(this,arguments)}}(),n.handleMealsSelected=function(){var e=Object(a.a)(l.a.mark((function e(t){var n,r=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,new f.a("").createCart({lines:[{sku:this.props.sku,quantity:1,selectedRecipes:Object.keys(t).map((function(e){var n=r.state.recipes.find((function(t){return t.recipeGroupRecipeId===e}));if(n)return{recipeCategoryId:n.recipeCategoryId,quantity:t[e],recipeNumber:n.recipeNumber,recipeVersion:n.recipeVersion,recipePartition:n.recipePartition}})).filter(s.isNotNullOrUndefined)}]});case 4:n=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),console.log("Failed to create cart. "+e.t0.message);case 10:return e.prev=10,n&&n.id?window.location.assign(this.props.orderLink+"?cart="+n.id):Object(o.d)("/error",{replace:!0}),e.finish(10);case 13:case"end":return e.stop()}}),e,this,[[1,7,10,13]])})));return function(t){return e.apply(this,arguments)}}(),n.handleCancel=function(){window.history.back()},n.render=function(){var e=this,t=this.state,n=t.recipes,r=t.isLoading,o=t.deliveryDateDescription,c=t.productName;if(r)return i.createElement("div",{className:"d-flex align-items-center justify-content-center",style:{height:"60vh"}},i.createElement(d.a,{style:{width:"3rem",height:"3rem"},color:"primary"}));if(0===n.length)return null;var s,f,g,v=this.props.recipeSelectionMode===m.b.Single,b=n.map((function(e){return{id:e.recipeGroupRecipeId,description:e.name||"",tags:e.recipeTagNames,badges:e.recipeBadgeNames,maxQuantity:v?1:void 0,image:{id:"img-"+e.recipeGroupRecipeId,src:e.imageUrl||"",alt:e.name||""},recipeModalModel:v?void 0:e,onOpenModal:(t=Object(a.a)(l.a.mark((function t(n){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==e.recipeId){t.next=4;break}throw new Error("onOpenModal received a recipe without a recipeId. Is this on purpose?");case 4:return t.t0=n,t.next=7,Object(p.b)(e.recipeNumber,e.recipeVersion,e.recipePartition,e.recipeId);case 7:t.t1=t.sent,t.t0.setModel.call(t.t0,t.t1);case 9:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t}));if(o){var h=o.split(" ",3);s="For "+(g=h.join(" "))+" delivery",f=h[0].substring(0,3)+" "+h[1]+" "+h[2].substring(0,3)}return i.createElement(u.CartSection,{items:b,title:"Select your meals",subtitle:s,cartSubtitle:f,desktopSummaryMaxHeight:"calc(100vh - 450px)",responsiveCardsPerRow:{small:2,medium:3,large:3,extraLarge:3},disableModal:!0,cartTitle:{desktop:"Your meals",mobile:"Select meals"},selectionLimit:this.props.amountToPick,deliveryDate:g,productName:c,onSubmit:function(){var t=Object(a.a)(l.a.mark((function t(n){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.handleMealsSelected(n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),onCancel:function(){return e.handleCancel()}})},t}(i.Component),v=n("dvv6"),b=function(e){function t(){return e.apply(this,arguments)||this}Object(r.a)(t,e);var n=t.prototype;return n.validNavProps=function(e){return!!(e&&e.amountToPick&&e.orderLink&&e.sku)},n.componentDidMount=function(){if(!this.validNavProps(this.props.navProps)){var e=this.props.baseModel,t=Object(v.getContentfulLink)(e.returnUrl)||"/";Object(o.d)(t,{replace:!0})}},n.render=function(){var e=this.props.navProps;if(!e)return null;var t=e.sku,n=e.amountToPick,r=e.orderLink,o=e.recipeSelectionMode;return t&&n&&r&&i.createElement(g,{sku:t,amountToPick:n,orderLink:r,recipeSelectionMode:o})||null},t}(i.PureComponent)},sgoq:function(e,t,n){var r=n("asDA"),o=n("TKrE"),i=n("6nK8"),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},tA2Z:function(e,t){},tAQo:function(e,t){},tfZ7:function(e,t,n){"use strict";n.r(t),n.d(t,"mapHeroCardType",(function(){return l}));var r=n("p+7n"),o=n("q1tI"),i=n("wlLi"),a=n("E8HI"),c=n("RJQD"),l=function(e){return r.HeroCardType[e]};t.default=function(e){var t=e.baseModel;return o.createElement(r.HeroCard,{title:t.title,image:Object(a.getImageModel)(t.image),description:t.description,color:Object(c.getColor)(t.color),type:l(t.cardType)||r.HeroCardType.Small,button:t.button&&Object(i.mapActionButton)(t.button),alignment:Object(r.mapAlignment)(t.alignment)})}},uXQ0:function(e,t){},uqsa:function(e,t,n){"use strict";n.r(t);var r=n("afOK"),o=n.n(r),i=n("z0sf"),a=n("p+7n"),c=n("Wbzz"),l=n("q1tI"),u=n("TYy9"),s=n.n(u),d=n("TSYQ"),m=n.n(d),f=n("HaE+"),p=n("o0o1"),g=n.n(p),v=n("N1om"),b=n.n(v),h=n("HMs9"),C=n.n(h),S={arrowClassNames:"mx-0 mx-md-1",arrowDistanceFromTop:"43%"},y=function(e){var t=l.useState(o()(e.recipeCollections.map((function(e){return e.day})))),n=t[0],r=t[1],c=l.useState(!1),u=c[0],d=c[1],f=l.useState(),p=f[0],g=f[1],v=l.useContext(i.CookbookStrategyContext),h=l.useCallback((function(t,n,r){var o,a;d(!0),g(void 0);var c=e.recipeCollections&&(null===(o=e.recipeCollections[0])||void 0===o?void 0:o.date.toString());v&&(null===(a=v.getRecipeDetailByWeek)||void 0===a||a.call(v,t,n,r,c?new Date(c):new Date).then((function(e){g(Object(i.mapRecipeResponseToDetailedCardProps)(e,!1))})))}),[v]),y=l.useMemo((function(){var t=e.recipeCollections.filter((function(e){return e.day===n})).map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e})),r=s()(t.map((function(e){return e.recipes.filter((function(e){return e.src})).map((function(e){return n=function(){return h(e.rnumber,e.rversion,e.partition)},{id:(t=e).id,src:t.src||"",alt:t.name,caption:t.name,showCaption:!0,captionAlignment:a.Alignment.Left,showShadow:!0,surcharge:t.surcharge,onClick:n&&function(){return n(t.rnumber,t.rversion,t.partition,t.rid)}};var t,n}))}))).map((function(e){return Object(a.mapRecipeCarouselItem)(e)}));return l.createElement(a.Carousel,{items:r,infinite:!1,responsiveSlideCount:e.responsiveSlideCount||{small:1.5,medium:1.5,large:1.5,extraLarge:1.5},showArrows:!0,itemClassName:"px-2",arrowProps:S})}),[n,e.recipeCollections]);return l.createElement(l.Fragment,null,p&&l.createElement(a.DetailedCardModal,{isOpen:u,toggle:function(){return d(!u)},headerTitle:"Meal Details"},l.createElement(a.DetailedCardContext.Provider,{value:p},l.createElement(a.DetailedCardHeader,{actionBar:void 0}),l.createElement(i.RecipeDetailedCardBody,null))),l.createElement("div",{className:"d-flex mb-4"},e.recipeCollections.map((function(e){var t=n===e.day,o=m()("mx-2 border-primary",t&&"border-bottom"),i=t?"text-primary":"";return l.createElement("div",{style:{cursor:"pointer"},onClick:function(){return r(e.day)},key:"day-"+e.id,className:o,"data-role":"tab","data-test":"RecipeWeekSelector-tab-"+b()(e.day)},l.createElement("span",{className:"MFB"===a.Brand.FS?"fs-text-dark-color-override":i,"data-test":"RecipeWeekSelector-tab-text"},e.day))}))),l.createElement("div",{className:"w-100"},l.createElement(C.a,null,y)))},P=function(e){var t,n=e.title,r=e.description,o=e.productSelectEvent,c=e.selectedProduct,u=e.selectorComponent,d=e.id,p=e.addQueryParamOnContinue,v=e.productType,b=e.tag,h=e.isSoldOut,C=(null===(t=c.recipeCollections&&s()(c.recipeCollections.map((function(e){return e.collections}))))||void 0===t?void 0:t.map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e})))||[],S=v||i.ProductType.Primary,P=function(e,t,n,r,o){var a,c;Object(i.isLinkProps)(n)?a=n.generateLink(e.sku,o):c=function(){var t=Object(f.a)(g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.onClickAsync(e.sku);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();var l=e.sku;return{label:t,url:a,onClickAsync:c,dataCategory:"product",dataLabel:l,dataAction:r,state:{sku:l,orderLink:e.orderLink,amountToPick:e.dinners,recipeSelectionMode:e.recipeSelectionMode}}}(c,S===i.ProductType.Primary?"Order Now":"Add to my Deliveries",o,"add",p),k="product-group-hero-"+d,w=c.deliveryPrice,x=0!==w&&null!==w,E=m()("d-flex","align-items-center",{"justify-content-between":x},"mb-0");return l.createElement("div",{"data-test":k,className:"d-flex w-100 justify-content-center"},l.createElement("div",{className:m()("d-flex flex-wrap flex-md-nowrap flex-row w-100 bg-white","mb-5 py-5 px-2 px-md-4","justify-content-center"),style:{maxWidth:"62em"}},l.createElement("div",{className:m()("d-flex flex-column w-100","col-12 col-md-5")},l.createElement(a.CardTag,Object.assign({},b,{position:{top:"-48px"}})),l.createElement("h3",{className:"display-4 m-0 mb-2"},n),l.createElement("p",null,r),u,l.createElement(i.DiscountConsumer,{product:c,render:function(e,t){var n=e.original!==e.discounted,r=S===i.ProductType.Primary&&t,o=n?{color:"#0d6efd"}:{},a=(parseFloat(e.discounted)+w).toFixed(2);return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("h4",null,l.createElement("p",{className:E,style:{width:"15em"}},x&&l.createElement("span",{className:"text-nowrap"},"Per Week"),l.createElement("span",null,n&&l.createElement("span",null,l.createElement(i.BlueCrossOutText,{className:"mr-2",text:"$"+e.original})),l.createElement("span",{style:o},"$",e.discounted)),!x&&r&&l.createElement("span",{className:"text-nowrap"}," per week"))),r&&t&&l.createElement("h4",null,l.createElement("p",{className:E,style:{width:"15em"}},x&&l.createElement("span",{className:"text-nowrap"},"Per Plate"),l.createElement("span",null,n&&l.createElement("span",null,l.createElement(i.BlueCrossOutText,{className:"mr-2",text:"$"+t.original})),l.createElement("span",{style:o},"$",t.discounted),!x&&r&&l.createElement("span",{className:"text-nowrap"}," per plate")))),x&&l.createElement("div",null,l.createElement("h4",null,l.createElement("p",{className:E,style:{width:"15em"}},l.createElement("span",{className:"text-nowrap"},"Delivery"),l.createElement("span",null,"$",w))),l.createElement("h4",null,l.createElement("br",null),l.createElement("p",{className:E,style:{width:"15em"}},l.createElement("span",{className:"text-nowrap"},"Total Price"),l.createElement("span",null,"$",a))))))}}),l.createElement("div",{className:"col mt-3 px-0"},l.createElement(i.ProductOrderButton,{sku:c.sku,productType:c.productType,className:m()("btn text-white text-nowrap mb-4 px-5","MFB"===a.Brand.BB?"rounded-pill":"rounded-lg"),actionButton:P,isSoldOut:h,isComingSoon:c.isComingSoon}))),l.createElement("div",{className:"w-100 d-flex flex-column col-12 col-md-7"},l.createElement(y,{recipeCollections:C}))))},k=Object(i.WithProductGroupSelector)(P,!0),w=Object(i.WithProductGroupSelector)(P,!1),x=function(e){var t=e.showSelector?k:w;return l.createElement(t,e)},E=n("ZmDi"),M=n("Vjiz"),O=n("MIz4"),T=function(e){var t=e.baseModel,n=e.site,r=e.pageSettings,c=e.allProductDb,u=t,s=Object(i.useStock)()[1],d=l.useState((function(){return u.productGroup.products.map((function(e){return Object(E.getProductModel)(e,c,n.siteMetadata.gatewayUrl)})).filter(a.isNotNullOrUndefined)}))[0],m=o()(d),f=m&&m.availableFrequency;if(l.useEffect((function(){f&&f===i.AvailableFrequency.OneOff&&d.forEach((function(e){return s({type:i.StockActionType.registerOneOff,sku:e.sku})}))}),[f,s,d]),!m)return null;var p=m.productType===i.ProductType.Primary,g={generateLink:function(e,t){var r=d.find((function(t){return t.sku===e})),o=n.siteMetadata.accountUrl+"/manage/subscriptions/extras/addbysku/"+e;return Object(O.getProductSelectEventPath)(o,p,r,t)}},v=Object(M.getProductGroupModel)(u.productGroup,d),b=Object.assign({},v,{id:u.id,addQueryParamOnContinue:u.addQueryParamOnContinue,preselectedPeople:r&&r.preselectedPeople,preselectedDinners:r&&r.preselectedDinners,productType:m.productType,productSelectEvent:g,position:u.position});return l.createElement("div",{className:"w-100",id:u.id},l.createElement(x,Object.assign({},b,{title:u.title,description:u.description})))};t.default=function(e){return l.createElement(c.b,{query:"3593756770",render:function(t){return l.createElement(T,Object.assign({},e,t))}})}},v277:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("AVYR"),i=n("pg3q"),a=n("OQbj"),c=function(e){var t=e.imageSet,n=e.altText,c=e.link,l=e.scrollTarget;return c?r.createElement(o.a,{link:c},r.createElement(a.a,{imageSet:t,alt:n})):l?r.createElement("div",{style:{cursor:"pointer"},onClick:function(){return Object(i.b)(l)}},r.createElement(a.a,{imageSet:t,alt:n})):r.createElement(a.a,{imageSet:t,alt:n})},l=n("E8HI"),u=n("dvv6");t.default=function(e){var t=e.baseModel,n=t.id,o=t.image,i=t.link,a=t.scrollTarget,s={small:Object(l.getImageModel)(o.small),medium:Object(l.getImageModel)(o.medium),large:Object(l.getImageModel)(o.large)};return r.createElement(c,{key:n,imageSet:s,altText:o.alternateText,link:Object(u.getContentfulLink)(i),scrollTarget:a&&a.id})}},vD5k:function(e,t,n){"use strict";n.r(t),n.d(t,"mergeToCartProducts",(function(){return i}));var r=n("p+7n"),o=n("E8HI"),i=function(e,t,n){var i=n.map((function(e){var n=t&&t.find((function(t){return t.sku===e.sku}));if(n)return{cp:e,dbp:n}})).filter(r.isNotNullOrUndefined),a=[];if(e){var c=t&&t.find((function(t){return t.sku===e})),l=n.find((function(t){return t.sku===e}));c&&a.push({id:e,sku:e,title:c.name,image:l&&Object(o.getImageModel)(l.image),price:c.price,locked:!0})}return i.forEach((function(e){var t=e.cp,n=e.dbp;a.push({id:n.sku,sku:n.sku,title:n.name,description:t.description,tags:t.tabText&&[t.tabText]||void 0,image:Object(o.getImageModel)(t.image),price:n.price})})),a};t.default={mergeToCartProducts:i}},vRIT:function(e,t){},wJr2:function(e,t,n){"use strict";n.r(t);var r=n("z0sf"),o=n("Wbzz"),i=n("q1tI"),a=n("ZmDi"),c=n("vOnD").default.div.withConfig({displayName:"ContentfulProduct__StyledContainer",componentId:"sc-xlf8z4-0"})(["margin:0 8px 24px 8px;width:326px;"]);t.default=function(e){var t=e.baseModel;return i.createElement(o.b,{query:"3593756770",render:function(e){var n=Object(a.getProductModel)(t,e.allProductDb,e.site.siteMetadata.gatewayUrl);if(!n)return null;var o=null;switch(n.variant){case"productCard":case"productCardHighlighted":o=i.createElement(c,null,i.createElement(r.ProductCard,Object.assign({},n,{variant:n.variant})));break;default:o=i.createElement(r.ProductCard,Object.assign({},n,{variant:void 0}))}return o}})}},wdn8:function(e,t,n){e.exports={condition:"TermsSubsection-module--condition--3_-UM"}},wsBB:function(e,t){},xKB1:function(e,t){},xoYE:function(e,t){e.exports={getSkuFromQueryParams:jest.fn()}},xzqD:function(e,t,n){"use strict";n.r(t);var r=n("p+7n"),o=n("q1tI"),i=n("AVYR"),a=n("dvv6"),c=n("+9EZ");t.default=function(e){var t=e.baseModel,n=t.name,l=t.link,u=t.responsiveImageSet,s=u&&Object(c.mapResponsiveImageSetContentModelToResponsiveImageProps)(u);return s?o.createElement("div",{"data-category":"merchandising","data-action":"click-single-merch-slot","data-label":n+" - merch-slot",className:"w-100 my-2 mx-lg-2"},o.createElement(i.a,{link:Object(a.getContentfulLink)(l)},o.createElement(r.ResponsiveImage,s))):null}},yO05:function(e,t){},yZTi:function(e,t){},yioD:function(e,t){},zqxM:function(e,t,n){var r=n("LqpT"),o=n("XGnz"),i=n("EA7m"),a=n("3L66"),c=i((function(e,t){return a(e)?r(e,o(t,1,a,!0)):[]}));e.exports=c}}]);
//# sourceMappingURL=5ad21da9adb4882ae7bd5dbfa3e8473b08b5d378-2251e06bb36ee2146f37.js.map