1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56360],{484071:function(e,a,t){t.d(a,{Y:function(){return l}});var r=t(827378),n=t(907567),o=t(887824),s={email:"Referral_InviteSent_Email",copy_link:"Referral_InviteSent_CopyLink",whatsapp:"Referral_InviteSent_WhatsApp",facebook:"Referral_InviteSent_Facebook",twitter:"Referral_InviteSent_Twitter",sms:"Referral_InviteSent_Sms",messenger:"Referral_InviteSent_Messenger",native_share:"Referral_InviteSent_NativeShare"},i={email:"inviteSentEmail",copy_link:"inviteSentCopyLink",whatsapp:"inviteSentWhatsApp",facebook:"inviteSentFacebook",twitter:"inviteSentTwitter",sms:"inviteSentSms",messenger:"inviteSentMessenger",native_share:"inviteSentNativeShare"},l=function(){var e=(0,o.Z)().push,a=(0,n.W)({},{suspense:!1}).data,t=null==a?void 0:a.uuid;return{trackReferralInviteSent:(0,r.useCallback)(function(a){e(function(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(a){var r;r=t[a],a in e?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r})}return e}({event:"gaEventTrigger",event_name:s[a.channel],gaEventCategory:"anomaly-detection",gaEventAction:i[a.channel],share_method:a.channel},t?{customer_id:t}:{},a.entryPoint?{entry_point:a.entryPoint}:{}))},[e,t])}}},415455:function(e,a,t){t.d(a,{g:function(){return m}});var r=t(358185),n=t.n(r),o=t(199729),s=t.n(o),i=t(340332),l=t(695743),c=t(141323),u=t(907567),h=t(249273),f=t(463171),m=function(){var e,a=(0,l.z)(),t=a.data,r=a.isLoading,o=s()(t,"checkout.shippingAmount",0),m=(0,f.Z)("plans-4848_consumer-core_subscription-endpoint_use-plans-api").isEnabled,g=(0,f.Z)("plans-4854_consumer-core_subscription-endpoint_checkout-success").isEnabled,p=m&&g,S=(0,c.j)({},{suspense:!1,enabled:!p}),d=S.data,v=S.isLoading,y=(0,u.W)({},{suspense:!1,enabled:p}),b=y.data,P=y.isLoading,_=p?b:d,E=p?P:v,C=s()(_,"firstName",""),M=s()(_,"lastName",""),R="".concat(C," ").concat(M),w=String(s()(_,"id","")||""),A=s()(_,"uuid",""),k=(0,h.x)({customerUUID:A},{suspense:!1,retryOnMount:!1}),O=k.data,I=k.error,Z=k.isLoading,N=(null==I?void 0:null===(e=I.response)||void 0===e?void 0:e.status)===404,F=s()(O,"discount_code",""),T=s()(O,"initiative"),L=s()(O,"initiative_group"),K=JSON.parse(s()(O,"discount_campaign_settings","{}")),W=n()(s()(K,"discount_rule.box_rule",[])),U=s()(K,"box_count",0),H=s()(O,"reward_value",""),B=s()(O,"metadata",{}),x=parseFloat((0,i.uf)(W.reduce(function(e,a){var t=a.applicable_to,r=a.discount_value;return"both"===t?e+o+parseFloat(r):e+parseFloat(r)},0),{decimals:0}));return{isLoading:E||Z||r,customerId:w,customerUuid:A,customerCode:F,customerFirstName:C,customerLastName:M,customerFullName:R,boxesWithDiscount:U,creditForCustomer:H,discountForFriend:x,discountForFriendWithShipping:x,is404InCreditConfigAPI:N,initiative:T,initiativeGroup:L,metadata:B}}},956360:function(e,a,t){t.d(a,{V:function(){return G}});var r,n,o=t(827378),s=t(268481),i=t(964944),l=t(415455),c=t(484071),u=t(468891),h=t(602307),f=t(887824),m=t(527157);function g(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(a){var r;r=t[a],a in e?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r})}return e}var p=function(){var e,a,t=(0,f.Z)().push,r=(0,u.parse)((null===(a=window)||void 0===a?void 0:null===(e=a.location)||void 0===e?void 0:e.search)||""),n=r.origin||"other",s=r.type||"none",i=(0,m.Z)(),l=(0,h.z)();return{trackRAFEvents:(0,o.useCallback)(function(e){var a=e.gaEventCategory,r=void 0===a?"RAF":a,o=e.event_name,c=e.gaEventAction,u=e.gaEventLabel,h=void 0===u?"":u,f=e.hasInteraction,m=void 0===f||f,p=e.referral_program,S=e.visible_share_options,d=e.customize_message,v=e.voucher,y=e.validation,b=e.share_method,P=e.shared_url,_=e.is_native,E=e.manual_reward,C=e.remaining_credit,M=e.freebie_id,R=e.gaEventNonInteraction,w=e.screen,A=e.entry_point;return function(){var e=g({gaEventCategory:r,gaEventAction:c,gaEventLabel:h,gaEventNonInteraction:!m,origin:n,type:s,brand:i},o?{event_name:o}:{},p?{referral_program:p}:{},S?{visible_share_options:S}:{},d?{customize_message:d}:{},v?{voucher:v}:{},y?{validation:y}:{},b?{share_method:b}:{},P?{shared_url:P}:{},_?{is_native:_}:{},E?{manual_reward:E}:{},C?{remaining_credit:C}:{},M?{freebie_id:M}:{},R?{gaEventNonInteraction:R}:{},A?{entry_point:A}:{});t(g({event:"gaEventTrigger",tribe:(null==l?void 0:l.tribe)||"Virality",screen:null!=w?w:"RAF"},e))}},[i,null==l?void 0:l.tribe,n,t,s])}},S=t(238459);function d(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var v=(d(r={},S.a.COPY_LINK,{shareMethod:"copy_link",trackingMethod:"copyToClipboard"}),d(r,S.a.WHATSAPP,{shareMethod:"whatsapp",trackingMethod:"shareWhatsApp"}),d(r,S.a.FACEBOOK,{shareMethod:"facebook",trackingMethod:"shareFacebook"}),d(r,S.a.TWITTER,{shareMethod:"twitter",trackingMethod:"shareTwitter"}),d(r,S.a.MESSENGER,{shareMethod:"facebook_messenger",trackingMethod:"shareFBMessenger"}),d(r,S.a.SMS,{shareMethod:"sms",trackingMethod:"shareSms"}),d(r,S.a.NATIVE_SHARE,{shareMethod:"native",trackingMethod:"nativeShare"}),r),y=(d(n={},S.a.COPY_LINK,"copy_link"),d(n,S.a.WHATSAPP,"whatsapp"),d(n,S.a.FACEBOOK,"facebook"),d(n,S.a.TWITTER,"twitter"),d(n,S.a.MESSENGER,"messenger"),d(n,S.a.SMS,"sms"),d(n,S.a.NATIVE_SHARE,"native_share"),n),b=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),P=function(e){var a=encodeURIComponent(e);return"sms:?body=".concat(a)},_=t(497249),E=t(344884),C=t(340332),M=t(396887),R=t(463171),w=t(765855),A=t(151881),k=function(e){var a=(0,u.stringify)({text:e});
1return"".concat("https://api.whatsapp.com/send","?").concat(a)},O=function(e,a){var t=(0,u.stringify)({app_id:a,display:"popup",link:e});return"".concat("https://www.facebook.com/dialog/feed","?").concat(t)},I=function(e,a){var t=(0,u.stringify)({text:e,url:a});return"".concat("https://twitter.com/intent/tweet","?").concat(t)},Z=function(e,a){if(b){var t=(0,u.stringify)({link:e,app_id:a});return"".concat("fb-messenger://share","?").concat(t)}var r=(0,u.stringify)({link:e,app_id:a,display:"popup",redirect_uri:"https://www.facebook.com/"});return"".concat("https://www.facebook.com/dialog/send","?").concat(r)},N=t(66077),F=t(76898),T=t(543790),L=t(839444),K=[S.a.COPY_LINK,S.a.MESSENGER,S.a.FACEBOOK],W=[S.a.SMS,S.a.COPY_LINK,S.a.NATIVE_SHARE],U=[S.a.COPY_LINK,S.a.MESSENGER,S.a.WHATSAPP,S.a.FACEBOOK],H=[S.a.WHATSAPP,S.a.SMS,S.a.NATIVE_SHARE],B=[S.a.SMS,S.a.COPY_LINK,S.a.MESSENGER,S.a.NATIVE_SHARE],x={socialSharingPlatforms:[S.a.COPY_LINK,S.a.WHATSAPP,S.a.MESSENGER,S.a.FACEBOOK],overrides:[{systemCountry:F.Rc[T.Z.hellofresh].US,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:W}},{systemCountry:F.Rc[T.Z.hellofresh].DE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].AT,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].AU,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].BE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].CA,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].CH,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].DK,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].ES,values:{socialSharingPlatforms:U}},{systemCountry:F.Rc[T.Z.hellofresh].FR,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].IE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].IT,values:{socialSharingPlatforms:U}},{systemCountry:F.Rc[T.Z.hellofresh].LU,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].NL,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.hellofresh].NO,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].NZ,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].SE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.hellofresh].GB,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.everyplate].AU,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.everyplate].US,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:W}},{systemCountry:F.Rc[T.Z.youfoodz].AU,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.greenchef].GB,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.greenchef].US,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:W}},{systemCountry:F.Rc[T.Z.factor].US,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:W}},{systemCountry:F.Rc[T.Z.factor].DE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.factor].DK,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.factor].BE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.factor].NL,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:H}},{systemCountry:F.Rc[T.Z.factor].SE,values:{socialSharingPlatforms:U,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.chefsplate].CA,locale:L.Z.frCA,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.chefsplate].CA,locale:L.Z.enCA,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.factor].CA,locale:L.Z.enCA,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.factor].CA,locale:L.Z.frCA,values:{socialSharingPlatforms:K,socialSharingPlatformsMobile:B}},{systemCountry:F.Rc[T.Z.petstable].US,values:{socialSharingPlatforms:[S.a.MESSENGER,S.a.FACEBOOK,S.a.COPY_LINK]}},{systemCountry:F.Rc[T.Z.goodchop].US,values:{socialSharingPlatforms:[S.a.COPY_LINK]}}]},j=(0,N.Z)("referral.social-share-platforms",x).useConfig;function D(e,a,t,r,n,o,s){try{var i=e[o](s),l=i.value}catch(e){t(e);return}i.done?a(l):Promise.resolve(l).then(r,n)}var G=function(e){var a,t,r=e.messageKeys,n=e.buildMessage,u=e.tracking,h=e.reportMissionEvent,f=(0,A.b)().translateReferralPromotion,m=(0,s.Sj)(),g=j(),d=(0,o.useMemo)(function(){return"mobile"===m&&g.socialSharingPlatformsMobile?g.socialSharingPlatformsMobile:g.socialSharingPlatforms},[m,g]),b=(0,o.useMemo)(function(){return d.map(function(e){switch(e){case S.a.SMS:return r.sms?{platform:e,messageKey:r.sms}:{platform:e};case S.a.NATIVE_SHARE:return r.nativeShare?{platform:e,messageKey:r.nativeShare}:{platform:e};case S.a.WHATSAPP:return r.whatsapp?{platform:e,messageKey:r.whatsapp}:{platform:e};case S.a.TWITTER:return r.twitter?{platform:e,messageKey:r.twitter}:{platform:e};default:return{platform:e}}})},[d,r]),N=(0,o.useMemo)(function(){return b.map(function(e){return v[e.platform].shareMethod})},[b]),F=(0,R.Z)("raf_use_statsig_config").isEnabled,T=(0,i.O)({shareMethod:N}),L=T.link,K=T.discountCode,W=T.isLinkReady,U=T.isErrorInFetchingLink,H=T.triggerLinkFetchErrorNotification,B=(0,l.g)(),x=B.customerCode,G=B.customerUuid,Y=B.boxesWithDiscount,V=B.discountForFriend,z=B.discountForFriendWithShipping,J=(0,w.p)({customerUUID:G},{suspense:!1,enabled:F&&!!G}).data,X=parseFloat(null!==(a=null==J?void 0:J.discount_value)&&void 0!==a?a:"0"),q=F&&null!==(t=null==J?void 0:J.discount_voucher)&&void 0!==t?t:x,Q=F?X:V,$=F?X:z,ee=F?"":Y,ea=p().trackRAFEvents,et=(0,c.Y)().trackReferralInviteSent,er=(0,_.T)(),en=(0,C.nB)(),eo=(0,M.ew)().NEXT_PUBLIC_FACEBOOK_APP_ID;return(0,o.useMemo)(function(){return b.map(function(e){var a,t,r=v[e.platform],o="string"==typeof L?L:L[r.shareMethod],s=(a=function(){var a,t,s,i,l,c,m,g,p,d,v;return function(e,a){var t,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
1function i(o){return function(i){return function(o){if(t)throw TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=a.call(e,s)}catch(e){o=[6,e],r=0}finally{t=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,i])}}}(this,function(b){switch(b.label){case 0:if(U)return H(),[2];if(!W||!o)return[2];if(a={gaEventCategory:"RAF",gaEventAction:"shareCode",gaEventLabel:"".concat(r.trackingMethod,"|code:").concat(K,"|url:").concat(o),share_method:r.trackingMethod,shared_url:o,event_name:u.eventName,screen:u.screen,entry_point:u.entry_point},e.platform!==S.a.NATIVE_SHARE)return[3,6];if(!navigator.share)return[2];t=en(100*Q,{decimals:0}),s=en(100*$,{decimals:0}),i=n?n(o,e.platform):e.messageKey?f(e.messageKey,{params:{code:q,discountForFriend:t,discountForFriendWithShipping:s,boxesWithDiscount:ee,shareLink:o},showLoader:!1}):"",l=er.startSpan("referrals.native-share",{attributes:{"referrals.share-method":"nativeShare"}}),b.label=1;case 1:return b.trys.push([1,3,4,5]),[4,navigator.share({text:i,url:o})];case 2:return b.sent(),ea(a)(),et({channel:y[e.platform],entryPoint:u.entry_point}),null==h||h(),l.setStatus({code:E.Z.OK}),[3,5];case 3:var _;return c=b.sent(),l.recordException((null!=(_=Error)&&"undefined"!=typeof Symbol&&_[Symbol.hasInstance]?!!_[Symbol.hasInstance](c):c instanceof _)?c:Error(String(c))),l.setStatus({code:E.Z.ERROR}),[3,5];case 4:return l.end(),[7];case 5:return[2];case 6:switch(m=n?n(o,e.platform):e.messageKey?f(e.messageKey,{params:{code:q,discountForFriend:Q,discountForFriendWithShipping:$,boxesWithDiscount:ee,shareLink:o},showLoader:!1}):"",ea(a)(),et({channel:y[e.platform],entryPoint:u.entry_point}),null==h||h(),e.platform){case S.a.WHATSAPP:g=k(m),window.open(g,"_blank");break;case S.a.FACEBOOK:p=O(o,eo),window.open(p,"_blank","height=600,width=750");break;case S.a.TWITTER:d=I(m,o),window.open(d,"_blank","height=600,width=750");break;case S.a.SMS:window.location.href=P(m);break;case S.a.MESSENGER:v=Z(o,eo),window.open(v,"_blank");case S.a.COPY_LINK:}return[2]}})},t=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=a.apply(e,t);function s(e){D(o,r,n,s,i,"next",e)}function i(e){D(o,r,n,s,i,"throw",e)}s(void 0)})},function(){return t.apply(this,arguments)});return{platform:e.platform,onClick:s,link:o}})},[b,L,W,U,H,f,q,ee,Q,$,n,ea,et,u,K,h,er,en,eo])}},238459:function(e,a,t){var r,n;t.d(a,{a:function(){return r}}),(n=r||(r={})).COPY_LINK="copyLink",n.WHATSAPP="whatsapp",n.MESSENGER="messenger",n.FACEBOOK="facebook",n.TWITTER="twitter",n.NATIVE_SHARE="nativeShare",n.SMS="sms"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.