(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{KxBF:function(e,t){e.exports=function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(r);++i<r;)a[i]=e[i+t];return a}},OBan:function(e,t,n){"use strict";n.r(t);var i=n("dI71"),r=n("7tbW"),a=n.n(r),o=n("Xp7I"),c=n.n(o),l=n("k8Y/"),s=n.n(l),u=n("TYy9"),d=n.n(u),p=n("afOK"),m=n.n(p),f=n("z0sf"),h=n("p+7n"),g=n("TSYQ"),b=n.n(g),k=n("Wbzz"),y=n("q1tI"),v=n("HMs9"),w=n("O2s4"),E=n("oI+J"),O=n("Z7gm"),x=n("X68C"),C=n("kvuc"),S=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={isOpen:!1,height:0},n}Object(i.a)(t,e);var n=t.prototype;return n.toggle=function(){this.setState({isOpen:!this.state.isOpen})},n.click=function(e){(0,this.props.onSelect)(e)},n.componentDidMount=function(){var e=this.fetchId(),t=document&&document.getElementById(e),n=t&&t.getBoundingClientRect(),i=n&&2*n.height||0;this.setState({height:i})},n.fetchId=function(){return this.props.options.map((function(e){return e.id})).join()},n.render=function(){var e=this,t=this.props,n=t.options,i=t.placeholder,r=this.state.isOpen,a=this.fetchId();return y.createElement("div",{id:a},y.createElement(E.a,{isOpen:r,toggle:function(){return e.toggle()}},y.createElement(O.a,{caret:!0,className:"w-100 px-3 px-md-4"},i||"Select an option"),y.createElement(x.a,{style:{maxHeight:"calc(100vh - "+this.state.height+"px)",overflow:"auto"}},n.map((function(t){return y.createElement(C.a,{key:t.id,onClick:function(){return e.click(t.id)}},y.createElement("span",{style:{fontSize:"14px"},className:"d-sm-none"},t.label),y.createElement("span",{style:{fontSize:"16px"},className:"d-none d-sm-block d-md-none"},t.label),y.createElement("span",{className:"d-none d-md-block"},t.label))})))))},t}(y.PureComponent),j=n("pg3q"),B=n("ymsD"),I=n("GztK"),M=n("Bu+q"),W=n("uzlL"),N=n("Bjc/"),R=n("WLZk"),z=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={week:void 0,isModalOpen:!1,recipeDetailModel:void 0},n}Object(i.a)(t,e);var n=t.prototype;return n.handleWeekChange=function(e){this.setState({week:e},v.forceCheck)},n.render=function(){var e=this,t=this.props.siteMetadata;return y.createElement(k.b,{query:"870245518",render:function(n){var i=s()(Object(M.a)(n.allProductDb),[function(e){return e.name.toLowerCase()}]),r=[],o=i.filter((function(e){return e.productType===w.a.Primary})),l=!1,u=o.map((function(t){if(t.recipeCollections&&t.recipeCollections.length>0){var n=d()(t.recipeCollections.map((function(e){return e.collections}))),i=Object(R.a)();r=Object(N.a)(n).filter((function(e){return e!==i}));var a=e.state.week||m()(r),o=n.filter((function(e){return e.day===a})).map((function(e){return e.recipes=e.recipes.filter((function(e){return 0===e.surcharge})),e}));return o.length>0?(l=!l,y.createElement("div",{key:t.id+"-"+a,className:b()({"bg-secondary":l})},y.createElement(f.RecipeWeeks,{key:t.id,id:t.id,title:t.name,showWeekSelector:!1,recipeCollections:o,isRecipeModalEnabled:!0}))):y.createElement("div",{key:t.id+"-"+a,className:b()({"bg-secondary":l})},y.createElement(f.RecipeWeeks,{key:t.id,id:t.id,title:t.name,showWeekSelector:!1,isRecipeModalEnabled:!0,recipeCollections:o}))}})),p=c()(a()(r),2).map((function(t,n){var i=t.split(" ")||[];i.shift();var r=i.map((function(e){return e.substring(0,3)})).join(" ");return y.createElement("button",{onClick:function(){return e.handleWeekChange(t)},key:t,className:b()("btn ml-2 px-2 px-md-3 px-lg-4",e.state.week===t||void 0===e.state.week&&0===n?"btn-primary":"btn-secondary")},r)})),g=y.createElement("div",{className:"d-flex justify-content-center"},y.createElement(S,{placeholder:"Bag",options:o.filter((function(e){return e.recipeCollections&&e.recipeCollections.length>0&&e.recipeCollections.some((function(e){return e.collections.length>0}))})).map((function(e){return{id:e.id,label:e.name}})),onSelect:function(e){return Object(j.a)(e,-90)}}),p),k="Our menus are all about quality and freshness, so we use what’s in season and the best ingredients. We’re committed to using locally grown meat, seafood, fruit and veggies, sourced from New Zealand’s finest producers whenever possible.",v={title:"My Food Bag Recipes by Nadia Lim - My Food Bag",description:{description:k},type:"article",canonicalUrlLink:{absoluteUrl:"/recipes"},sharingLinkImage:{id:"",__typename:"",alternateText:"",small:{id:"",file:{url:""}},large:{id:"",file:{url:""}}},allowIndexing:"MFB"===t.brand,keywords:[]};return y.createElement(W.a,{metadata:v,render:function(){return y.createElement(y.Fragment,null,y.createElement(h.Jumbotron,{img:{},id:"jumbo-recipes",title:"Our Delicious Recipes",description:k,splitOnMobile:!1},g,y.createElement(h.StickyHeader,{text:"Select a Bag",actionItem:g})),u)}})}})},t}(y.PureComponent),F=Object(B.WithPathRules)(Object(I.WithSiteMetadata)(z));t.default=F},Xp7I:function(e,t,n){var i=n("KxBF"),r=n("Sxd8");e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:r(t),i(e,0,t<0?0:t)):[]}},"k8Y/":function(e,t,n){var i=n("alwl"),r=n("Z0cm");e.exports=function(e,t,n,a){return null==e?[]:(r(t)||(t=null==t?[]:[t]),r(n=a?void 0:n)||(n=null==n?[]:[n]),i(e,t,n))}}}]);