1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69344,168],{197593:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/login",function(){return n(891777)}])},206175:function(e,t,n){"use strict";n.d(t,{X4:function(){return i},fs:function(){return o}});var r=function(e){var t=e.data;return(null==t?void 0:t.high_risk_account)===!0},o=function(e){var t;return(null===(t=e.response)||void 0===t?void 0:t.status)===403&&r({data:e.response.data})},i=function(e){var t;return 403===Number(null==e?void 0:null===(t=e.errorMessage)||void 0===t?void 0:t.status)&&r({data:a(e)})},a=function(e){var t,n,r={};try{r=JSON.parse(null!==(n=null==e?void 0:null===(t=e.errorMessage)||void 0===t?void 0:t.response)&&void 0!==n?n:"{}")}catch(e){r={}}return r}},903558:function(e,t,n){"use strict";n.d(t,{p:function(){return p}});var r,o,i=n(456552),a=n(671718),l=n(447178),u=n(140224),c=n(699219);function s(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var f=(r=function(e,t){var n,r,o,i,l,u,c,s,f,p,g=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(b){switch(b.label){case 0:return n=g.length>2&&void 0!==g[2]?g[2]:a.Z,r=e.country,o=e.locale,i=e.email,l=e.channel,u=e.send,c=e.redirect_url,s=e.public_id,f=e.xbrands_target_country,[4,n("/v1/passwordless/start",t,{method:"post",query:{country:r,locale:o},data:d({email:i,channel:l,send:u,redirect_url:c,public_id:s},(p=e.customer_id)?{customer_id:p}:{},f?{xbrands_target_country:f}:{}),parentSpan:e.parentSpan,fetchSpanAttributes:{"request.backend_service":"customer-identity-proxy-service","request.backend_action":"passwordless-login-start"}})];case 1:return[2,b.sent()]}})},o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){s(i,n,o,a,l,"next",e)}function l(e){s(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.useQueryClient)(),n=(0,u.O)(),r=(0,l.Z)().fetch,o=[c.Z["auth.passwordlessLoginStart"]];return(0,i.useMutation)(function(e){return f(d({},e,n),o,r)},d({onSuccess:function(){t.clear()},onError:function(){t.clear()}},e))}},206082:function(e,t,n){"use strict";n.d(t,{m:function(){return g}});var r,o,i=n(456552),a=n(671718),l=n(447178),u=n(808215),c=n(699219),s=n(140224);function d(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var p=(r=function(e,t){var n,r,o,i,l=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(u){switch(u.label){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:a.Z,r=e.business_division,o=e.email,i=e.password,[4,n("/v1/register",t,{method:"post",data:{business_division:r,email:o,password:i,first_name:e.first_name||"",last_name:e.last_name||"",tracking_metadata:e.tracking_metadata},parentSpan:e.parentSpan,fetchSpanAttributes:{"request.backend_service":"customer-management-service","request.backend_action":"register"}})];case 1:return[2,u.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){d(i,n,o,a,l,"next",e)}function l(e){d(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.useQueryClient)(),n=(0,s.O)(),r=(0,u.Z)(),o=(0,l.Z)().fetch,a=[c.Z["auth.register"]];return(0,i.useMutation)(function(e){var t,i;return p((t=f({},e,n),i=i={business_division:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}),t),a,o)},f({onSuccess:function(){t.clear()},onError:function(){t.clear()}},e))}},520578:function(e,t,n){"use strict";n.d(t,{n:function(){return r}});var r=function(e){var t;return!e||e.planCreationAllowed?"none":null!==(t=e.redirect)&&void 0!==t?t:"none"}},953142:function(e,t,n){"use strict";n.d(t,{y:function(){return a}});var r=n(463171),o=n(681335),i=n(520578),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.enabled,n=(0,r.Z)("plans-4848_consumer-core_subscription-endpoint_use-plans-api"),a=n.isEnabled,l=n.isReady,u=a&&(void 0===t||t),c=(0,o.kH)({},{suspense:!1,enabled:u}),s=c.data,d=c.isSuccess,f=c.isError,p=c.isFetched;return{isFeatureFlagReady:l,isCheckoutStatusEnabled:a,shouldUseCheckoutStatusEndpoint:u,checkoutRedirect:f?"home":(0,i.n)(s),isCheckoutStatusSuccess:d,isCheckoutStatusError:f,isCheckoutStatusFetched:p,data:s}}},571321:function(e,t,n){"use strict";n.d(t,{qZ:function(){return m},vV:function(){return y}});var r,o,i=n(456552),a=n(671718),l=n(447178),u=n(64294),c=n(43011),s=n(140224),d=n(699219);function f(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var b=(r=function(e,t){var n,r,o,i,l,c,s,d,f,b,y=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(m){switch(m.label){case 0:return r=void 0===(n=e.usePublicAuth)||n,o=e.limit,i=e.cursor,l=e.systemCountry,c=e.locale,s=e.parentSpan,[4,(y.length>2&&void 0!==y[2]?y[2]:a.Z)("/cookbook/v1/external-recipes",t,{query:p({country:l,locale:c,hf_public_id:(0,u.ZP)()},void 0!==o&&{limit:o},void 0!==i&&{cursor:i}),parentSpan:s,fetchSpanAttributes:{"request.backend_service":"cookbook-api","request.backend_action":"get-external-recipes"}},{usePublicAuth:r})];case 1:return f=(d=m.sent()).headers.get("X-Free-Recipe-Save-Count"),b=d.headers.get("X-Free-Recipe-Save-Limit"),[4,d.json()];case 2:return[2,g(p({},m.sent()),{freeRecipeSaveCount:f?parseInt(f,10):null,freeRecipeSaveLimit:b?parseInt(b,10):null})]}})},o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){f(i,n,o,a,l,"next",e)}function l(e){f(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,l.Z)().fetch,r=(0,c.Z)(),o=p(g(p({},e),{usePublicAuth:!r}),(0,s.O)()),a=[d.Z["externalRecipes.list"],o];return(0,i.useQuery)(a,function(){return b(o,a,n)},p({staleTime:3e5,cacheTime:6e5},t))},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,l.Z)().fetch,r=(0,c.Z)(),o=p(g(p({},e),{usePublicAuth:!r}),(0,s.O)()),a=[d.Z["externalRecipes.list"],o];return(0,i.useInfiniteQuery)(a,function(e){var t;return b(p({},o,null!==(t=e.pageParam)&&void 0!==t?t:{}),a,n)},p({getNextPageParam:function(e){return e.pagination.has_more?{cursor:e.pagination.next_cursor}:void 0},staleTime:3e5,cacheTime:6e5},t))}},190174:function(e,t,n){"use strict";n.d(t,{x:function(){return p}});var r,o,i=n(456552),a=n(671718),l=n(447178),u=n(699219),c=n(140224);function s(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var f=(r=function(e,t){var n,r=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){switch(o.label){case 0:return[4,(r.length>2&&void 0!==r[2]?r[2]:a.Z)("/api/plans",t,{method:"GET",query:{includeCanceled:null!==(n=null==e?void 0:e.includeCanceled)&&void 0!==n&&n},parentSpan:null==e?void 0:e.parentSpan,headers:{"Content-Type":"application/json"}})];case 1:return[2,o.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){s(i,n,o,a,l,"next",e)}function l(e){s(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,l.Z)().fetch,r=(0,c.O)(),o=[u.Z["customer-plans.get"],e];return(0,i.useQuery)(o,function(){return f(d({},e,r),o,n)},d({suspense:!1},t))}},747012:function(e,t,n){"use strict";n.d(t,{Sj:function(){return g},h5:function(){return p},rm:function(){return b}});var r,o,i=n(671718),a=n(670153),l=n(447178),u=n(456552),c=n(699219),s=n(140224);function d(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var p=(r=function(e,t){var n,r,o,a,l,u,c,s,d,p,g,b,y,m,v,h,w=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(O){switch(O.label){case 0:n=w.length>2&&void 0!==w[2]?w[2]:i.Z,r=e.postcode,a=void 0===(o=e.numDeliveries)?4:o,l=e.locale,u=e.systemCountry,c=e.parentSpan,s=e.initialOrder,d=e.customerPriority,p=e.cutoffTimeThreshold,g=e.customerJourney,b=e.customerUUID,y=e,m=e,y.family&&(v=y.family),m.product&&(h=m.product),O.label=1;case 1:return O.trys.push([1,3,,4]),[4,n("/api/delivery_dates_options",t,{query:f({zip:r,numDeliveries:a,locale:l,country:u},v?{family:v}:{},h?{product:h}:{},s?{initialOrder:s}:{},d?{customerPriority:d}:{},p?{cutoffTimeThreshold:p}:{},g?{customerJourney:g}:{}),parentSpan:c,headers:f({},b?{"X-Customer-UUID":b}:{}),fetchSpanAttributes:{"request.backend_service":"delivery-options-service","request.backend_action":"get-delivery-options-by-postcode"}})];case 2:return[2,O.sent().json()];case 3:throw O.sent();case 4:return[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){d(i,n,o,a,l,"next",e)}function l(e){d(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),g=function(e,t){var n=f({},e,(0,s.O)()),r=[c.Z["delivery-options.byPostcode"],n];return(0,a.Z)(r,function(e){return p(n,r,e)},t)},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,l.Z)().fetch,n=(0,s.O)();return(0,u.useQueries)(null==e?void 0:e.map(function(e,r){var o,i,a=(o=f({},e,n),i=i={key:r}
1,Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o),l=[c.Z["delivery-options.byPostcode.multiple"],a];return{queryKey:l,queryFn:function(){return p(a,l,t)},enabled:!!e.postcode}}))}},42208:function(e,t,n){"use strict";n.d(t,{kL:function(){return c},wM:function(){return l},wk:function(){return u}});var r=n(892940),o=r.z.object({id:r.z.string(),name:r.z.string(),handle:r.z.string(),legacy_handles:r.z.array(r.z.string()),legacy_ids:r.z.array(r.z.string()),country:r.z.string(),specs:r.z.object({meals:r.z.union([r.z.number(),r.z.string()]),size:r.z.union([r.z.number(),r.z.string()]),recurrency:r.z.number().int()}).passthrough(),meal_swap:r.z.boolean(),meal_swap_default_choice:r.z.string(),swappable_meals:r.z.string(),public:r.z.boolean(),active:r.z.boolean(),is_subscribable:r.z.boolean(),is_available_for_extra_meals:r.z.boolean(),is_preset_enabled:r.z.boolean(),sort:r.z.number().int(),family:r.z.string(),created_at:r.z.string(),updated_at:r.z.string()}).passthrough(),i=r.z.object({total:r.z.number().int(),take:r.z.number().int(),skip:r.z.number().int(),count:r.z.number().int(),items:r.z.array(o)}).passthrough(),a=r.z.object({id:r.z.string(),country:r.z.string(),handle:r.z.string(),name:r.z.string(),headline:r.z.string(),contents:r.z.object({benefits:r.z.string(),price:r.z.string(),price_unit:r.z.string(),price_label:r.z.string(),price_sidenote:r.z.string(),small_print:r.z.string(),image:r.z.string(),fb_url:r.z.string(),description:r.z.string()}).passthrough(),template:r.z.object({meals:r.z.array(r.z.any()),size:r.z.array(r.z.any()),recurrency:r.z.array(r.z.any())}).passthrough(),tags:r.z.array(r.z.string()),prefix:r.z.string(),promotes:r.z.array(r.z.any()),icons:r.z.object({"1x":r.z.string(),"2x":r.z.string(),"3x":r.z.string()}).passthrough(),active:r.z.boolean(),compatible:r.z.array(r.z.string()),converts:r.z.string(),auto_convert:r.z.string(),recipe_family:r.z.string(),show_mobile:r.z.boolean(),sort:r.z.number().int(),created_at:r.z.string(),updated_at:r.z.string()}).passthrough(),l=r.z.object({total:r.z.number().int(),take:r.z.number().int(),skip:r.z.number().int(),count:r.z.number().int(),items:r.z.array(a)}).passthrough(),u=i,c=o},666296:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});var r=n(827378),o=n(60074),i=n(690763),a=n(52130),l=function(){var e=(0,a.L3)().trackJanusEvent;return{trackRequestLoginLinkClick:(0,r.useCallback)(function(){try{e(i.S.janusEvent({uiComponent:i.S.uiComponent({uiComponentName:"get_link_button",uiComponentLabel:"Get Link"})}))}catch(e){(0,o.Tb)(e,{tags:{event:"LoginPasswordless_Request_Login_Link_Click",component:"useLoginPasswordlessRequestLinkSnowplowEvent"}})}},[e])}}},688946:function(e,t,n){"use strict";n.d(t,{q:function(){return c}});var r=n(495500);function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var i=function(e){return(null==e?void 0:e.trim())||null},a=function(e){try{var t=JSON.parse(e);if(!t||(void 0===t?"undefined":o(t))!=="object")return null;if("string"==typeof t.error_description)return t.error_description;if("string"==typeof t.message&&t.message.length>0)return t.message;if("string"==typeof t.error)return t.error}catch(e){}return null},l="| Response:",u=function(e){if("string"!=typeof e||0===e.length)return null;var t,n=e.indexOf(l);if(-1===n)return null;var r=e.slice(n+l.length),o=r.lastIndexOf("| Status:"),i=(-1===o?r:r.slice(0,o)).trim();return 0===i.length?null:null!==(t=a(i))&&void 0!==t?t:i},c=function(e){if(null==e)return null;if("string"==typeof e)return null!==(s=u(e))&&void 0!==s?s:e;if(null!=(n=r.Z)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n){var t,n,l,c,s,d,f,p,g=null!==(f=e.responseResult)&&void 0!==f?f:e.errorMessage.response;return g?null!==(p=a(g))&&void 0!==p?p:i(g):i(null===(d=e.originalError)||void 0===d?void 0:d.message)}var b="string"==typeof(t=null===(c=e.response)||void 0===c?void 0:c.data)?a(t):t&&(void 0===t?"undefined":o(t))==="object"?a(JSON.stringify(t)):null;if(b)return b;var y=e.message;return"string"!=typeof y||0===y.length?null:null!==(l=u(y))&&void 0!==l?l:y}},144158:function(e,t,n){"use strict";n.d(t,{v:function(){return l}});var r=n(827378),o=n(60074),i=n(228642),a=n(52130),l=function(){var e=(0,a.L3)().trackJanusEvent;
1return{trackForgotPasswordClick:(0,r.useCallback)(function(){try{e(i.y.janusEvent({uiComponent:i.y.uiComponent({uiComponentName:"forgot_password_send_button",uiComponentLabel:"Send"})}))}catch(e){(0,o.Tb)(e,{tags:{event:"ForgotPassword_Recover_Password_Button_Click",component:"useForgotPasswordRecoverSnowplowEvent"}})}},[e])}}},380565:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var r=n(827378),o=n(60074),i=n(868216),a=n(230379),l=n(52130);function u(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}var c=function(){var e=(0,l.L3)().trackJanusEvent;return{trackForgotPasswordVerification:(0,r.useCallback)(function(t){var n,r;(n=function(){var n,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,(0,a.k)(t.email.toLowerCase().trim())];case 1:return n=l.sent(),e(i.Hh.janusEvent({event:i.Hh.event({systemMessage:null}),contact:i.Hh.contact({contactType:i.uC.Email,hashedDetails:n})})),[3,3];case 2:return r=l.sent(),(0,o.Tb)(r,{tags:{event:"ForgotPassword_Verification_SystemAction",component:"useForgotPasswordVerificationSnowplowEvent"}}),[3,3];case 3:return[2]}})},r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){u(i,r,o,a,l,"next",e)}function l(e){u(i,r,o,a,l,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})()},[e])}}},958352:function(e,t,n){"use strict";n.d(t,{s:function(){return l}});var r=n(827378),o=n(60074),i=n(499834),a=n(52130),l=function(){var e=(0,a.L3)().trackJanusEvent;return{trackRecoverPasswordClick:(0,r.useCallback)(function(){try{e(i.W.janusEvent({uiComponent:i.W.uiComponent({uiComponentName:"forgot_password_link",uiComponentLabel:"Forgot Password"})}))}catch(e){(0,o.Tb)(e,{tags:{event:"Login_Recover_Password_Link_Click",component:"useLoginRecoverPasswordSnowplowEvent"}})}},[e])}}},835678:function(e,t,n){"use strict";n.d(t,{t:function(){return u}});var r=n(827378),o=n(60074),i=n(863601),a=n(52130),l=n(688946),u=function(){var e=(0,a.L3)().trackJanusEvent;return{trackRegistrationSignupError:(0,r.useCallback)(function(t){try{var n;e(i.U.janusEvent({event:i.U.event({systemMessage:null!==(n=(0,l.q)(t))&&void 0!==n?n:"Unknown error"})}))}catch(e){(0,o.Tb)(e,{tags:{event:"Registration_SignupError_SystemAction",component:"useRegistrationSignupErrorSnowplowEvent"}})}},[e])}}},650603:function(e,t,n){"use strict";n.d(t,{Cp:function(){return x}});var r=n(687800);n(827378);var o=n(165218),i=n.n(o),a=n(768587),l=n(313954),u=n(43011),c=n(602307),s=n(169821),d=n(184883),f=n(493757),p=n(506685),g=n(430959),b=n(132021),y=n(763724),m=n(377380),v=n(589902),h=n(694414),w=n(389073),O=n(52566),S=n(481248);function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function _(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=i()(function(){return Promise.all([n.e(40412),n.e(46045),n.e(35919)]).then(n.bind(n,635919)).then(function(e){return e.LeadBarFeature})},{loadableGenerated:{webpack:()=>[635919]}}),E=i()(function(){return Promise.all([n.e(40412),n.e(15863),n.e(50883)]).then(n.bind(n,875536)).then(function(e){return e.FooterFeature})},{loadableGenerated:{webpack:()=>[875536]}}),j="56px",C=function(e){var t,n=e.enableSSRCustomerHeader,o=e.nonStickyDesktopHeader,i=e.disableHeader,b=e.disableFooter,y=e.disableMinHeight,k=e.headerFullWidth,_=e.ssrPayload,C=e.children,x=(0,u.Z)();return(0,r.tZ)(c.Z,{claim:{name:"activations-rte",githubTeam:"hellofresh/activations-rte",tribe:"conversions",alliance:"growth",jiraPrefix:"USCRO",slackChannel:"#squad-curation",slackAlertsChannel:"#squad-curation",skipLabelsOnPR:!1,teamIdentifier:"activations-rte"},children:(0,r.tZ)(d.Z,{scope:"universal-layout",children:(0,r.tZ)(l.Z,{componentName:"universal-layout",children:(0,r.tZ)(g.Z,{filtrationIdentifier:null!==(t=null==_?void 0:_.filtrationIdentifier)&&void 0!==t?t:"",children:(0,r.BX)(a.xu,{position:"relative","data-test-id":"universal-layout",backgroundColor:"alias.page-background.alternative",children:[(0,r.tZ)(d.Z,{scope:"layouts-universal-top-banner",children:(0,r.tZ)(l.Z,{componentName:"layouts-universal-top-banner",children:(0,r.tZ)(f.Z,{children:(0,r.tZ)(s.Z,{suspense:!0,children:(0,r.tZ)(p.Z,{})})})})}),!(void 0!==i&&i)&&(0,r.tZ)(d.Z,{scope:"layouts-universal-header",children:(0,r.BX)(l.Z,{componentName:"layouts-universal-header",children:[(0,r.tZ)(S.Z,{}),(0,r.tZ)(O.D9,{fullWidth:void 0!==k&&k,children:(0,r.tZ)(a.xu,{position:["sticky",void 0!==o&&o?"relative":"sticky"],top:"0",zIndex:"115",minHeight:j,"data-test-id":"universal-layout-header-container",children:(0,r.tZ)(m.ZP,{queryKey:_.contentfulHeaderEntriesKey,children:void 0!==n&&n||x?(0,r.tZ)(w.default,{}):(0,r.tZ)(h.Z,{})})})})]})}),(0,r.tZ)(l.Z,{componentName:"layouts-universal-page",children:(0,r.tZ)(a.xu,{flex:"1",minHeight:void 0!==y&&y?"unset":"100vh",children:C})}),!(void 0!==b&&b)&&(0,r.tZ)(d.Z,{scope:"layouts-universal-footer",children:(0,r.BX)(l.Z,{componentName:"layouts-universal-footer",children:[(0,r.tZ)(P,{}),(0,r.tZ)(v.ZP,{queryKey:_.contentfulFooterEntriesKey,children:(0,r.tZ)(E,{})})]})})]})})})})})},x=function(e){var t=e.navigationComponent,n=e.children,o=e.disableHeader,i=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["navigationComponent","children","disableHeader"]);return(0,r.tZ)(c.Z,{claim:{name:"activations-rte",githubTeam:"hellofresh/activations-rte",tribe:"conversions",alliance:"growth",jiraPrefix:"USCRO",slackChannel:"#squad-curation",slackAlertsChannel:"#squad-curation",skipLabelsOnPR:!1,teamIdentifier:"activations-rte"},children:(0,r.tZ)(d.Z,{scope:"side-navigation-universal-layout",children:(0,r.tZ)(l.Z,{componentName:"layouts-universal-side-navigation",children:(0,r.BX)(C,_(k({},i),{disableHeader:o,children:[(0,r.tZ)(a.xu,_(k({position:"sticky",zIndex:2},!o&&{top:j}),{children:(0,r.tZ)(d.Z,{scope:"layouts-universal-notifications",children:(0,r.tZ)(l.Z,{componentName:"layouts-universal-notifications",children:(0,r.tZ)(b.Z,{children:(0,r.tZ)(y.Z,{})})})})})),(0,r.BX)(a.xu,{minHeight:"100vh",display:[null,"flex"],maxWidth:["100%","960px","1144px"],px:["xs","md-1","zero"],mx:"auto",pt:["sm-1","md-2"],children:[(0,r.tZ)(a.xu,{as:"aside",width:[1,1/4],mr:["zero","md-1","md-2"],children:t}),(0,r.tZ)(a.xu,{width:[1,3/4],children:n})]})]}))})})})};t.ZP=C},377380:function(e,t,n){"use strict";n.d(t,{yY:function(){return c}});var r=n(687800),o=n(827378),i=n(456552),a=n(497249),l=n(344884),u=(0,o.createContext)({segment:[],label:[]}),c=function(){return(0,o.useContext)(u)};t.ZP=function(e){var t=e.queryKey,n=e.children,c=(0,i.useQueryClient)(),s=(0,a.T)(),d=(0,o.useMemo)(function(){var e,n,r=c.getQueryData(t);return{segment:null!==(e=null==r?void 0:r.segment)&&void 0!==e?e:[],label:null!==(n=null==r?void 0:r.label)&&void 0!==n?n:[]}},[c,t]);return(0,o.useEffect)(function(){if(!d.segment.length||!d.label.length){var e=s.startSpan("contentful-header-prov
1ider.missing-data");e.setAttributes({segmentCount:d.segment.length,labelCount:d.label.length}),e.setStatus({code:l.Z.ERROR}).end()}},[d,s]),(0,r.tZ)(u.Provider,{value:d,children:n})}},497305:function(e,t,n){"use strict";var r=n(468891),o=n(64294),i=n(827378),a=n(200770),l=n(233477),u=n(966622),c=n(913940);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}t.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.runUsingStatsig,n=void 0!==t&&t,d=(0,u.py)({runUsingStatsig:n}).track,f=(0,a.Z)(),p=(0,l.F)();return(0,i.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"successful_login",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=(0,r.parse)(window.location.search),u=(null==l?void 0:l.isBot)==="1",g=(0,o.ZP)(),b="";if(b=n?e:(0,c.wL)(e)?e:"".concat(f,"-").concat(e),n)d({eventName:i,experimentationUserId:b,eventTags:a});else if(t)d({eventName:i,experimentationUserId:g,experimentationUserAttributes:p,eventTags:a});else{var y,m,v=(y=s({is_qa:!!u},p),m=m={user_id:b,public_id:g},Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(m)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(m)).forEach(function(e){Object.defineProperty(y,e,Object.getOwnPropertyDescriptor(m,e))}),y);d({eventName:i,experimentationUserId:g,experimentationUserAttributes:v,eventTags:a}),d({eventName:i,experimentationUserId:b,experimentationUserAttributes:s({},v),eventTags:a})}},[n,f,p,d])}},930205:function(e,t,n){"use strict";var r=n(827378);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}}t.Z=function(e,t,n){var o,c,s=function(e){if(Array.isArray(e))return e}(o=(0,r.useState)({}))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(o,2)||u(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=s[0],f=s[1];return(0,r.useCallback)((c=function(){var r,o,i,u,c,s,p=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(g){switch(g.label){case 0:for(o=Array(r=p.length),i=0;i<r;i++)o[i]=p[i];if(c=d[u="function"==typeof t?t.apply(void 0,l(o)):t])return"function"==typeof n&&n(c),[2,c];return[4,e.apply(void 0,l(o))];case 1:return s=g.sent(),u&&f(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){a(e,t,n[t])})}return e}({},e),n=null!=(n=a({},u,s))?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),[2,s]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var o=c.apply(e,t);function a(e){i(o,n,r,a,l,"next",e)}function l(e){i(o,n,r,a,l,"throw",e)}a(void 0)})}),[d,t,e,n])}},973019:function(e,t,n){"use strict";var r=n(827378);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultValue,n=void 0===t?"":t,o=e.isRequired,a=void 0===o||o,l=e.onBlurResolver,u=e.onChangeResolver,c=e.onInvalid,s=e.onValid,d=e.validations,f=void 0===d?[]:d,p=!!n,g=I(n),b=g.valid,y=g.message,m=i((0,r.useState)(y),2),v=m[0],h=m[1],w=i((0,r.useState)(n),2),O=w[0],S=w[1],k=i((0,r.useState)(!p),2),_=k[0],P=k[1],E=i((0,r.useState)(b),2),j=E[0],C=E[1],x=i((0,r.useState)(!_&&!j),2),Z=x[0],A=x[1];function L(e){var t=I(e),n=t.valid,r=t.message;C(n),r&&h(r)}function I(e){if(!Array.isArray(f))throw Error("`validations` must be an array");if(!e&&!a)return{valid:!0};var t=!0,n=!1,r=void 0;try{for(var o,i=f[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var l=o.value,u=l.validator,c=l.message;if(!("function"!=typeof u||u(e)))return{valid:!1,message:c}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return{valid:!0}}return(0,r.useEffect)(function(){j?"function"==typeof s&&s():"function"==typeof c&&c()},[j]),(0,r.useEffect)(function(){A(!_&&!j)},[j,_]),{errorMessage:v,fieldValue:O,hasDefaultValue:p,hasError:Z,isPristine:_,isValid:j,onBlur:function(e){e.target.value?(L(e.target.value),P(!1)):(h(),P(!0)),"function"==typeof l&&l(e.target.value)},onChange:function(e){e.preventDefault();var t=e.target.value;S(t),L(t),"function"==typeof u&&u(t)},setIsValid:C,triggerSetFieldValue:function(e){S(e),L(e)},triggerValidation:L,validate:I}}},881104:function(e,t,n){"use strict";var r=n(827378);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(){var e=a((0,r.useState)(!1),2),t=e[0],n=e[1],o=a((0,r.useState)(""),2),l=o[0],u=o[1],c=a((0,r.useState)(!1),2),s=c[0],d=c[1],f=a((0,r.useState)(""),2),p=f[0],g=f[1],b=(0,r.useRef)(null),y=a((0,r.useState)(!1),2),m=y[0],v=y[1],h=a((0,r.useState)(!0),2),w=h[0],O=h[1],S=a((0,r.useState)(!0),2),k=S[0],_=S[1],P=(0,r.useRef)({}),E=(0,r.useRef)([]),j=(0,r.useRef)([]);function C(e){n(!0),u(e)}function x(){n(!1),u("")}function Z(){d(!1),g("")}function A(){return Object.keys(P.current).reduce(function(e,t){var n=P.current[t];
1return n.current.name&&(e[n.current.name]=n.current.value),e},{})}function L(){var e=!0;E.current=[],j.current=[];var t=!0,n=!1,r=void 0;try{for(var o,i=Object.keys(P.current)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=P.current[a];"function"==typeof l.options.validator&&(l.options.validator(l.current.value)?j.current.push(l):(E.current.push(l),e=!1))}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return e}function I(){var e=!0,t=!1,n=void 0;try{for(var r,o=E.current[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;"function"==typeof i.options.onInvalid&&i.options.onInvalid(i.current.value)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}}function R(){var e=!0,t=!1,n=void 0;try{for(var r,o=j.current[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;"function"==typeof i.options.onValid&&i.options.onValid(i.current.value)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}}return(0,r.useEffect)(function(){O(L())},[]),{clearError:x,clearWarning:Z,errorMessage:l,getFormValues:A,hasError:t,hasWarning:s,isSubmitting:m,onSubmit:function(e,t){var n,r;return n=function(n){var r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){switch(o.label){case 0:n&&n.preventDefault(),x(),Z(),v(!0),o.label=1;case 1:return o.trys.push([1,7,8,9]),[4,L()];case 2:if(O(r=o.sent()),_(!1),!r)return[3,4];return R(),[4,e(A())];case 3:return o.sent(),[3,6];case 4:return t&&t(A()),[4,I()];case 5:o.sent(),o.label=6;case 6:return[3,9];case 7:return C(o.sent().message),[3,9];case 8:return v(!1),[7];case 9:return[2]}})},r=function(){var e=this,t=arguments;return new Promise(function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,u,"next",e)}function u(e){i(a,r,o,l,u,"throw",e)}l(void 0)})},function(e){return r.apply(this,arguments)}},triggerError:C,triggerWarning:function(e){var t=e.message,n=e.cb;if(b.current=null,!t){Z();return}d(!0),g(t),"function"==typeof n&&(b.current=n)},warningMessage:p,warningClickCallback:b,registerField:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){if(t)return P.current[t.name]={options:e,current:t},r.createRef(t)}},isFormValid:w,isPristine:k,isFormSubmittable:L,invalidateAllInvalidFields:I,restoreValidFields:R,shouldInvalidateForm:function(){var e=L();O(e),e?R():I()}}}},990231:function(e,t,n){"use strict";var r,o,i,a,l;n.d(t,{H6:function(){return o},lj:function(){return r},rZ:function(){return i}}),(a=r||(r={})).SINGLE_DELIVERY_FORM="SINGLE_DELIVERY_FORM",a.SINGLE_PAYMENT_FORM="SINGLE_PAYMENT_FORM",a.SINGLE_UNPAUSE_PAYMENT_FORM="SINGLE_UNPAUSE_PAYMENT_FORM",a.ADD_PAYMENT_METHOD_FORM="ADD_PAYMENT_METHOD_FORM",(l=o||(o={})).SINGLE_DELIVERY_FORM_REJECTED="SINGLE_DELIVERY_FORM_REJECTED",l.SINGLE_PAYMENT_FORM_REJECTED="SINGLE_PAYMENT_FORM_REJECTED",l.SINGLE_UNPAUSE_PAYMENT_FORM_REJECTED="SINGLE_UNPAUSE_PAYMENT_FORM_REJECTED",l.ADD_PAYMENT_METHOD_FORM_REJECTED="ADD_PAYMENT_METHOD_FORM_REJECTED",(i||(i={})).SUCCESS_PAYMENT_FORM="SUCCESS_PAYMENT_FORM"},870199:function(e,t,n){"use strict";n.d(t,{f:function(){return y},Z:function(){return m}});var r,o=n(687800),i=n(827378),a=n(761403),l=n(189452),u=n(165218),c=n.n(u),s=n(169821),d=n(158256);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p=(f(r={},d.nK.bounceModal,function(){return Promise.all([n.e(12737),n.e(78526),n.e(30816),n.e(20264),n.e(20828),n.e(52291)]).then(n.bind(n,594803))}),f(r,d.nK.genericModal,function(){return n.e(10783).then(n.bind(n,110783))}),f(r,d.nK.communityDiscountModal,function(){return Promise.all([n.e(47057),n.e(5441),n.e(61785)]).then(n.bind(n,561785))}),f(r,d.nK.communityPerksModal,function(){return Promise.all([n.e(47057),n.e(38579),n.e(12737),n.e(78526),n.e(30816),n.e(20264),n.e(20828),n.e(99184),n.e(5441),n.e(15263)]).then(n.bind(n,151949))}),f(r,d.nK.subscriptionSettingsModal,function(){return Promise.all([n.e(12737),n.e(78526),n.e(30816),n.e(20264),n.e(20828),n.e(28004),n.e(7965),n.e(33040)]).then(n.bind(n,508402))}),f(r,d.nK.paymentMethodModal,function(){return Promise.all([n.e(38579),n.e(12737),n.e(78526),n.e(30816),n.e(20264),n.e(20828),n.e(90730),n.e(56370)]).then(n.bind(n,169881))}),f(r,d.nK.deliveryAddressModal,function(){return Promise.all([n.e(47057),n.e(14206),n.e(9432),n.e(37384),n.e(63581),n.e(50182)]).then(n.bind(n,859149))}),f(r,d.nK.mealSelectionCompletionModal,function(){return Promise.all([n.e(47057),n.e(38579),n.e(17827),n.e(52463),n.e(34330),n.e(16709),n.e(87209),n.e(82409)]).then(n.bind(n,85659))}),f(r,d.nK.snapDialogPaidOrderModal,function(){return Promise.all([n.e(38579),n.e(87365)]).then(n.bind(n,687365))}),f(r,d.nK.xsellOrderSuccessModal,function(){return Promise.all([n.e(47057),n.e(35730)]).then(n.bind(n,435730))}),f(r,d.nK.standaloneHighRiskModal,function(){return n.e(49506).then(n.bind(n,649506))}),f(r,d.nK.loyaltyOptInModal,function(){return Promise.all([n.e(38579),n.e(2715),n.e(38e3),n.e(87918),n.e(96715),n.e(48248),n.e(95235),n.e(16945)]).then(n.bind(n,185395))}),f(r,d.nK.loyaltyMissionIntroModal,function(){return Promise.all([n.e(47057),n.e(38579),n.e(73020),n.e(97077),n.e(59546)]).then(n.bind(n,59546))}),f(r,d.nK.loyaltyOnboardingModal,function(){return Promise.all([n.e(38579),n.e(26116),n.e(18451)]).then(n.bind(n,718451))}),f(r,d.nK.doubleProteinOnboardingModal,function(){return n.e(56828).then(n.bind(n,256828))}),f(r,d.nK.referralNudgeModal,function(){return Promise.all([n.e(38579),n.e(3657)]).then(n.bind(n,903657))}),r),g=function(e){var t=e.modalKey,n=e.isActive,r=c()(p[t]);return n?(0,o.tZ)(s.Z,{suspense:!0,children:(0,o.tZ)(r,{},t)}):null};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}"test"!==(0,l.Z)().NODE_ENV&&(0,a.setAppElement)("#__next");var y=(0,i.createContext)({activeModal:null,setActiveModal:function(){},closeModal:function(){}}),m=function(e){var t,n=e.registerModals,r=e.initialModal,a=e.children,l=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null!=r?r:null))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return b(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=l[0],c=l[1];return(0,o.BX)(y.Provider,{value:{activeModal:u,setActiveModal:c,closeModal:function(e){c(function(t){return t===e?null:t})}},children:[a,n.map(function(e){return(0,o.tZ)(g,{modalKey:e,isActive:u===e},"".concat(e,"+").concat(Date.now()))})]})}},158256:function(e,t,n){"use strict";var r,o;n.d(t,{nK:function(){return r}}),(o=r||(r={})).bounceModal="bounce-modal",o.genericModal="generic-modal",o.communityDiscountModal="community-discount-modal",o.communityPerksModal="community-perks-modal",o.subscriptionSettingsModal="subscription-settings-modal",o.paymentMethodModal="payment-method-modal",o.deliveryAddressModal="delivery-address-modal",o.mealSelectionCompletionModal="meal-selection-completion-modal",o.snapDialogPaidOrderModal="snap-dialog-paid-order-modal",o.xsellOrderSuccessModal="xsell-order-success-modal",o.standaloneHighRiskModal="standalone-high-risk-modal",o.loyaltyOptInModal="loyalty-opt-in-modal",o.loyaltyMissionIntroModal="loyalty-mission-intro-modal",o.loyaltyOnboardingModal="loyalty-onboarding-modal",o.doubleProteinOnboardingModal="double-protein-onboarding-modal",o.referralNudgeModal="referral-nudge-modal"},871961:function(e,t,n){"use strict";n.d(t,{d:function(){return Z}});var r,o=n(37017),i=function(e,t){var n=(0,o.cn)(e,function(e,r,o){var i=(null==t?void 0:t.reset)?{}:e(n);r(n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},i,o))});return n},a=i({isEnabled:!1,redirectUrl:"",boxType:""}),l=i({customerStatus:"lead"}),u=i({customerStatus:"lead"}),c=i({initialForm:n(990231).lj.SINGLE_PAYMENT_FORM,screen:"",emitPaymentMethodCancelEvent:function(){},emitPaymentMethodCloseEvent:function(){},emitPaymentMethodSaveEvent:function(){},emitPaymentMethodChooseEvent:function(){}}),s=i({}),d=i({screen:"",subscriptionId:"",emitDeliveryAddressCancelEvent:function(){},emitDeliveryAddressSaveEvent:function(){}}),f=i({onClose:function(){},referrer:"",goToEditMode:function(){},savingsType:"other",savingsAmount:0,points:0,cartPricing:void 0}),p=i({onClose:function(){},onConfirm:function(){},onGoToNextWeek:function(){},cutoffDate:"",hasNextWeek:!1}),g=i({deliveryDate:"",updateDate:"",week:"",referrer:"",onClose:function(){}}),b=i({}),y=i({isOptedIn:!1,hasError:!1}),m=i({mission:{}}),v=i({}),h=i({onClose:function(){},onBrowse:function(){}}),w=i({}),O=n(158256),S=n(870199),k=n(827378),_=n(350344),P=n.n(_),E=i({title:"",subtitle:"",onClose:P(),onConfirm:P(),onDismiss:P(),cancelButtonText:"",confirmButtonText:""},{reset:!0});function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=(C(r={}
1,O.nK.bounceModal,a),C(r,O.nK.genericModal,E),C(r,O.nK.communityDiscountModal,l),C(r,O.nK.communityPerksModal,u),C(r,O.nK.subscriptionSettingsModal,c),C(r,O.nK.paymentMethodModal,s),C(r,O.nK.deliveryAddressModal,d),C(r,O.nK.mealSelectionCompletionModal,f),C(r,O.nK.snapDialogPaidOrderModal,p),C(r,O.nK.xsellOrderSuccessModal,g),C(r,O.nK.standaloneHighRiskModal,b),C(r,O.nK.loyaltyOptInModal,y),C(r,O.nK.loyaltyMissionIntroModal,m),C(r,O.nK.loyaltyOnboardingModal,v),C(r,O.nK.doubleProteinOnboardingModal,h),C(r,O.nK.referralNudgeModal,w),r),Z=function(e){var t,n=x[e],r=(0,k.useContext)(S.f),i=function(e){if(Array.isArray(e))return e}(t=(0,o.KO)(n))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return j(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1];return{modalState:a,setModalState:l,openModal:function(t){void 0!==t&&l(t),r.setActiveModal(e)},closeModal:function(){return r.closeModal(e)}}}},823467:function(e,t,n){"use strict";n.d(t,{D:function(){return u}});var r=n(827378),o=n(60074),i=n(605779),a=n(52130),l="KeepMeSigned",u=function(){var e=(0,a.L3)().trackJanusEvent;return{trackKeepMeSignedClick:(0,r.useCallback)(function(t){var n=t.isChecked,r=t.wasPreChecked,a=t.loginType,u=t.uiComponentLabel;try{e(i.AR.janusEvent({checkboxState:i.AR.checkboxState({checkboxName:l,isChecked:n,wasPreChecked:r}),login:i.AR.login({loginMethod:i.pL.Email,loginType:a}),uiComponent:i.AR.uiComponent({uiComponentName:l,uiComponentLabel:(null==u?void 0:u.trim())||null})}))}catch(e){(0,o.Tb)(e,{tags:{event:"Login_Check_KeepMeSigned_Checkbox_Click",component:"useLoginKeepMeSignedSnowplowEvent"}})}},[e])}}},640558:function(e,t,n){"use strict";var r=n(26730),o={isEnabled:!1,overrides:[{systemCountry:[r.Z.US,r.Z.FJ],values:{isEnabled:!0}}]};t.Z=o},14949:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var r=n(66077),o=n(640558),i=(0,r.Z)("hf.streamline-register-login-config",o.Z).useConfig},891777:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return eb},default:function(){return ey}});var r=n(687800),o=n(827378),i=n(184883),a=n(31748),l=n(463864),u=n(581340),c=n(373475),s=n(399166),d=n(854925),f=n(396887),p=n(43011),g=n(953142),b=n(190174),y=n(536150),m=n(165218),v=n.n(m),h=n(919245),w=n(695743),O=n(768587),S=v()(function(){return n.e(59817).then(n.bind(n,524996))},{loadableGenerated:{webpack:()=>[524996]}}),k=function(){var e,t=(0,w.z)("website").data;return(null==t?void 0:null===(e=t.newFeatures)||void 0===e?void 0:e.appInstallLoginScreen)?(0,r.tZ)(S,{}):(0,r.tZ)(O.xu,{display:"flex",justifyContent:"center",children:(0,r.tZ)(h.Z,{})})},_=n(40412),P=n.n(_),E=n(942706);window.dataLayer=window.dataLayer||[];var j=function(e){window.dataLayer.push(e)},C=n(966622),x=n(407792);function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var A=function(e){var t,n=e.section,i=e.children,a=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return Z(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],u=a[1],c=(0,C.py)({runUsingStatsig:!0}).track,s=(0,x.O)(),d=s.id,f=s.attributes;return(0,r.tZ)(P(),{onChange:function(e){e&&!l&&(j((0,E.c)({gaEventCategory:"navigation",gaEventLabel:n,gaEventNonInteraction:!0,gaEventAction:"scroll"})),c({experimentationUserId:d,experimentationUserAttributes:f,eventName:"Checkout_LoginPageLoad",eventTags:{Eventcategory:"funnel",EventAction:"loginPageLoad",EventLabel:"",brand:"HelloFresh",tribe:"Conversions Journey"}}),u(!0))},active:!l,minTopValue:100,partialVisibility:!0,children:i})},L=n(468891),I=n(148159),R=n.n(I),M=n(90104),T=n.n(M),D=n(567921),B=n.n(D),F=n(223470),z="/".concat("plans","/"),N=function(e){var t=e.path,n=e.query,r=T()(n)?"":"?".concat((0,L.stringify)(n||{}));window.location.replace("".concat(t).concat(r))},U=function(e){var t=e.query,n=void 0===t?{}:t,r=e.hasSubscriptions,o=e.shouldPreserveQuery,i=void 0===o||o,a=e.shouldRedirectToReactivationPage,l=e.shouldRedirectToWelcomeSpace,u=e.welcomeSpacePath,c=void 0===u?"":u,s=n.continue||n.redirectUrl,d=Array.isArray(s)?s[0]:s,f=R()(n,["continue","redirectUrl","aud"]),p=Array.isArray(null==n?void 0:n.redirectUrl)?n.redirectUrl[0]:null==n?void 0:n.redirectUrl;if(p&&!(0,F.zd)(p)){N({path:z,query:i?f:{}});return}if(d&&(0,F.yU)(d)&&(0,F.zd)(d)){N({path:d,query:i?f:{}});return}if(r){B().remove("hf_ssr_custom_brand"),N({path:void 0!==a&&a?"/account-settings/subscription-settings/reactivate":void 0!==l&&l&&c?c:"/my-account/deliveries/menu",query:i?f:{}});return}N({path:z,query:i?f:{}})},q=n(265759),V=n(953137);function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function G(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var H=function(){var e=G((0,o.useState)(),2),t=e[0],n=e[1],r=G((0,o.useState)(),2),i=r[0],a=r[1],l=(0,V.u)({},{suspense:!1}).data;return(0,o.useEffect)(function(){if(l){var e=null==l?void 0:l.items,t=(null==e?void 0:e.length)>0,r=t&&(null==e?void 0:e.some(function(e){return!(null==e?void 0:e.canceledAt)})),o=t&&(null==e?void 0:e.some(function(e){var t,n;return(null==e?void 0:null===(n=e.productType)||void 0===n?void 0:null===(t=n.specs)||void 0===t?void 0:t.recurrency)===0}));n(o&&!r),a(o)}},[l]),{isCancelled:t,hasNonSeasonalSubscriptions:i}},K=n(164377),J=n(913940),X=n(141323),$=n(759839),Y=function(e){var t,n,r=new Date((null==e?void 0:null===(n=e.subscription)||void 0===n?void 0:null===(t=n.customer)||void 0===t?void 0:t.cancellationDate)||"");return Math.round((new Date().getTime()-r.getTime())/864e5)},Q=function(){var e=(0,p.Z)(),t=(0,X.j)({},{suspense:!1,enabled:e}).data,n=!!t&&!t.activeSubscriptionId,r=(0,$.t)({},{enabled:e,suspense:!1}).data,o=(0,V.u)({},{suspense:!1,enabled:e}).data;return(null==o?void 0:o.items.some(function(e){return!e.canceledAt}))||!r?{daysSinceCancellation:0,isCanceledCustomer:n}:{daysSinceCancellation:Y(r),activeSubscriptionCount:0,isCanceledCustomer:n}},ee=function(){var e=Q(),t=e.daysSinceCancellation,n=e.activeSubscriptionCount,r=e.isCanceledCustomer,o=(0,C.py)(),i=o.decide,a=o.isReady,l=(0,x.O)(),u=l.id,c=l.attributes;if(!r)return{isReactivationLPVariation:!1,isReady:!1};var s=!1;if(a){var d,f,p={experimentKey:"usreeng_landing_page_after_login",experimentationUserId:u,experimentationUserAttributes:(d=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},c),f=f={days_since_cancellation:t,active_subscription_count:n},Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(f)).forEach(function(e){Object.defineProperty(d,e,Object.getOwnPropertyDescriptor(f,e))}),d)};"variation_1"===i(J.mj.ABTEST,p).variationKey&&(s=!0)}return{isReactivationLPVariation:s,isReady:a}};function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function en(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var er=function(e,t,n,r,o){return(null==t?void 0:t.length)?o?en(et({},e.query),{redirectUrl:"/pages/reactivate",utm_name:n,utm_c:"voucher",c:t,c_discount:r,utm_boxes:1}):en(et({},e.query),{redirectUrl:"/pages/reactivate",utm_name:n,utm_c:"voucher",c:t,c_discount:r}):en(et({},e.query),{redirectUrl:"/pages/reactivate",utm_name:n,utm_c:"organic",c:"GA-9RJT8"})},eo=n(718583),ei=n(736026);function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var el=function(e){var t=(0,o.useMemo)(function(){var t;return eo.ZP.getItem("StoredReactivationCouponCode")||eo.ZP.getItem("url_coupon_code")||B().get("StoredReactivationCouponCode")||B().get("url_coupon_code")||(null==e?void 0:null===(t=e.query)||void 0===t?void 0:t.c)||""},[e]),n=(0,ei.D)({code:null==t?void 0:t.toString()},{suspense:!1}).data,r=null==n?void 0:n.discount_type,i=(null==n?void 0:n.discount_value)||0,a=(null==n?void 0:null===(y=n.discount_settings)||void 0===y?void 0:y.box_count)||1,l=(0,p.Z)(),u=(0,$.t)({},{enabled:l,suspense:!1}).data,c=(null==u?void 0:null===(v=u.subscription)||void 0===v?void 0:null===(m=v.product)||void 0===m?void 0:m.unitPrice)||0;if("New"===(null==n?void 0:n.customer_status))return{voucherCode:"",singleBoxVoucher:!1,discountDollars:0};var s="percent"===r?i/100*c/100:i;if(a>1&&"percent"===r){var d=(null==n?void 0:null===(w=n.discount_settings)||void 0===w?void 0:null===(h=w.discount_rule)||void 0===h?void 0:h.box_rule)||{};s=0;var f=!0,g=!1,b=void 0;try{for(var y,m,v,h,w,O,S=Object.entries(d)[Symbol.iterator]();!(f=(O=S.next()).done);f=!0){var k,_=(k=O.value,function(e){if(Array.isArray(e))return e}(k)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(k,2)||function(e,t){if(e){if("string"==typeof e)return ea(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,2)}}(k,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1].discount_value;s+=_/1e4*c/100}}catch(e){g=!0,b=e}finally{try{f||null==S.return||S.return()}finally{if(g)throw b}}}return{voucherCode:s>0?t.toString():"",singleBoxVoucher:1===a,discountDollars:Math.round(s)}},eu=n(285087),ec="hf_signup_redirect_to_plans",es=function(){var e=(0,f.ew)(),t=(0,p.Z)(),n=(0,l.D)(),i=n.state,a=n.dispatch,m=(0,y.m)({},{enabled:!!t,suspense:!1}).data,v=H(),h=v.isCancelled,w=v.hasNonSeasonalSubscriptions,O=(0,eu.l)(),S=O.getItem,_=O.removeItem,P=(0,g.y)({enabled:!!t}),E=P.shouldUseCheckoutStatusEndpoint,j=P.checkoutRedirect,C=P.isCheckoutStatusFetched,x=P.data,Z=E&&C&&!!(null==x?void 0:x.planCreationAllowed)&&(null==x?void 0:x.redirect)==null,L=(0,b.x)({includeCanceled:!0},{enabled:t,suspense:!1}),I=L.data,R=L.isFetched,M=!!(null==I?void 0:I.length)&&I.every(function(e){return!!e.canceledAt}),T=Z&&R&&M,D=T?"reactivation":j,B=Z&&R&&!T,F=(0,u.t)(),z=null==F?void 0:F.query,N=el(F),V=N.voucherCode,W=N.discountDollars,G=N.singleBoxVoucher,J=(0,X.j)({},{suspense:!1}).data,$=ee().isReactivationLPVariation,Y=(null==J?void 0:J.firstName)||"",Q=(0,K.H)()(),et=Q.isEnabled,en=Q.isReady,eo=Q.welcomeSpacePath,ei=et&&en,ea=function(){var e=Array.isArray(z.email)?z.email[0]:z.email;a({type:q.qB,payload:{step:q.qI,email:e?decodeURIComponent(e):""}})};return(0,o.useEffect)(function(){if("1"===(Array.isArray(z.redirectLinkError)?z.redirectLinkError[0]:z.redirectLinkError)){ea();return}}
1,[]),(0,o.useEffect)(function(){if(t){if(E){if(!C||Z&&!R)return;if(B){var e;if("true"===S(ec)){_(ec),U({query:z||{},hasSubscriptions:!1,shouldRedirectToReactivationPage:!1,shouldRedirectToWelcomeSpace:!1,welcomeSpacePath:""});return}U({query:z||{},hasSubscriptions:!0,shouldRedirectToReactivationPage:!1,shouldRedirectToWelcomeSpace:ei,welcomeSpacePath:eo});return}"reactivation"===D&&$&&(e=er(F,V,Y,W,G)),U({query:e||z||{},hasSubscriptions:!0,shouldRedirectToReactivationPage:"reactivation"===D,shouldRedirectToWelcomeSpace:"reactivation"!==D&&ei,welcomeSpacePath:"reactivation"!==D?eo:""});return}if(m&&void 0!==h&&void 0!==w){var n,r=!1;h&&(r=!0),$&&(n=er(F,V,Y,W,G)),U({query:n||z,hasSubscriptions:w,shouldRedirectToReactivationPage:r,shouldRedirectToWelcomeSpace:ei,welcomeSpacePath:eo})}}},[m,t,z,i,h,w,E,C,D,B,Z,R,$,F,V,Y,W,G,ei,eo]),(0,r.tZ)(c.ZP,{appId:e.NEXT_PUBLIC_FACEBOOK_APP_ID,children:(0,r.tZ)(s.Z,{appId:e.NEXT_PUBLIC_GOOGLE_CLIENT_ID,children:(0,r.tZ)(d.Z,{clientId:"".concat(e.NEXT_PUBLIC_APPLE_CLIENT_ID),children:(0,r.tZ)(A,{section:"hf-login",children:(0,r.tZ)(k,{})})})})})},ed=n(870199),ef=n(158256),ep=n(650603),eg=function(){return(0,r.tZ)(r.HY,{children:(0,r.BX)(i.Z,{scope:"login",children:[(0,r.tZ)(a.Z,{}),(0,r.tZ)(ed.Z,{registerModals:[ef.nK.standaloneHighRiskModal],children:(0,r.tZ)(l.s,{children:(0,r.tZ)(es,{})})})]})})};eg.customLayout=ep.ZP;var eb=!0,ey=eg},919245:function(e,t,n){"use strict";n.d(t,{Z:function(){return nX}});var r=n(687800),o=n(827378),i=n(768587),a=n(783045),l=n(164528),u=n(571321),c=n(318066),s=n(277425),d=n(543790),f=/^([a-z]{1,2}_[^,/]+)(,[a-z]{1,2}_[^,/]+)*$/,p=function(e){for(var t,n=e.split("/").filter(Boolean);n.length>1&&(t=n[0],f.test(t));)n.shift();return n.length?"/".concat(n.join("/")):e},g=function(e){if(!e)return!1;if(e.startsWith("/hellofresh_")||e.startsWith("/everyplate_"))return!0;var t=(null==e?void 0:e.startsWith("//"))?e.replace("//","https://"):e;if(!/^https?:/.test(t))return!1;try{var n=new URL(t),r=n.hostname,o=n.href;if(r.includes("cloudfront")||o.includes("images.ctfassets.net/4frik3v39clf")||Object.keys(d.Z).some(function(e){return r.includes("cdn.".concat(e,".com"))})||r.includes("hf-website-live.s3-eu-west-1.amazonaws.com")||r.includes("hf-website-live.s3.eu-west-1.amazonaws.com")||"img.hellofresh.com"===r||r.startsWith("media."))return!0;return!1}catch(e){return!1}},b=n(581340),y=function(){var e,t=(0,l.ZP)("cookbook").translate,n=(0,b.t)().query,o=(null==n?void 0:n.displayCookbookBanner)==="true",a=(0,u.vV)({limit:3},{suspense:!1,enabled:o}).data,d=(null!==(e=null==a?void 0:a.data)&&void 0!==e?e:[]).filter(function(e){return!!e.thumbnail_url}).slice(0,3),f=d.map(function(e){return{id:e.id,src:e.thumbnail_url}}),y=d.map(function(e){if(e.title)return e.title;try{return new URL(e.url).hostname.replace(/^www\./,"")}catch(t){return e.url}}).join(", ");return 0===f.length?null:(0,r.BX)(i.xu,{"data-test-id":"cookbook-saved-recipes-banner",display:"flex",alignItems:"center",gap:"global.sm-2",width:"100%",backgroundColor:"global.hellofresh-lime.200",borderWidth:"2px",borderStyle:"solid",borderColor:"global.hellofresh-lime.100",borderRadius:"border-radius-lg",p:"global.xs",children:[(0,r.tZ)(i.xu,{position:"relative",width:"112px",height:"48px",flexShrink:"0",children:f.map(function(e,t){var n,o=e.id,a=g(n=e.src)?{type:"managed",src:p((0,s.Z)(n))}:{type:"external",src:n},l={objectFit:"cover",width:"100%",height:"100%"};return(0,r.tZ)(i.xu,{position:"absolute",top:"0px",left:"".concat(32*t,"px"),width:"48px",height:"48px",borderRadius:"border-radius-md",borderWidth:"2px",borderStyle:"solid",borderColor:"global.hellofresh-lime.200",zIndex:f.length-t,overflow:"hidden",children:"managed"===a.type?(0,r.tZ)(c.ZP,{src:a.src,alt:"","aria-hidden":!0,width:96,height:96,crop:"fill",style:l}):(0,r.tZ)("img",{src:a.src,alt:"","aria-hidden":!0,style:l})},o)})}),(0,r.BX)(i.xu,{display:"flex",flexDirection:"column",minWidth:"0",children:[(0,r.tZ)(i.xv,{type:"body-sm-bold",color:"global.black",children:t("cookbook.saved-recipes-banner.title",{defaultValue:"Your {{ count }} saved recipes are waiting",count:f.length})}),(0,r.tZ)(i.xv,{type:"body-xs-regular",color:"neutral.600",children:y})]})]})},m=n(285087),v=n(60074),h=n(388010),w=n(84284),O=n(52130),S=n(265759),k=n(463864),_=function(){var e=(0,O.L3)().trackJanusEvent,t=(0,k.D)().state,n=(0,o.useRef)(!1),r=(0,o.useRef)(!1);return{trackImpression:(0,o.useCallback)(function(){var o=t.step===S.hm,i=o?r:n;if(!i.current){i.current=!0;try{e(o?w.h.janusEvent():h.P.janusEvent())}catch(e){(0,v.Tb)(e,{tags:{event:o?"Registration_Section_CookbookLoggedOutPromotion_Impression":"Login_Section_CookbookLoggedOutPromotion_Impression",component:"useLoginCookbookBannerTracking"}})}}},[e,t.step])}};function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var E=function(){var e,t,n,a,u=(0,l.ZP)("cookbook").translateRaw,s=(0,m.l)(),d=function(e){if(Array.isArray(e))return e}(e=(0,o.useState)(null))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return P(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,2)}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=d[0],p=d[1],g=_().trackImpression;if((0,o.useEffect)(function(){var e=s.getItem("hf_login_pending_cookbook_save_v1");(null==e?void 0:e.title)&&p(e)},[s]),(0,o.useEffect)(function(){f&&g()},[f,g]),!f)return null;var b=u("cookbook.login_pending_recipe_banner.title",{recipeTitle:f.title,defaultValue:"Your ".concat(f.title," is waiting...")}),y=u("cookbook.login_pending_recipe_banner.subtitle",{defaultValue:"Sign up for free to save this recipe in your cookbook."});return(0,r.BX)(i.xu,{"data-test-id":"login-pending-recipe-banner",display:"flex",alignItems:"center",gap:"global.sm-2",width:"100%",backgroundColor:"global.hellofresh-lime.200",borderWidth:"2px",borderStyle:"solid",borderColor:"global.hellofresh-lime.100",borderRadius:"border-radius-lg",p:"global.xs",children:[f.thumbnailUrl&&(0,r.tZ)(i.xu,{width:"56px",height:"56px",borderRadius:"border-radius-md",overflow:"hidden",flexShrink:"0",children:(0,r.tZ)(c.ZP,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({src:f.thumbnailUrl,alt:"","aria-hidden":!0,width:112,height:112},(t=f.thumbnailUrl,/^https?:\/\//.test(t))?{unoptimized:!0}:{crop:"fill"}),a=a={style:{objectFit:"cover",width:"100%",height:"100%"}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}),n))}),(0,r.BX)(i.xu,{display:"flex",flexDirection:"column",minWidth:"0",children:[(0,r.tZ)(i.xv,{type:"body-sm-bold",color:"global.black",children:b}),(0,r.tZ)(i.xv,{type:"body-xs-regular",color:"neutral.600",children:y})]})]})},j=n(567921),C=n.n(j),x=n(647220),Z=n(695743),A=n(344884),L=n(497249),I=n(790128),R=function(e){var t=e.exception,n=e.errorMessage,r=e.operation,o=t||Error(n);v.Tb(o,function(e){return e.setLevel("error"),e.setExtra("error:auth",n),r&&e.setTag("operation",r),(0,I.Z)(e,{name:"activations-rte",githubTeam:"hellofresh/activations-rte",tribe:"conversions",alliance:"growth",jiraPrefix:"USCRO",slackChannel:"#squad-curation",slackAlertsChannel:"#squad-curation",skipLabelsOnPR:!1,teamIdentifier:"activations-rte"}),e})},M=n(497305),T=n(346629),D=n(887824),B=n(396887),F=n(605779),z=n(823467),N=n(553911),U=n(200770),q=n(415595),V=function(e){var t,n,o=e.onClickWarning,a=e.warningMessage,l=e.variant,u=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onClickWarning","warningMessage","variant"]);return a?(0,r.tZ)(i.gb,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({variant:void 0===l?"error":l,"data-test-id":"hf-warning-bar",tabIndex:0},!!o&&{onClick:o,cursor:"pointer",role:"button"},u),n=n={children:(0,r.tZ)(N.Z,{copy:a,hasMarkdown:!0})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)):null},W=n(973019),G=o.forwardRef(function(e,t){var n,o,a=e.type,l=e.name,u=e.tip,c=e.label,s=void 0===c?"":c,d=e.invalid,f=void 0!==d&&d,p=e.errorMessage,g=void 0===p?"":p,b=e.readOnly,y=void 0!==b&&b,m=e.placeholder,v=void 0===m?"":m,h=e.onChange,w=e.onBlur,O=e.onFieldClick,S=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["type","name","tip","label","invalid","errorMessage","readOnly","placeholder","onChange","onBlur","onFieldClick"]),k="hf-form-group-".concat(l);return(0,r.tZ)(i.NI,{"data-test-id":k,labelText:"".concat("string"==typeof s?s:s.props.children),children:(0,r.tZ)(i.NI.TextInput,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},S,f&&g?{error:f,errorText:g}:{hintText:u}),o=o={id:"".concat(k,"-input"),"data-test-id":"".concat(k,"-input"),type:y?"button":a,name:l,onChange:void 0===h?function(){}:h,onBlur:void 0===w?function(){}:w,ref:t,onClick:y?void 0===O?function(){}:O:void 0,placeholder:"string"==typeof v?v:JSON.stringify(v)},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))})});function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function K(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}G.displayName="AuthField";var J=function(e){return(0,r.tZ)("svg",K(H({width:"21",height:"19",viewBox:"0 0 21 13"},e),{children:(0,r.BX)("g",{fill:"#000",fillRule:"evenodd",children:[(0,r.tZ)("path",{d:"M20.674 6.088C17.41 2.09 13.9.126 10.241.22 4.337.387.274 5.878.103 6.112c-.008.01-.013.022-.02.034l-.016.027a.53.53 0 0 0-.03.067l-.012.034a.574.574 0 0 0-.016.065c-.002.013-.005.028-.006.043a.705.705 0 0 0 0 .11l.006.045c.004.021.01.042.016.064l.012.033a.534.534 0 0 0 .03.067l.016.027c.007.012.012.024.02.034.171.234 4.234 5.726 10.138 5.892.091.003.181.005.272.005 3.56 0 6.978-1.976 10.161-5.872a.55.55 0 0 0 .122-.35.552.552 0 0 0-.122-.35zM10.278 11.56c-4.59-.125-8.097-3.973-9.045-5.122.948-1.15 4.455-4.998 9.045-5.124 3.203-.084 6.315 1.64 9.267 5.124-2.952 3.484-6.061 5.215-9.267 5.122z"}),(0,r.tZ)("path",{d:"M10.5 3C8.57 3 7 4.57 7 6.5S8.57 10 10.5 10 14 8.43 14 6.5 12.43 3 10.5 3z"})]})}))},X=function(e){return(0,r.tZ)("svg",K(H({width:"21",height:"19",viewBox:"0 0 21 19"},e),{children:(0,r.BX)("g",{fill:"none",fillRule:"evenodd",children:[(0,r.tZ)("path",{fill:"#000",d:"M20.674 9.088C17.41 5.09 13.9 3.126 10.241 3.22 4.337 3.387.274 8.878.103 9.112c-.008.01-.013.022-.02.034l-.016.027a.53.53 0 0 0-.03.067l-.012.034a.574.574 0 0 0-.016.065c-.002.013-.005.028-.006.043a.705.705 0 0 0 0 .11l.006.045c.004.021.01.042.016.064l.012.033a.534.534 0 0 0 .03.067l.016.027c.007.012.012.024.02.034.171.234 4.234 5.726 10.138 5.892.091.003.181.005.272.005 3.56 0 6.978-1.976 10.161-5.872a.55.55 0 0 0 .122-.35.552.552 0 0 0-.122-.35zM10.278 14.56c-4.59-.125-8.097-3.973-9.045-5.122.948-1.15 4.455-4.998 9.045-5.124 3.203-.084 6.315 1.64 9.267 5.124-2.952 3.484-6.061 5.215-9.267 5.122z"}),(0,r.tZ)("path",{fill:"#000",d:"M10.5 6C8.57 6 7 7.57 7 9.5S8.57 13 10.5 13 14 11.43 14 9.5 12.43 6 10.5 6z"}),(0,r.tZ)("path",{stroke:"#000",strokeLinecap:"round",strokeWidth:"1.5",d:"M2.5 17.5l16-16"}),(0,r.tZ)("path",{stroke:"#c2c2c2",strokeLinecap:"round",d:"M.8 17.5l16-16"})]})}))};function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){if(e){if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}}var Q=o.forwardRef(function(e,t){var n,i,a,l=function(){A(function(e){return!e})},u=e.name,c=e.defaultValue,s=e.label,d=e.validations,f=e.disablePasswordLengthValidation,p=e.isRequired,g=e.placeholder,b=e.onValid,y=e.onInvalid,m=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["name","defaultValue","label","validations","disablePasswordLengthValidation","isRequired","placeholder","onValid","onInvalid"]),v=(0,Z.z)("frontend-auth").data,h=(0,q.a)(null==v?void 0:v.translations),w=(0,W.Z)({defaultValue:c,validations:[{validator:function(e){return f?!p||e.length>=1:!p&&!e||e.length>=5},message:h.get("error_signup-form_password-too-short")},{validator:function(e){return f?!p||e.length>=1:!p&&!e||e.length<=50},message:h.get("error_signup-form_password-too-long")}].concat(function(e){if(Array.isArray(e))return $(e)}(d)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(d)||Y(d)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),onBlurResolver:e.onBlur,onChangeResolver:e.onChange,isRequired:p,onValid:b,onInvalid:y}),O=w.errorMessage,S=w.fieldValue,k=w.hasError,_=w.onBlur,P=w.onChange,E=w.triggerValidation,j=w.validate,C=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||Y(n,2)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=C[0],A=C[1];return(0,r.tZ)(G,(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},m),a=a={onValid:b,onInvalid:y,value:S,type:x?"text":"password",name:u,label:null!=s?s:h.raw("text_auth-password-field_label"),errorMessage:O,invalid:k,onChange:P,onBlur:_,ref:("function"==typeof t?t:function(){})({validator:function(e){return j(e).valid},onInvalid:E,onValid:E}),trailingIcon:x?(0,r.tZ)(J,{onClick:l,"data-test-id":"hf-form-group-password-icon-button"}):(0,r.tZ)(X,{onClick:l,"data-test-id":"hf-form-group-password-icon-button"}),onIconClick:l,placeholder:g},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))});Q.defaultProps={isRequired:!0,disablePasswordLengthValidation:!1,defaultValue:"",validations:[],placeholder:""},Q.displayName="AuthPasswordField";var ee=n(930205),et=n(273608),en=n(140224),er=n(24165),eo=n(223470);function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ea(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function el(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ea(i,r,o,a,l,"next",e)}function l(e){ea(i,r,o,a,l,"throw",e)}a(void 0)})}}function eu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ei(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ei(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ec(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var es=o.forwardRef(function(e,t){var n,i,a=function(){s&&E(void 0)},l=e.name,u=e.unregisteredWarnEnabled,c=e.registeredErrorEnabled,s=e.shouldVerifyEmail,d=e.onWarning,f=e.onEmailChange,p=e.onEmailStatusResolved,g=e.label,b=e.isRequired,y=e.defaultValue,m=e.onValid,v=e.onInvalid,h=e.placeholder,w=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["name","unregisteredWarnEnabled","registeredErrorEnabled","shouldVerifyEmail","onWarning","onEmailChange","onEmailStatusResolved","label","isRequired","defaultValue","onValid","onInvalid","placeholder"]),O=eu((0,o.useState)(!1),2),S=O[0],k=O[1],_=eu((0,o.useState)(),2),P=_[0],E=_[1],j=eu((0,o.useState)(null),2),C=j[0],x=j[1],A="function"==typeof d?d:function(){},L=(0,er.Z)(),I=(0,en.O)().systemCountry,R=(0,Z.z)("frontend-auth").data,M=(0,q.a)(null==R?void 0:R.translations),T=(0,et.Z)(),D=(0,W.Z)({defaultValue:y,validations:[{validator:function(e){return!b&&!e||(0,eo.Ju)(e)},message:M.get("error-message_email_invalid_error")},{validator:function(){return!S},message:M.get("error-message_email_signin_rate-limit_error")},{validator:function(){return!c||!C||!C.registered},message:M.get("error-message_email_registered_error")}],onChangeResolver:function(){k(!1),x(null),a()},onBlurResolver:function(e){return es.apply(this,arguments)},isRequired:b,onValid:m,onInvalid:v}),B=D.errorMessage,F=D.fieldValue,z=D.hasError,N=D.isPristine,U=D.onBlur,V=D.onChange,H=D.triggerValidation,K=D.triggerSetFieldValue,J=D.validate,X=(0,ee.Z)(function(e){return Q.apply(this,arguments)},F),$=(0,ee.Z)(function(e){return Y.apply(this,arguments)},F);function Y(){return(Y=el(function(e){return ec(this,function(t){switch(t.label){case 0:return[4,T.post("/auth/email/status",{email:e,country:I},{headers:{Authorization:"".concat(L.token_type," ").concat(L.access_token)}})];case 1:return[2,t.sent().data]}})})).apply(this,arguments)}function Q(){return(Q=el(function(e){return ec(this,function(t){switch(t.label){case 0:return[4,T.get("/email-validation/verify/".concat(e),{timeout:4e3,headers:{Authorization:"".concat(L.token_type," ").concat(L.access_token)}})];case 1:return[2,t.sent().data]}})})).apply(this,arguments)}function ei(){return(ei=el(function(e){var t;return ec(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,X(e)];case 1:return E(t=n.sent()),[2,t];case 2:return n.sent(),E(void 0),[3,3];case 3:return[2]}})})).apply(this,arguments)}function ea(){return(ea=el(function(e){var t,n,r;return ec(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$(e)];case 1:return x(t=o.sent()),null==p||p(t),k(!1),[2,t];case 2:return 429===parseInt(null==(n=o.sent())?void 0:null===(r=n.response)||void 0===r?void 0:r.status)&&k(!0),[3,3];case 3:return[2]}})})).apply(this,arguments)}function es(){return(es=el(function(e){var t;return ec(this,function(n){switch(n.label){case 0:if(!(0,eo.Ju)(e))return[2];if(!(c||u||s))return[3,2];return[4,function(e){return ea.apply(this,arguments)}(e)];case 1:t=n.sent(),!s||(null==t?void 0:t.registered)||function(e){ei.apply(this,arguments)}(e),n.label=2;case 2:return[2]}})})).apply(this,arguments)}return(0,o.useEffect)(function(){"function"==typeof f&&f(F)},[F]),(0,o.useEffect)(function(){N||H(F)}
1,[N,c,C]),(0,o.useEffect)(function(){N||H(F)},[N,S]),(0,o.useEffect)(function(){if(!N){if(!P){null==A||A({message:""});return}if(P.did_you_mean){var e=M.raw("warn-message_email_did-you-mean_warn",{suggestedEmail:P.did_you_mean});e&&e.includes(P.did_you_mean)&&(null==A||A({message:Array.isArray(e)?e.join(""):e,cb:function(){K(P.did_you_mean),null==A||A({message:""})}}));return}if("undeliverable"===P.result){null==A||A({message:M.raw("warn-message_email_undeliverable_warn")});return}}},[N,P]),(0,o.useEffect)(function(){if(!N&&u){if(!C||(null==C?void 0:C.registered)){null==A||A({message:""});return}null==A||A({message:M.raw("warn-message_email_signin-unregistered_error")})}},[C,N,u]),(0,r.tZ)(G,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},w),i=i={type:"email",name:l,label:null!=g?g:M.raw("text_auth-email-field_label"),invalid:z,errorMessage:B,onChange:V,onBlur:U,value:F,placeholder:h,ref:("function"==typeof t?t:function(){})({validator:function(e){return J(e).valid},onInvalid:H})},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n))});es.displayName="AuthEmailField",es.defaultProps={name:"email",isRequired:!0,unregisteredWarnEnabled:!1,registeredErrorEnabled:!1,shouldVerifyEmail:!1,placeholder:"",onWarning:function(){},onEmailChange:function(){}};var ed=n(881104),ef=n(223960),ep=n(793884),eg=n(206082),eb=n(190341),ey=function(e){var t,n,o=e.children,i=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children"]);return(0,r.tZ)("form",(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-test-id":"hf-auth-form"},i),n=n={method:"post",children:o},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},em=n(966622),ev=n(407792),eh=n(908855),ew=function(){var e=(0,O.L3)().trackJanusEvent;return{trackRegistrationGenerationSuccess:(0,o.useCallback)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var n=eh.Rg.event({systemMessage:null}),r=null===t?void 0:[eh.Rg.contact({contactType:t,hashedDetails:null})];e(eh.Rg.janusEvent({event:n,contactEntities:r}))}catch(e){(0,v.Tb)(e,{tags:{event:"Registration_GenerationSuccess_SystemAction",component:"useRegistrationGenerationSuccessSnowplowEvent"}})}},[e])}},eO=n(835678);function eS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ek(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function e_(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ek(i,r,o,a,l,"next",e)}function l(e){ek(i,r,o,a,l,"throw",e)}a(void 0)})}}function eP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function eE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ej(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var eC=function(e){var t,n,i,a,l,u=e.onSuccess,c=e.onFail,s=e.onSubmit,d=e.children,f=e.trackingMetadata,p=e.shouldVerifyEmail,g=e.shouldSubmitVerifiedEmail,b=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onSuccess","onFail","onSubmit","children","trackingMetadata","shouldVerifyEmail","shouldSubmitVerifiedEmail"]),y=(0,er.Z)(),m=(0,en.O)().systemCountry,v=(0,Z.z)("frontend-auth").data,h=(0,q.a)(null==v?void 0:v.translations),w=(0,et.Z)(),O=(0,eb.G)(),S=(null==O?void 0:null===(l=O.mobileWebView)||void 0===l?void 0:l.active)||!1,k=(0,ef.Z)().dispatchCustomEvent,_=(0,D.Z)().push,P=ew().trackRegistrationGenerationSuccess,E=(0,eO.t)().trackRegistrationSignupError,j=(0,ep.Z)(),C=(0,ed.Z)(),x=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return eS(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eS(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),A=x[0],L=x[1],I=(0,eg.m)().mutateAsync,R={event:"gaEventTrigger",gaEventCategory:"login",gaEventLabel:"registration"},M=(n=e_(function(e){return ej(this,function(t){switch(t.label){case 0:return[4,I({email:e.username,password:e.password,first_name:"",last_name:"",tracking_metadata:f})];case 1:return[2,t.sent()]}})}),function(e){return n.apply(this,arguments)}),T=(i=e_(function(e){var t;return ej(this,function(n){switch(n.label){case 0:if(t=e.email,!g&&!p)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,w.put("/email-validation/verify/".concat(t,"/").concat(m),null,{headers:{Authorization:"".concat(y.token_type," ").concat(y.access_token)}})];case 2:case 3:return n.sent(),[3,4];case 4:return[2]}})}),function(e){return i.apply(this,arguments)}),B=(0,em.py)({runUsingStatsig:!0}).track,F=(0,ev.O)(),z=F.id,N=F.attributes,U=(a=e_(function(e){var t,n,r,o,i,a,l;return ej(this,function(d){switch(d.label){case 0:t=e.username,n=e.password,"function"==typeof s&&s(),_(eP({event_name:"Signup_Click",gaEventAction:"modal register clicked"},R,j)),d.label=1;case 1:return d.trys.push([1,4,,5]),[4,M({username:t,password:n})];case 2:return r=d.sent(),[4,T({email:t})];case 3:return d.sent(),L(!0),V(r),_(eP({event_name:"Signup_Success",gaEventAction:"modal register success"},R,j)),P(eh.uC.Email),B({eventName:"Successful_Register",experimentationUserId:z,experimentationUserAttributes:N,eventTags:{event_name:"Successful_Register",EventCategory:"registration",EventAction:"password",EventLabel:S?"app":"registerPage"}}),"function"==typeof u&&u(r),[3,5];case 4:if(o=d.sent(),"function"==typeof c&&c(o),_(eP({event_name:"Signup_Error",gaEventAction:"modal register failed"},R,j)),E(o),(null===(l=o.response)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:null===(i=a.message)||void 0===i?void 0:i.toLowerCase())==="validation failed")throw Error(h.raw("error_signup-form_validation-error"));throw Error(h.raw("error_signup-form_unknown-error"));case 5:return[2]}})}),function(e){return a.apply(this,arguments)}),V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};S&&k("userCredentials",eE(eP({},e),{action:"register"}))};return(0,r.tZ)(ey,eE(eP({"data-test-id":"hf-auth-signup-form"},b),{onSubmit:C.onSubmit(U),children:d(eE(eP({},C),{success:A}))}))};function ex(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}eC.defaultProps={trackingMetadata:{},subscribeToAbandonment:!1,subscribeToNewsletter:!1,shouldVerifyEmail:!1,shouldSubmitVerifiedEmail:!1};var eZ=function(e){var t,n=e.defaultUsername,a=void 0===n?"":n,u=e.enableRememberCredentials,c=void 0===u||u,s=e.enableNavigation,d=void 0!==s&&s,f=e.shouldVerifyEmail,p=void 0!==f&&f,g=e.trackingMetadata,b=e.enableAutoFocus,y=void 0!==b&&b,m=e.disableEmailFieldEdit,v=void 0!==m&&m,h=e.shouldSubmitVerifiedEmail,w=e.onCh
1angeRememberCredentials,O=void 0===w?function(){}:w,S=e.onSuccess,k=e.onFail,_=e.onSubmit,P=e.onClickWarning,E=void 0===P?function(){}:P,j=e.onNavigationClick,C=void 0===j?function(){}:j,x=e.isRememberCredentialsChecked,A=e.onEmailChange,L=void 0===A?function(){}:A,I=e.emailLabel,R=e.onEmailFieldClick,M=e.passwordLabel,T=e.submitButtonLabel,W=function(e){var t,n,r,o=e.target.checked?"on":"off";er({event_name:"Login_RememberMeClick",gaEventLabel:o,remember_me:o,gaEventAction:"remember_me clicked"}),en({isChecked:e.target.checked,wasPreChecked:!!ei,loginType:F.Bz.Register,uiComponentLabel:(null===(r=e.target.labels)||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:null===(t=n.textContent)||void 0===t?void 0:t.trim())||null}),O(e),ea(function(e){return!e})},G=(0,l.ZP)("frontend-auth").translateRaw,H=(0,Z.z)("frontend-auth").data,K=(0,Z.z)("website").data,J=(0,q.a)(null==H?void 0:H.translations),X=null==K?void 0:K.isMaterialDesignEnabled,$=(0,U.Z)(),Y="LU"===$||"FR"===$||"BE"===$||"NL"===$,ee=(0,D.Z)().push,et=(0,B.ew)(),en=(0,z.D)().trackKeepMeSignedClick,er=(0,o.useCallback)(function(e){ee(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({environment:et,event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",gaEventCategory:"login"},e))},[et,ee]),eo=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(void 0===x||x))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ex(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ex(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),ei=eo[0],ea=eo[1];return(0,r.tZ)(eC,{onSuccess:void 0===S?function(){}:S,onFail:void 0===k?function(){}:k,onSubmit:void 0===_?function(){}:_,"data-test-id":"hf-signup-email-password-form",trackingMetadata:void 0===g?{}:g,shouldVerifyEmail:p,shouldSubmitVerifiedEmail:void 0!==h&&h,children:function(e){var t=e.registerField,n=e.hasError,o=e.errorMessage,l=e.hasWarning,u=e.warningMessage,s=e.triggerWarning,f=e.warningClickCallback,g=e.isSubmitting,b=e.success;return(0,r.BX)(r.HY,{children:[l&&(0,r.tZ)(i.xu,{mb:["sm-2","md-1"],children:(0,r.tZ)(V,{warningMessage:u,"data-test-id":"hf-signup-email-password-form-warning-message",onClickWarning:f.current||E})}),n&&(0,r.tZ)(i.xu,{mb:["sm-2","md-1"],children:(0,r.tZ)(V,{warningMessage:o,"data-test-id":"hf-signup-email-password-form-error-message"})}),(0,r.tZ)(i.xu,{mb:[X?"md-2":"sm-2","md-1"],children:(0,r.tZ)(es,{name:"username",ref:t,required:!0,disabled:g||b,onWarning:s,defaultValue:a,unregisteredWarnEnabled:!1,registeredErrorEnabled:!0,enableNavigation:d,onNavigationClick:C,onEmailChange:L,shouldVerifyEmail:p,autoFocus:y&&!a,autoComplete:"email",label:I,readOnly:v,onFieldClick:R})}),(0,r.tZ)(i.xu,{mb:[X?"md-2":"sm-2","md-1"],children:(0,r.tZ)(Q,{name:"password",ref:t,disablePasswordLengthValidation:!1,required:!0,disabled:g||b,autoFocus:y&&a,autoComplete:"new-password",tip:J.get("text_signup-email-password-form_password-tip"),label:M,validations:[]})}),c&&(0,r.tZ)(i.xu,{flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"left",textAlign:"left",mt:"xs",children:(0,r.tZ)(i.XZ,{"data-test-id":"hf-signup-email-password-form-remember-credentials-checkbox",name:"remember-credentials",id:"remember-credentials",checked:ei,label:J.get("text_remember-credentials_label"),onChange:W,ref:t()})}),(0,r.tZ)(i.xu,{justifyContent:"center",display:"flex",mt:["md-1","md-1","md-2"],children:(0,r.tZ)(i.zx.Primary,{type:"submit",disabled:g||b,"data-test-id":"hf-signup-email-password-form-submit-button",children:null!=T?T:J.get("text_signup-email-password-form_button-label")})}),Y&&(0,r.tZ)(i.xu,{pt:"sm-2",textAlign:"center","data-test-id":"hf-signup-email-password-form-privacy-notice",children:(0,r.tZ)(i.xv,{type:"body-xs-regular",children:(0,r.tZ)(N.Z,{markdownOptions:{forceInline:!0,overrides:{a:{props:{target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}}}}},copy:G("frontend-auth.signup.privacy-notice"),hasMarkdown:!0})})})]})}})},eA=n(942706),eL="gaEventTrigger",eI="CLICK",eR="SUBMIT",eM="BACK",eT="SUCCESS",eD="FAILURE",eB="LINK",eF="login",ez="register",eN="forgot",eU="passwordless_reset",eq={event:eL,gaEventCategory:"login",gaEventLabel:"registration"},eV={event:eL,brand:"HelloFresh",tribe:"Conversions Journey",screen:"Register",event_name:"Login_SuccessOnRegisterPage",gaEventCategory:"login",gaEventAction:"loginOnRegisterPage",gaEventNonInteraction:!1},eW={event:eL,gaEventLabel:"",gaEventNonInteraction:!1};function eG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function eH(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var eK=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";switch(e){case eI:return"".concat(n," ").concat(t," clicked");case"INVALID":return"".concat(n," ").concat(t," invalid");case eR:return"".concat(n," ").concat(t," submit");case eM:return"".concat(n," ").concat(t," back");case eT:return"".concat(n," ").concat(t," success");case eD:return"".concat(n," ").concat(t," failed");case eB:return"".concat(n," ").concat(t," link clicked");default:return!1}},eJ=function(e,t,n,r,o){return(0,eA.c)(eH(eG(eH(eG({},eq),{gaEventAction:eK(e,t,n).trim(),brand:"HelloFresh",tribe:"Conversions Journey"}),o?{screen:o}:{screen:"Register"}),{event_name:r}))},eX=function(e){var t=e.label;return(0,eA.c)(eH(eG({},eV),{result:t,gaEventLabel:t}))},e$=function(e){var t=e.action,n=e.category;return(0,eA.c)(eH(eG({},eW),{gaEventCategory:n,gaEventAction:t}))},eY=function(e){return(0,eA.c)(eH(eG({},eq),{event_name:"Signup_LeadSubmit",gaEventAction:eK(e).trim(),gaEventCategory:"lead gen",gaEventLabel:"registration"}))},eQ="modal";eJ(eM,eF,eQ),eJ(eI,eF,eQ),eJ(eT,eF,eQ),eJ(eD,eF,eQ),eJ(eB,eF,eQ),e$({action:"Click submit 1st step",category:"login"}),e$({action:"1st step completed",category:"login"});var e0=eJ(eM,ez,eQ,"Signup_Back"),e1=eJ(eB,ez,eQ,"Signup_LinkClick","Login");eX({label:"emailSubmit"}),eX({label:"successfulLogin"}),eX({label:"failedLogin"}),eJ(eI,eN,eQ);var e2=eJ(eM,eN,eQ);eJ(eT,eN,eQ),eJ(eB,eN,eQ),eY(eR),eY(eT),eJ(eI,eU,eQ),eJ(eT,eU,eQ),eJ(eD,eU,eQ),eJ(eM,eU,eQ),eJ(eI,"passwordless_sent",eQ);var e3=n(718583),e5=function(e){var t=e.origin,n=(0,o.useMemo)(function(){return C().get("hf_origin_metadata")},[]),r=(0,o.useMemo)(function(){return e3.ZP.getItem("StoredCouponCode")},[]),i={};"string"==typeof n&&(i=JSON.parse(n));var a="";return void 0!==r&&(a=r||""),{origin:void 0===t?"website-registered":t,source:"utm_source"in i?i.utm_source:"",medium:"utm_medium"in i?i.utm_medium:"",campaign:"utm_campaign"in i?i.utm_campaign:"",content:"utm_content"in i?i.utm_content:"",term:"utm_term"in i?i.utm_term:"",jtbd:"jtbd"in i?i.jtbd:"",path:window.location?window.location.pathname:"",voucher:a,timestamp:"".concat(new Date().toISOString().slice(0,-5),"Z")}},e4=n(364740),e8=n(85245),e6=n(121630),e7=function(){try{if(!(0,e6.FY)((0,e6.f4)()))return;var e=e8.b.janusEvent();(0,e4.i$)({event:{schema:e.event.schema,data:e.event.data},context:e.entities.map(function(e){return{schema:e.schema,data:e.data}})})}catch(e){(0,v.Tb)(e,{tags:{event:"Registration_Back_Step_Button_Click",component:"trackRegistrationBackStepButtonClickSnowplowEvent"}})}},e9=n(375002),te=function(){var e=(0,O.L3)().trackJanusEvent;return{trackLoginBackStep:(0,o.useCallback)(function(){try{e(e9.F.janusEvent())}catch(e){(0,v.Tb)(e,{tags:{event:"Login_Back_Step_Button_Click",component:"useLoginBackStepSnowplowEvent"}})}},[e])}};function tt(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}var tn=function(e){var t,n,a,u,c=(0,M.Z)(),s=(0,M.Z)({runUsingStatsig:!0}),d=(0,o.useRef)(!0),f=(0,l.ZP)("funnel"),p=f.translate,g=f.translateRaw,b=(0,Z.z)("website").data,y=(0,k.D)().dispatch,v=e5({origin:"website-registered"}),h=null==b?void 0:null===(a=b.checkout)||void 0===a?void 0:a.selectShouldVerifyEmailWithKickBox,w=(0,D.Z)().push,O=te().trackLoginBackStep,_=(0,L.T)(),P=(0,m.l)(),E=function(e){e.preventDefault(),w(e0),O(),e7(),y({type:S.qB,payload:{step:S.gw}})},j=(t=function(e){var t,n,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){return u.setAttributes({loginSuccessFromSignupForm:!0}).end(),c("".concat(null===(t=e.user_data)||void 0===t?void 0:t.user_id)),s((null===(n=e.user_data)||void 0===n?void 0:n.id)||""),(0,T.JS)(e),y({type:S.uy,payload:{customerID:"".concat(null===(r=e.user_data)||void 0===r?void 0:r.user_id)}}),C(),[2]})},n=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){tt(i,r,o,a,l,"next",e)}function l(e){tt(i,r,o,a,l,"throw",e)}a(void 0)})},function(e){return n.apply(this,arguments)}),C=function(){try{P.setItem("isLoginRegisterFlowComplete","true"),P.setItem("hf_signup_redirect_to_plans","true")}catch(e){}};return(0,r.BX)(o.Fragment,{children:[(0,r.tZ)(eZ,{defaultUsername:e.email,enableAutoFocus:!0,enableNavigation:!0,onChangeRememberCredentials:function(e){d.current=!!e.target.checked},isRememberCredentialsChecked:e.isRememberCredentialsChecked,onEmailChange:e.onChangeEmail,onNavigationClick:E,onSuccess:j,onFail:function(e){var t;u.setStatus({code:A.Z.ERROR,message:e.message}),(null===(t=e.response)||void 0===t?void 0:t.data)&&u.setAttribute("auth_response",JSON.stringify(e.response.data)),u.end(),R({exception:e,errorMessage:"Error signup with email",operation:"email-signup-cta"})},onSubmit:function(){u=_.startSpan("email-password-signup")},shouldVerifyEmail:h,trackingMetadata:v,passwordLabel:g("funnel.register.createAccount.password.label")}),(0,r.tZ)(i.xu,{textAlign:"center",m:"sm-2",children:(0,r.tZ)(i.rU,{color:"primary.600","data-test-id":"registerGoBack",onClick:E,href:"/login",children:p("funnel.register.goBack")})})]})},tr=n(144158),to=n(380565);function ti(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function ta(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ti(i,r,o,a,l,"next",e)}function l(e){ti(i,r,o,a,l,"throw",e)}a(void 0)})}}function tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function tu(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var tc=function(e){var t,n,i=e.onSuccess,a=e.onFail,l=e.onSubmit,u=e.children,c=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onSuccess","onFail","onSubmit","children"]),s=(0,er.Z)(),d=(0,en.O)(),f=d.locale,p=d.systemCountry,g=(0,Z.z)("frontend-auth").data,b=(0,q.a)(null==g?void 0:g.translations),y=(0,et.Z)(),m=(0,ed.Z)(),v=(0,D.Z)().push,h=(0,B.ew)(),w=(0,tr.v)().trackForgotPasswordCl
1ick,O=(0,to.g)().trackForgotPasswordVerification,S=(0,em.py)({runUsingStatsig:!0}).track,k=(0,ev.O)(),_=k.id,P=k.attributes,E=(0,o.useCallback)(function(e){v(tl({environment:h,event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",gaEventLabel:"registration",gaEventCategory:"login",gaEventInteraction:!1},e))},[h,v]);function j(){return(j=ta(function(e){var t;return tu(this,function(n){switch(n.label){case 0:return t="/auth/passwords/recover",[4,y.post(t,{email:e},{params:{country:p,locale:f},headers:{Authorization:"".concat(s.token_type," ").concat(s.access_token)}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}function C(){return(C=ta(function(e){var t,n,r;return tu(this,function(o){switch(o.label){case 0:t=e.email,"function"==typeof l&&l(),E({event_name:"Login_ForgotPasswordClick",gaEventAction:"modal forgot clicked"}),w(),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,function(e){return j.apply(this,arguments)}(t)];case 2:return o.sent(),E({event_name:"Login_ForgotPasswordSuccess",gaEventAction:"modal forgot success"}),O({email:t}),S({eventName:"Login_Success",experimentationUserId:_,experimentationUserAttributes:P,eventTags:{event_name:"Login_Success",EventCategory:"login",EventAction:"passwordReset",EventLabel:"loginPage"}}),"function"==typeof i&&i(),[3,4];case 3:if((null===(r=(n=o.sent()).response)||void 0===r?void 0:r.status)===404)return"function"==typeof i&&i(),[2];throw E({event_name:"Login_ForgotPasswordError",gaEventAction:"modal forgot failed"}),"function"==typeof a&&a(n),Error(b.raw("error_forgot-password-form_unknown-error"));case 4:return[2]}})})).apply(this,arguments)}return(0,r.tZ)(ey,(t=tl({"data-test-id":"hf-auth-forgot-password-form"},c),n=n={onSubmit:m.onSubmit(function(e){return C.apply(this,arguments)}),children:u(m)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))};function ts(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var td=function(e){var t,n=e.defaultEmail,a=void 0===n?"":n,l=e.enableNavigation,u=void 0!==l&&l,c=e.enableAutoFocus,s=void 0!==c&&c,d=e.disableEmailFieldEdit,f=void 0!==d&&d,p=e.onSuccess,g=void 0===p?function(){}:p,b=e.onFail,y=e.onSubmit,m=e.onEmailChange,v=void 0===m?function(){}:m,h=e.onNavigationClick,w=void 0===h?function(){}:h,O=e.onFieldClick,S=void 0===O?function(){}:O,k=function(e){e.preventDefault(),R({event_name:"Login_ForgotPasswordBack",gaEventAction:"modal forgot back"}),w(e)},_=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ts(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ts(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),P=_[0],E=_[1],j=(0,Z.z)("frontend-auth").data,C=(0,q.a)(null==j?void 0:j.translations),x=(0,Z.z)("website").data,A=null==x?void 0:x.isMaterialDesignEnabled,L=(0,D.Z)().push,I=(0,B.ew)(),R=(0,o.useCallback)(function(e){L(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({environment:I,event:"gaEventTrigger",brand:"HelloFresh",screen:"Login",tribe:"Conversions Journey",gaEventLabel:"registration",gaEventCategory:"login",gaEventInteraction:!1},e))},[I,L]);return(0,r.tZ)(tc,{onSubmit:void 0===y?function(){}:y,onSuccess:function(){E(!0),"function"==typeof g&&g({successMessage:{text:C.raw("message_forgot-password-email-form_success-message"),translationId:"message_forgot-password-email-form_success-message"}})},onFail:void 0===b?function(){}:b,children:function(e){var t=e.registerField,n=e.isSubmitting,o=e.hasError,l=e.errorMessage;return(0,r.BX)(r.HY,{children:[o&&(0,r.tZ)(i.xu,{mb:["sm-2","md-1"],children:(0,r.tZ)(V,{warningMessage:l,"data-test-id":"hf-forgot-password-email-form-error-message"})}),(0,r.tZ)(i.xu,{mb:[A?"md-2":"sm-2","md-1"],children:(0,r.tZ)(es,{name:"email",label:null,ref:t,required:!0,disabled:n||P,defaultValue:a,enableNavigation:u,onNavigationClick:k,readOnly:f,onFieldClick:S,onEmailChange:v,autoFocus:s&&!a,autoComplete:"email"})}),(0,r.tZ)(i.xu,{justifyContent:"center",display:"flex",mt:["md-1","md-1","md-2"],children:(0,r.tZ)(i.zx.Primary,{type:"submit",disabled:n||P,"data-test-id":"hf-forgot-password-email-form-submit-button",children:C.get("text_forgot-password-email-form_button-label")})})]})}})};function tf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var tp=function(e,t){e({type:S.qB,payload:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({step:S.gw},t&&t)})}
1,tg=function(e){var t,n,a=e.email,u=e.renderSubheader,c=e.onChangeEmail,s=(0,D.Z)().push,d=(0,L.T)(),f=(0,l.ZP)("funnel").translateRaw,p=(0,k.D)(),g=p.dispatch,b=p.state,y=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return tf(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tf(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=y[0],v=y[1];(0,o.useEffect)(function(){m&&tp(g,{hasPasswordBeenReset:!0})},[m,g,b]);var h=function(e){e.preventDefault(),g({type:S.fR,payload:{}}),s(e2),tp(g)};return(0,r.BX)(o.Fragment,{children:[u(),(0,r.tZ)(td,{onSuccess:function(){n.end(),s(e2),v(!0)},onFail:function(e){R({exception:e,errorMessage:"Error reset password"}),n.setStatus({code:A.Z.ERROR,message:e.message}),n.end()},onSubmit:function(){n=d.startSpan("forgot-password")},defaultEmail:a,enableNavigation:!0,onNavigationClick:h,onEmailChange:c,enableAutoFocus:!0}),(0,r.tZ)(i.xu,{paddingTop:["sm-2"],textAlign:"center",children:(0,r.tZ)(i.rU,{href:"/login",color:"primary.600",textDecorationLine:"underline",onClick:h,tabIndex:0,"data-test-id":"registerGoBack",children:f("funnel.register.goBack")})})]})},tb=n(463662),ty=n(206175),tm=n(871961),tv=n(158256),th=function(e){var t,n,r,o,i,a,l;return"string"==typeof e?e:"string"==typeof e.error?e.error:(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&((null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.error_code)||(null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:r.message)||(null==e?void 0:e.statusCode)||(null==e?void 0:e.status)||(null==e?void 0:e.message)||(null==e?void 0:null===(i=e.error)||void 0===i?void 0:i.statusCode)||(null==e?void 0:null===(a=e.error)||void 0===a?void 0:a.status)||(null==e?void 0:null===(l=e.error)||void 0===l?void 0:l.message))||"unknown error"},tw=n(575182),tO=n(711031),tS=n(759623),tk=n(373124),t_=n(573634),tP=n(241636);function tE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tj(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function tC(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){tj(i,r,o,a,l,"next",e)}function l(e){tj(i,r,o,a,l,"throw",e)}a(void 0)})}}function tx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function tZ(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function tA(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var tL=function(e){var t,n,i,a,u=e.onSubmit,c=e.onSuccess,s=e.onFail,d=e.children,f=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onSubmit","onSuccess","onFail","children"]),p=(0,en.O)(),g=p.locale,b=p.systemCountry,y=(0,Z.z)("frontend-auth").data,m=(0,q.a)(null==y?void 0:y.translations),v=(0,l.ZP)("funnel.login").translateRaw,h=(0,et.Z)(),w=(0,eb.G)(),S=(0,ef.Z)().dispatchCustomEvent,k=(0,D.Z)().push,_=(0,O.a8)().track,P=(0,tO.M)().trackSnowplowLoginError,E=(0,tb.usePathname)(),j=(0,B.ew)(),C=(0,o.useCallback)(function(e){k(tx({environment:j,event:"gaEventTrigger",gaEventLabel:"registration",gaEventCategory:"login",gaEventInteraction:!1,brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",login_method:"email"},e))},[j,k]),x=(0,ed.Z)(),A=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return tE(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tE(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),L=A[0],I=A[1],R=(0,em.py)({runUsingStatsig:!0}).track,M=(0,ev.O)(),T=M.id,F=M.attributes,z=(0,tS.Oq)().trackLoginButtonClick,N=(0,tk.O)().trackLoginSubmit,U=(0,t_.d)().trackLoginLoginSuccess,V=(null===(a=w.mobileWebView)||void 0===a?void 0:a.active)?"app":"loginPage",W="/login",G=(0,tm.d)(tv.nK.standaloneHighRiskModal).openModal,H=(n=tC(function(e){var t,n;return tA(this,function(r){switch(r.label){case 0:return t=e.username,n=e.password,[4,h.post(W,{username:t,password:n},{params:{country:b,locale:g}})];case 1:return[2,r.sent()]}})}),function(e){return n.apply(this,arguments)}),K=(i=tC(function(e){var t,n,r,o,i,a,l,d,f,p,g,b,y,h;return tA(this,function(w){switch(w.label){case 0:t=e.username,n=e.password,"function"==typeof u&&u(),C({event_name:"Login_ButtonClick",gaEventAction:"modal login clicked"}),z({loginMethod:tP.pL.Email,loginType:tP.Bz.Login,email:t,uiComponentName:"LoginButton",uiComponentLabel:"Log in"}),N({loginMethod:tP.pL.Email,loginType:tP.Bz.Login,email:t,uiComponentName:"LoginButton",uiComponentLabel:"Log in"}),w.label=1;case 1:return w.trys.push([1,3,,4]),[4,H({username:t,password:n})];case 2:return o=(r=w.sent()).data,i=r.status,a=r.statusText,I(!0),J(o),_((0,tw.$gb)({login_method:"email",page_of_login:E}),{action:"Login Success",action_type:"system_message",is_ecommerce:!1}),C({event_name:"Login_Success",gaEventAction:"modal login success",gaEventLabel:"Post ".concat(W," --> {create customer} {").concat(i," ").concat(a,"}")}),U({loginMethod:tP.pL.Email,loginType:tP.Bz.Login,systemMessage:"successfulLogin"}),R({eventName:"Login_Success",experimentationUserId:T,experimentationUserAttributes:F,eventTags:{event_name:"Login_Success",EventCategory:"login",EventAction:"password",EventLabel:V}}),"function"==typeof c&&c(o),[3,4];case 3:if(b=l=w.sent(),"function"==typeof s&&s(b),(0,ty.fs)(b))return G({email:t}),[2];if(C({event_name:"Login_Failed",gaEventAction:"modal login failed",gaEventLabel:"".concat(th(l))}),(null===(f=l.response)||void 0===f?void 0:null===(d=f.data)||void 0===d?void 0:d.error)==="access_denied")throw P(y=m.raw("error_signin-form_invalid-credentials")),Error(y);if((null===(g=l.response)||void 0===g?void 0:null===(p=g.data)||void 0===p?void 0:p.error)==="access_denied_password_must_be_rotated")throw P("Your password is expired. Follow the instructions sent to your email inbox to update it."),Error(v("funnel.login.password.expired"));throw P(h=m.raw("error_signin-form_unknown-error")),Error(h);case 4:return[2]}})}),function(e){return i.apply(this,arguments)}),J=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w.mobileWebView.active&&S("userCredentials",tZ(tx({},e),{action:"login"}))};return(0,r.tZ)(ey,tZ(tx({"data-test-id":"hf-auth-signin-form"},f),{onSubmit:x.onSubmit(K),children:d(tZ(tx({},x),{success:L}))}))},tI=n(958352),tR=function(e){var t=e.email,n=(0,D.Z)().push,o=(0,k.D)().dispatch,a=(0,l.ZP)("funnel").translate,u=function(){n({event:"gaEventTrigger",event_name:"Login_PasswordLessLoginClick",brand:"HelloFresh",tribe:"Conversions",screen:"Login",event_category:"Login",event_action:"PasswordLessLoginClick",event_label:"[button_type]",button_type:"[wrong-pass]"}),o({type:S.qB,payload:{step:S.JN,email:t}})};return(0,r.tZ)(i.xu,{p:"global.xxs",children:(0,r.BX)(i.xv,{error:!0,type:"body-sm-regular",children:[a("funnel.login.passwordless.login.error.prefix")," ",(0,r.tZ)(i.xu,{as:"span",onClick:u,onKeyDown:function(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),u())},tabIndex:0,cursor:"pointer",role:"button",children:(0,r.tZ)(i.xv,{error:!0,type:"body-sm-regular",strong:!0,textDecoration:"underline",children:a("funnel.login.passwordless.login.error.cta")})})]})})},tM=function(e){var t,n=e.isRememberCredentialsChecked,l=e.handleIsRememberMeCredentialsClick,u=e.handleForgetPasswordPathClick,c=e.registerField,s=e.hasError,d=e.errorMessage,f=e.hasWarning,p=e.warningMessage,g=e.triggerWarning,b=e.isSubmitting,y=e.success,m=e.disableEmailField,v=e.disablePasswordField,h=(0,Z.z)("frontend-auth").data,w=(0,Z.z)("website").data,O=(0,q.a)(null==h?void 0:h.translations),S=null==w?void 0:w.isMaterialDesignEnabled,k=(0,a.zv)(),_=s&&"It seems your password is invali
1d, please review and try again."===d;return(0,r.BX)(o.Fragment,{children:[f&&(0,r.tZ)(i.xu,{mb:[S?"md-2":"sm-2","md-1"],children:(0,r.tZ)(V,{onClickWarning:e.onClickWarning,warningMessage:p,"data-test-id":"hf-login-email-password-form-warning-message"})}),!_&&(0,r.tZ)(i.xu,{mb:[S?"md-2":"sm-2","md-1"],children:(0,r.tZ)(V,{warningMessage:d,"data-test-id":"hf-login-email-password-form-error-message"})}),(0,r.tZ)(i.xu,{mb:[S?"md-2":"sm-2","md-1"],children:(0,r.tZ)(es,{name:"username",ref:c,required:!0,disabled:b||y||m,onWarning:g,defaultValue:e.defaultUsername,unregisteredWarnEnabled:!0,registeredErrorEnabled:!1,onEmailChange:e.onEmailChange,onEmailStatusResolved:e.onEmailStatusResolved,autoFocus:e.enableAutoFocus&&!e.defaultUsername,autoComplete:"email",label:e.emailLabel,enableNavigation:e.enableNavigation,onNavigationClick:e.onNavigationClick,readOnly:e.disableEmailFieldEdit,onFieldClick:e.onEmailFieldClick,placeholder:e.emailPlaceholder})}),(0,r.tZ)(i.xu,{mb:"sm",children:(0,r.tZ)(Q,{name:"password",ref:c,disablePasswordLengthValidation:!0,required:!0,disabled:b||y||v,autoFocus:e.enableAutoFocus&&e.defaultUsername,autoComplete:"current-password",label:e.passwordLabel,placeholder:e.passwordPlaceholder,borderColor:_&&"error.500"})}),_&&(0,r.tZ)(tR,{email:e.defaultUsername}),(e.enableRememberCredentials||e.enableForgetPassword)&&(0,r.BX)(i.xu,{flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",mt:"md-1",gap:"sm",children:[e.enableRememberCredentials&&(0,r.tZ)(i.XZ,{"data-test-id":"hf-login-email-password-form-remember-credentials-checkbox",name:"remember-credentials",id:"remember-credentials",checked:n,label:O.raw("text_remember-credentials_label"),onChange:l,ref:c()}),(0,r.tZ)(i.xu,{flexShrink:0,textAlign:"right",minHeight:"1.5rem",children:e.enableForgetPassword&&(0,r.tZ)(i.rU,{__dangerouslySetCustomCSS:{paddingTop:"0.5rem",paddingBottom:"0.5rem",paddingLeft:"1rem",paddingRight:"1rem",minHeight:"1.5rem",display:"inline-flex",alignItems:"center"},color:"primary.600",tabIndex:0,href:e.forgetPasswordPath,onClick:u,"data-test-id":"hf-login-email-password-form-forget-password-link",type:k?"body-sm-bold":"body-sm-regular",children:O.get("text_forget-password_label")})})]}),(0,r.tZ)(i.xu,{justifyContent:"center",display:"flex",mt:["md-1","md-1","md-2"],children:(0,r.tZ)(i.zx.Primary,{type:"submit",disabled:b||y,"data-test-id":"hf-login-email-password-form-submit-button",children:null!==(t=e.submitButtonLabel)&&void 0!==t?t:O.get("text_login-email-password-form_button-label")})})]})};function tT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var tB=function(e){var t,n=(0,D.Z)().push,i=(0,B.ew)(),a=(0,tI.s)().trackRecoverPasswordClick,l=(0,z.D)().trackKeepMeSignedClick,u=(0,o.useCallback)(function(e){n(tD({environment:i,event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",gaEventCategory:"login"},e))},[i,n]),c=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(e.isRememberCredentialsChecked))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return tT(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tT(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=c[0],d=c[1],f=function(t){var n,r,o,i=t.target.checked?"on":"off";u({event_name:"Login_RememberMeClick",gaEventLabel:i,remember_me:i,gaEventAction:"remember_me clicked"}),l({isChecked:t.target.checked,wasPreChecked:!!s,loginType:F.Bz.Login,uiComponentLabel:(null===(o=t.target.labels)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:null===(n=r.textContent)||void 0===n?void 0:n.trim())||null}),e.onChangeRememberCredentials(t),d(function(e){return!e})},p=function(t){u({event_name:"Login_ForgotPasswordLinkClick",gaEventLabel:"registration",gaEventCategory:"login",gaEventAction:"modal forgot link clicked",gaEventNonInteraction:!1}),a(),e.onClickForgetPassword(t)};return(0,r.tZ)(tL,{onSuccess:e.onSuccess,onFail:e.onFail,onSubmit:e.onSubmit,"data-test-id":"hf-login-email-password-form",children:function(t){var n,o,i=t.registerField,a=t.hasError,l=t.errorMessage,u=t.hasWarning,c=t.warningMessage,d=t.triggerWarning,g=t.isSubmitting,b=t.success;return(0,r.tZ)(tM,(n=tD({},e),o=o={isRememberCredentialsChecked:s,handleIsRememberMeCredentialsClick:f,handleForgetPasswordPathClick:p,registerField:i,hasError:a,errorMessage:l,hasWarning:u,warningMessage:c,triggerWarning:d,isSubmitting:g,success:b},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}})};tB.defaultProps={defaultUsername:"",emailPlaceholder:"",passwordPlaceholder:"",enableRememberCredentials:!0,isRememberCredentialsChecked:!0,onChangeRememberCredentials:function(){},onEmailStatusResolved:function(){},enableForgetPassword:!0,forgetPasswordPath:"",enableAutoFocus:!1,disableEmailFieldEdit:!1,disableEmailField:!1,disablePasswordField:!1};var tF=n(723615),tz=n.n(tF),tN=n(468891),tU=n(373475),tq=function(e){var t=e.size;return(0,r.tZ)("svg",{width:t,height:t,viewBox:"0 0 60.734 60.733",fill:"white",children:(0,r.tZ)("path",{d:"M57.378.001H3.352A3.352 3.352 0 000 3.353v54.026a3.353 3.353 0 003.352 3.354h29.086V37.214h-7.914v-9.167h7.914v-6.76c0-7.843 4.789-12.116 11.787-12.116 3.355 0 6.232.251 7.071.36v8.198l-4.854.002c-3.805 0-4.539 1.809-4.539 4.462v5.851h9.078l-1.187 9.166h-7.892v23.52h15.475a3.355 3.355 0 003.355-3.351V3.351a3.352 3.352 0 00-3.354-3.35z"})})},tV=function(e){var t=e.size;return(0,r.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:t,width:t,children:(0,r.tZ)("g",{fill:"none",fillRule:"evenodd",children:(0,r.tZ)("path",{d:"M9.255 22c1.245 0 1.798-.826 3.353-.826 1.58 0 1.927.8 3.315.8 1.362 0 2.273-1.246 3.135-2.466.964-1.399 1.361-2.772 1.388-2.835-.09-.026-2.699-1.081-2.699-4.044 0-2.568 2.057-3.725 2.171-3.814-1.361-1.933-3.43-1.983-3.995-1.983-1.53 0-2.775.914-3.559.914-.849 0-1.966-.864-3.289-.864C6.556 6.882 4 8.942 4 12.832c0 2.416.951 4.972 2.12 6.625C7.122 20.856 7.995 22 9.255 22m3.212-15.384c.912 0 2.055-.61 2.737-1.424.616-.738 1.066-1.768 1.066-2.797 0-.14-.013-.28-.038-.395-1.016.038-2.236.674-2.968 1.525-.579.649-1.106 1.667-1.106 2.709 0 .152.026.305.039.355.064.014.167.027.27.027",fill:"currentColor"})})})},tW=[{prop:"socialMedia",variants:{facebook:{backgroundColor:"social.600",":hover":{cursor:"pointer",bg:"social.500"},":active":{bg:"social.400"},":disabled":{pointerEvents:"none",opacity:".4"}},google:{backgroundColor:"social.100",borderColor:"primary.600",borderStyle:"solid",":hover":{cursor:"pointer",bg:"social.200"},":active":{bg:"social.300"},":disabled":{pointerEvents:"none",opacity:".4"}},apple:{backgroundColor:"social.700",height:"40px",borderWidth:0,":hover":{backgroundColor:"social.700",cursor:"pointer"},":active":{bg:"social.800"},":disabled":{pointerEvents:"none",opacity:".4"}}}}];function tG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var tH=function(e){var t,n,o=e.onClick,a=e.disabled,l=e.label,u=e.buttonId,c=e.leadingIcon,s=e.trailingIcon,d=e.pseudo,f=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onClick","disabled","label","buttonId","leadingIcon","trailingIcon","pseudo"]);return(0,r.BX)(i.xu,(t=tG({},f),n=n={as:"button",variants:tW,"data-test-id":u,onClick:o,disabled:a,pseudo:tG({},d),color:"neutral.100",lineHeight:"line-height-md-2",borderRadius:"border-radius-sm",borderWidth:"0",position:"relative",display:"flex",alignItems:"center",height:"40px",px:"sm-1",width:"100%",justifyContent:"space-between",children:[!c&&(0,r.tZ)(i.xu,{}),c&&(0,r.tZ)(i.xu,{display:"flex",alignItems:"center","data-component":"leadingIcon",children:c}),(0,r.tZ)(i.xv,{as:"span",type:"body-md-regular",children:l}),s&&(0,r.tZ)(i.xu,{display:"flex",alignItems:"center","data-component":"trailingIcon",children:s}),!s&&(0,r.tZ)(i.xu,{})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},tK=n(698052),tJ=n.n(tK),tX=n(514763),t$=function(){var e=(0,O.L3)().trackJanusEvent;return{trackLoginSelectAccountLinkClick:(0,o.useCallback)(function(){try{e(tX.K.janusEvent())}catch(e){(0,v.Tb)(e,{tags:{event:"Login_Select_Account_Link_Click",component:"useLoginSelectAccountLinkSnowplowEvent"}})}},[e])}},tY=function(e){var t=e.errorMessage,n=e.dataTestId,a=e.socialMedia,l=(0,Z.z)("frontend-auth").data,u=(0,q.a)(null==l?void 0:l.translations),c=u.get("error-message_".concat(a,"_error")),s=(0,k.D)().dispatch,d=(0,D.Z)().push,f=t$().trackLoginSelectAccountLinkClick,p=(0,o.useCallback)(function(e){e.preventDefault(),d(e1),f(),s({type:S.qB,payload:{step:S.hm}})},[s,d,f]),g=(0,o.useMemo)(function(){return"SOCIAL_LOGIN_ACCOUNT_ASSOCIATION_NOT_ALLOWED_UNAUTHENTICATED_USER"===t?u.component("error-message_account_association_not_allowed",{socialMedia:(0,r.tZ)("span",{children:tJ()(a)},"social-media"),signUpLink:(0,r.tZ)(i.rU,{"data-test-id":"".concat(n,"-link"),onClick:p,href:"/login",customColor:"inherit",hoverColor:"inherit",activeColor:"inherit",children:u.get("text_auth-register-link")},"sign-up-link")}):c},[t,n,a,p,u,c]);return t?(0,r.tZ)("div",{"data-test-id":n,children:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"error.600",children:g||c})}):null};function tQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t0(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function t1(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){t0(i,r,o,a,l,"next",e)}function l(e){t0(i,r,o,a,l,"throw",e)}a(void 0)})}}function t2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tQ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t3(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var t5=function(e){var t=e.onSuccess,n=e.onFail,a=e.page,l=void 0===a?"login":a,u=e.customButton,c=function(e){return J.apply(this,arguments)},s=(0,en.O)().systemCountry,d=(0,Z.z)("frontend-auth").data,f=(0,q.a)(null==d?void 0:d.translations),p=(0,et.Z)(),g=t2((0,o.useState)(""),2),b=g[0],y=g[1],m=t2((0,o.useState)(!1),2),v=m[0],h=m[1],w=(0,eb.G)(),S=(0,tU.PX)(),k=S.login,_=S.injected,P=S.waitingOnFacebook,E=(0,D.Z)().push,j=(0,O.a8)().track,C=(0,tO.M)().trackSnowplowLoginError,x=(0,tb.usePathname)(),A=(0,B.ew)(),L=(0,M.Z)({runUsingStatsig:!0}),I=(0,em.py)({runUsingStatsig:!0}).track,R=(0,ev.O)(),T=R.id,F=R.attributes,z=(0,tS.Oq)().trackLoginButtonClick,N=(0,tk.O)().trackLoginSubmit,U=(0,t_.d)().trackLoginLoginSuccess,V=(0,o.useCallback)(function(e){E(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({environment:A,event:"gaEventTrigger",gaEventCategory:"login",gaEventLabel:"registration",gaEventNonInteraction:!1,brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",login_method:"facebook"},e))},[A,E]),W="/api/social/signup";function G(){return(G=t1(function(e){return t3(this,function(t){return[2,p.post(W,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})]})})).apply(this,arguments)}function H(){return(H=t1(function(e){return t3(this,function(t){return[2,p.post("/api/social/login",e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})]})})).apply(this,arguments)}function K(){return(K=t1(function(e){var t,n,r;return t3(this,function(o){switch(o.label){case 0:return[4,function(e){return G.apply(this,arguments)}(t=tN.stringify({"social_auth_data[user_id]":e.userID,"social_auth_data[access_token]":e.accessToken,social_provider_id:"facebook",grant_type:"social_login",country:s}))];case 1:return n=o.sent(),[4,function(e){return H.apply(this,arguments)}(t)];case 2:return r=o.sent(),[2,{signupResponse:n,signinResponse:r}]}})})).apply(this,arguments)}function J(){return(J=t1(function(e){var r,o,i,a,u,c,s,d,f,p,g,b;return t3(this,function(m){switch(m.label){case 0:if(e.preventDefault(),v)return[2];y(""),h(!0),r={scope:"email,public_profile",info_fields:"email,name"},V({event_name:"Login_ButtonClick",gaEventAction:"social facebook signup_login clicked"}),z({loginMethod:tP.pL.Facebook,loginType:"register"===l?tP.Bz.Register:tP.Bz.Login,uiComponentName:"FacebookLoginButton",uiComponentLabel:$||""}),"login"===l&&N({loginMethod:tP.pL.Facebook,loginType:tP.Bz.Login,uiComponentName:"FacebookLoginButton",uiComponentLabel:$||""}),I({eventName:"SocialLogin_ButtonClick",experimentationUserId:T,experimentationUserAttributes:F,eventTags:{event_name:"SocialLogin_ButtonClick",EventCategory:"registration",EventAction:"facebook",EventLabel:"register"===l?"registerPage":"loginPage"}}),m.label=1;case 1:return m.trys.push([1,4,,5]),[4,k(r)];case 2:if(a=m.sent().authResponse,w.mobileWebView.active)return h(!1),[2];return[4,function(e){return K.apply(this,arguments)}(a)];case 3:return c=(u=m.sent()).signinResponse.data,d=(s=u.signupResponse).status,f=s.statusText,h(!1),p=(null===(o=w.mobileWebView)||void 0===o?void 0:o.active)?"app":"register"===l?"registerPage":"loginPage",201===d&&I({eventName:"Successful_Register",experimentationUserId:T,experimentationUserAttributes:F,eventTags:{event_name:"Successful_Register",EventCategory:"registration",EventAction:"facebook",EventLabel:p}}),j((0,tw.$gb)({login_method:"facebook",page_of_login:x}),{action:"Facebook Login Success",action_type:"system_message",is_ecommerce:!1}),V({event_name:"Login_Success",gaEventAction:"social facebook signup_login success",gaEventLabel:"Post ".concat(W," -->
1 {create customer - social} {").concat(d," ").concat(f,"}")}),"login"===l&&U({loginMethod:tP.pL.Facebook,loginType:tP.Bz.Login,systemMessage:"Facebook Login Success"}),I({eventName:"Login_Success",experimentationUserId:T,experimentationUserAttributes:F,eventTags:{event_name:"Login_Success",EventCategory:"login",EventAction:"facebook",EventLabel:p}}),L((null==c?void 0:null===(i=c.user_data)||void 0===i?void 0:i.id)||""),t(c),[3,5];case 4:return y(b=th(g=m.sent())),h(!1),V({event_name:"Login_Failed",gaEventAction:"social facebook signup_login failed",gaEventLabel:b}),C("social facebook signup_login failed: ".concat(b)),n(g),[3,5];case 5:return[2]}})})).apply(this,arguments)}var X=!_||P,$=f.get("label_".concat(l,"_facebook_button")),Y=u?u({disabled:X,onClick:c,label:$}):(0,r.tZ)(tH,{disabled:X,onClick:c,label:(0,r.tZ)(i.xv,{type:"body-md-regular",aaa:!0,color:"neutral.100",children:$}),buttonId:"hf-facebook-button","data-test-id":"hf-facebook-button",leadingIcon:(0,r.tZ)(tq,{size:"24px"}),socialMedia:"facebook"});return(0,r.BX)("div",{"data-test-id":"hf-facebook-login",children:[Y,!!b&&(0,r.tZ)(tY,{errorMessage:b,dataTestId:"hf-facebook-login-error",socialMedia:"facebook"})]})};t5.propTypes={page:tz().oneOf(["login","register"]),onSuccess:tz().func.isRequired,onFail:tz().func.isRequired,customButton:tz().func};var t4=n(43011),t8="hf_prefill_email",t6="hf_socialLogin",t7=function(e){C().get(t6)||C().set(t6,"1",{expires:120}),(0,T.JS)(e)},t9=n(536150);function ne(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}var nt=function(e){var t,n,a=e.page,l=e.onFail,u=void 0===l?function(){}:l,c=(0,k.D)(),s=c.dispatch,d=c.state,f=(0,t4.Z)(),p=(0,t9.m)({},{enabled:!!f||"-1"!==d.customerID,suspense:!1}).data;(0,o.useEffect)(function(){f&&p&&s({type:S.uy,payload:{customerID:p.user_id}})},[f,p,s]);var g=(t=function(e){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(t){return t7(e),[2]})},n=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){ne(i,r,o,a,l,"next",e)}function l(e){ne(i,r,o,a,l,"throw",e)}a(void 0)})},function(e){return n.apply(this,arguments)});return(0,r.tZ)(i.xu,{mt:"sm-2",children:(0,r.tZ)(t5,{onSuccess:g,onFail:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(u(e),R({exception:e,errorMessage:"Error singing with FaceBook",operation:"facebook-login-cta"}))},page:a,customButton:function(e){var t=e.disabled,n=e.onClick,o=e.label;return(0,r.tZ)(tH,{disabled:t,onClick:n,label:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"neutral.100",children:o}),buttonId:"hf-facebook-button",leadingIcon:(0,r.tZ)(tq,{size:"24px"}),socialMedia:"facebook"})}})})},nn=n(958042),nr=n(399166);function no(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ni=function(e){var t,n=e.onFail,a=void 0===n?function(){}:n,l=e.containerWidth,u=(0,D.Z)().push,c=(0,nn.Z)(),s=(0,nr.M)(),d=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return no(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return no(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=d[0],p=d[1],g=o.createRef(),b=(0,k.D)(),y=b.dispatch,m=b.state,v=(0,t4.Z)(),h=(0,t9.m)({},{enabled:!!v||"-1"!==m.customerID,suspense:!1}).data,w=(0,em.py)({runUsingStatsig:!0}).track,O=(0,ev.O)(),_=O.id,P=O.attributes,E=(0,tS.Oq)().trackLoginButtonClick,j=(0,tk.O)().trackLoginSubmit,C=(0,t_.d)().trackLoginLoginSuccess,x=(0,o.useCallback)(function(){u({event:"Login_ButtonClick",gaEventAction:"social google signup_login clicked"}),E({loginMethod:tP.pL.Google,loginType:tP.Bz.Login,uiComponentName:"GoogleLoginButton",uiComponentLabel:"Sign in with Google"}),j({loginMethod:tP.pL.Google,loginType:tP.Bz.Login,uiComponentName:"GoogleLoginButton",uiComponentLabel:"Sign in with Google"}),w({eventName:"SocialLogin_ButtonClick",experimentationUserId:_,experimentationUserAttributes:P,eventTags:{event_name:"SocialLogin_ButtonClick",EventCategory:"registration",EventAction:"google",EventLabel:"loginPage"}})},[u,E,j,w,_,P]);(0,o.useEffect)(function(){v&&h&&y({type:S.uy,payload:{customerID:h.user_id}})},[v,h,y]),(0,o.useEffect)(function(){if(!f&&s.initialized&&g.current){var e;p(!0),null===(e=window.google)||void 0===e||e.accounts.id.renderButton(g.current,{theme:"filled_blue",size:"large",logo_alignment:"left",width:l,shape:"rectangular",locale:c,click_listener:x})}},[g,s.initialized,c,l,x,f]),(0,o.useEffect)(function(){s.initializationError&&a(s.initializationError)},[s.initializationError,a]),(0,o.useEffect)(function(){s.loginErrorMessage&&a(s.loginErrorMessage)},[s.loginErrorMessage,a]),(0,o.useEffect)(function(){s.signInResponseData&&(C({loginMethod:tP.pL.Google,loginType:tP.Bz.Login,systemMessage:"Google Login Success"}),t7(s.signInResponseData))},[s.signInResponseData,C]);var Z=!s.injected||!s.initialized||s.isSubmitting;return(0,r.BX)(i.xu,{mt:"sm-2",children:[(0,r.tZ)(i.xu,{"data-test-id":"hf-google-login",height:44,disabled:Z,children:(0,r.tZ)("div",{ref:g})}),(s.injectError||s.loginErrorMessage)&&(0,r.tZ)(tY,{errorMessage:s.injectError||s.loginErrorMessage,dataTestId:"hf-google-login-error",socialMedia:"google"})]})},na=n(854925);function nl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nu(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function nc(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nu(i,r,o,a,l,"next",e)}function l(e){nu(i,r,o,a,l,"throw",e)}a(void 0)})}}function ns(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nl(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nd(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var nf=function(e){var t=function(e){return W.apply(this,arguments)},n=function(e){var t=th(e);m(t),w(!1),z({event_name:"Login_Failed",gaEventAction:"social apple signup_login failed",gaEventLabel:t}),_("social apple signup_login failed: ".concat(t)),c.onFail(e)},a=function(){if(!h)return m(""),w(!0),z({event_name:"Login_ButtonClick",gaEventAction:"social apple signup_login clicked"}),R({loginMethod:tP.pL.Apple,loginType:"register"===u?tP.Bz.Register:tP.Bz.Login,uiComponentName:"AppleLoginButton",uiComponentLabel:H||""}),"login"===u&&T({loginMethod:tP.pL.Apple,loginType:tP.Bz.Login,uiComponentName:"AppleLoginButton",uiComponentLabel:H||""}),x({eventName:"SocialLogin_ButtonClick",experimentationUserId:L,experimentationUserAttributes:I,eventTags:{event_name:"SocialLogin_ButtonClick",EventCategory:"registration",EventAction:"apple",EventLabel:"register"===u?"registerPage":"loginPage"}}),s.login().then(t,n)},l=e.page,u=void 0===l?"login":l,c=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["page"]),s=(0,na.n)(),d=(0,en.O)().systemCountry,f=(0,Z.z)("frontend-auth").data,p=(0,q.a)(null==f?void 0:f.translations),g=(0,et.Z)(),b=ns((0,o.useState)(""),2),y=b[0],m=b[1],v=ns((0,o.useState)(!1),2),h=v[0],w=v[1],S=(0,D.Z)().push,k=(0,O.a8)().track,_=(0,tO.M)().trackSnowplowLoginError,P=(0,tb.usePathname)(),E=(0,eb.G)(),j=(0,B.ew)(),C=(0,M.Z)({runUsingStatsig:!0}),x=(0,em.py)({runUsingStatsig:!0}).track,A=(0,ev.O)(),L=A.id,I=A.attributes,R=(0,tS.Oq)().trackLoginButtonClick,T=(0,tk.O)().trackLoginSubmit,F=(0,t_.d)().trackLoginLoginSuccess,z=(0,o.useCallback)(function(e){
1S(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({environment:j,event:"gaEventTrigger",gaEventCategory:"login",gaEventLabel:"registration",gaEventNonInteraction:!1,brand:"HelloFresh",tribe:"Conversions Journey",screen:"Login",login_method:"apple"},e))},[j,S]),N="/api/social/signup";function U(){return(U=nc(function(e){return nd(this,function(t){return[2,g.post(N,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})]})})).apply(this,arguments)}function V(){return(V=nc(function(e){return nd(this,function(t){return[2,g.post("/api/social/login",e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})]})})).apply(this,arguments)}function W(){return(W=nc(function(e){var t,r,o,i,a,l,s,f,p,g,b,y,m,v;return nd(this,function(h){switch(h.label){case 0:if(!e)throw Error("[AppleSignIn] no data for user received");o=e.user,i=e.authorization,s=tN.stringify({country:d,grant_type:"social_login",social_provider_id:"apple","social_auth_data[id_token]":null==i?void 0:i.id_token,"social_auth_data[user][name][firstName]":null!==(a=null==o?void 0:null===(t=o.name)||void 0===t?void 0:t.firstName)&&void 0!==a?a:"","social_auth_data[user][name][lastName]":null!==(l=null==o?void 0:null===(r=o.name)||void 0===r?void 0:r.lastName)&&void 0!==l?l:""}),h.label=1;case 1:return h.trys.push([1,4,,5]),[4,function(e){return U.apply(this,arguments)}(s)];case 2:return b=(g=h.sent()).status,y=g.statusText,[4,function(e){return V.apply(this,arguments)}(s)];case 3:return m=h.sent().data,v=(null===(f=E.mobileWebView)||void 0===f?void 0:f.active)?"app":"register"===u?"registerPage":"loginPage",201===b&&x({eventName:"Successful_Register",experimentationUserId:L,experimentationUserAttributes:I,eventTags:{event_name:"Successful_Register",EventCategory:"registration",EventAction:"apple",EventLabel:v}}),k((0,tw.$gb)({login_method:"apple",page_of_login:P}),{action:"Apple Login Success",action_type:"system_message",is_ecommerce:!1}),z({event_name:"Login_Success",gaEventAction:"social apple signup_login success",gaEventLabel:"Post ".concat(N," --> {create customer - social} {").concat(b," ").concat(y,"}")}),"login"===u&&F({loginMethod:tP.pL.Apple,loginType:tP.Bz.Login,systemMessage:"Apple Login Success"}),x({eventName:"Login_Success",experimentationUserId:L,experimentationUserAttributes:I,eventTags:{event_name:"Login_Success",EventCategory:"login",EventAction:"apple",EventLabel:v}}),C((null==m?void 0:null===(p=m.user_data)||void 0===p?void 0:p.id)||""),c.onSuccess(m),[3,5];case 4:return n(h.sent()),[3,5];case 5:return[2]}})})).apply(this,arguments)}var G=!s.injected||s.waitingOnApple,H=p.get("label_".concat(u,"_apple_button")),K=c.customButton?c.customButton({disabled:G,onClick:a,label:H}):(0,r.tZ)(tH,{disabled:G,onClick:a,label:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"neutral.100",children:H}),buttonId:"hf-apple-button","data-test-id":"hf-apple-button",leadingIcon:(0,r.tZ)(tV,{size:"24px"}),socialMedia:"apple"});return(0,r.BX)("div",{"data-test-id":"hf-apple-".concat(u),children:[K,!!y&&(0,r.tZ)(tY,{errorMessage:y,dataTestId:"hf-apple-login-error",socialMedia:"apple"})]})};function np(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ng(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return np(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return np(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nb=function(e){if(e&&e.match(/ipad|iphone|ipod/i)){var t=ng(e.match(/OS (\d)?\d_\d(_\d)?/i)||[],1)[0];return 13>parseInt(ng((t||"").split("_"),1)[0].replace("OS ",""),10)}return!1},ny=function(e){var t=e.page,n=e.onFail,a=void 0===n?function(){}:n,l=(0,k.D)(),u=l.dispatch,c=l.state,s=(0,t4.Z)(),d=(0,t9.m)({},{enabled:!!s||"-1"!==c.customerID,suspense:!1}).data;return((0,o.useEffect)(function(){s&&d&&u({type:S.uy,payload:{customerID:d.user_id}})},[s,d,u]),nb(window.navigator&&window.navigator.userAgent))?null:(0,r.tZ)(i.xu,{mt:"sm-2",children:(0,r.tZ)(nf,{onFail:function(e){e&&(a((void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"?e.error:e),R({exception:e,errorMessage:"Error singing with Apple",operation:"apple-login-cta"}))},onSuccess:function(e){t7(e)},page:t,customButton:function(e){var t=e.disabled,n=e.onClick,o=e.label;return(0,r.tZ)(tH,{disabled:t,onClick:n,label:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"neutral.100",children:o}),buttonId:"hf-apple-button",leadingIcon:(0,r.tZ)(tV,{size:"24px"}),socialMedia:"apple"})}})})},nm=function(e){var t=e.children;return(0,r.tZ)(i.xu,{my:"sm-2",mx:"zero",padding:"sm-1",color:"neutral.800",backgroundColor:"reward.200",borderRadius:"border-radius-sm",borderWidth:1,borderStyle:"solid",borderColor:"warning.500",children:(0,r.tZ)(i.xv,{type:"body-md-regular",children:t})})},nv="funnel.register.signup.or.label",nh=function(){var e=(0,l.ZP)("funnel").translateRaw,t=(0,a.zv)();return(0,r.tZ)(i.xu,{as:"span",color:"neutral.500",mt:["md-1","md-2"],mb:["md-1","md-2"],display:"flex",justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",pseudo:t?{}:{":before":{content:'""',width:"100%",borderTopWidth:"1px",borderTopStyle:"solid"},":after":{content:'""',width:"100%",borderTopWidth:"1px",borderTopStyle:"solid"}},children:(0,r.tZ)(i.xu,{pl:"sm-1",pr:"sm-1",children:(0,r.tZ)(i.xv,{m:"zero",color:"neutral.800",type:"body-sm-regular","data-translation-id":nv,children:e(nv)})})})},nw=n(832075),nO=function(){var e=(0,O.L3)().trackJanusEvent;return{trackPasswordlessLoginClick:(0,o.useCallback)(function(){try{e(nw.rI.janusEvent({login:nw.rI.login({loginMethod:nw.pL.Email,loginType:nw.Bz.Login}),uiComponent:nw.rI.uiComponent({uiComponentName:"PasswordlessLoginButton",uiComponentLabel:"Login without password"})}))}catch(e){(0,v.Tb)(e,{tags:{event:"Login_Select_Passwordless_Button_Click",component:"usePasswordlessLoginJanusTracking"}})}},[e])}},nS=n(248780),nk=function(e){var t=e.email,n=(0,D.Z)().push,o=(0,k.D)().dispatch,a=nO().trackPasswordlessLoginClick,u=(0,l.ZP)("funnel").translate;return(0,r.tZ)(i.zx.Secondary,{leadingIcon:(0,r.tZ)(nS.default,{color:"neutral-100"}),onClick:function(){n({event:"gaEventTrigger",event_name:"Login_PasswordLessLoginClick",brand:"HelloFresh",tribe:"Conversions",screen:"Login",event_category:"Login",event_action:"PasswordLessLoginClick",event_label:"[button_type]",button_type:"[button-one-time-link]"}),a(),o({type:S.qB,payload:{step:S.JN,email:t||""}})},children:u("funnel.login.passwordless.loginWithoutPasswordButton")})},n_=n(783244);function nP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function nj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nP(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nC=function(e){var t,n,a,u=(0,D.Z)().push,c=(0,L.T)(),s=t$().trackLoginSelectAccountLinkClick,d=(0,l.ZP)("funnel").translate,f=(0,t4.Z)(),p=(0,o.useRef)(!0),g=(0,k.D)(),y=g.dispatch,m=g.state,v=(0,eb.G)().mobileWebView,h=(0,t9.m)({},{enabled:!!f,suspense:!1}).data,w=(0,M.Z)(),O=(0,M.Z)({runUsingStatsig:!0}),_=(0,b.t)(),P=m.hasPasswordBeenReset,E=nj((0,o.useState)(!1),2),j=E[0],C=E[1],x=(0,Z.z)("frontend-auth").data,I=(null==x?void 0:x.disableSocialMediaLogins)||!1;(0,o.useEffect)(function(){C(window.navigator&&!window.navigator.userAgent.match(/Android/i))},[]);var R=nj((0,o.useState)(!1),2),B=R[0],F=R[1],z=nj((0,o.useState)(!1),2),N=z[0],U=z[1];(0,o.useEffect)(function(){h&&f&&(y({type:S.uy,payload:{customerID:h.user_id}}),B&&!N&&h.user_id&&(w("".concat(h.user_id.toString().slice(3))),U(!0)))},[h,_,f,y,B,w,N]);var q=(0,em.py)({runUsingStatsig:!0}).track,V=(0,ev.O)(),W=V.id,G=V.attributes,H=nj((0,n_.Z)("hf_product_sku"),3)[2],K=(t=function(e){var t,n,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){return H(),(0,T.JS)(e),O((null===(t=e.user_data)||void 0===t?void 0:t.id)||""),F(!0),a.setAttributes({loginSuccess:!0,is_mobile_webview:String(null!==(n=null==v?void 0:v.active)&&void 0!==n&&n),passwordless_available:String(!(null==v?void 0:v.active))}).end(),q({eventName:"successful_login",experimentationUserId:W,experimentationUserAttributes:G,eventTags:{event_name:"successful_login",brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"login",EventLabel:"login",is_mobile_webview:String(null!==(r=null==v?void 0:v.active)&&void 0!==r&&r)}}),[2]})},n=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){nE(i,r,o,a,l,"next",e)}function l(e){nE(i,r,o,a,l,"throw",e)}a(void 0)})},function(e){return n.apply(this,arguments)}),J=function(e){e.preventDefault(),u(e1),s(),y({type:S.qB,payload:{step:S.hm}})};return(0,r.tZ)(r.HY,{children:f?(0,r.tZ)(i.xu,{display:"flex",justifyContent:"center",alignItems:"center",children:(0,r.tZ)(i.$j,{variant:"primary",size:"md"})}):(0,r.BX)(r.HY,{children:[P&&(0,r.tZ)(nm,{children:d("funnel.register.login.forgotPassword.message")}),(0,r.tZ)(tB,{defaultUsername:e.email,enableRememberCredentials:!0,isRememberCredentialsChecked:!0,onChangeRememberCredentials:function(e){p.current=!!e.target.checked},onClickForgetPassword:function(e){e.preventDefault(),y({type:S.qB,payload:{step:S.XL}})},onSuccess:K,onFail:function(e){var t;a.setStatus({code:A.Z.ERROR,message:e.message}),(null===(t=e.response)||void 0===t?void 0:t.data)&&a.setAttribute("auth_response",JSON.stringify(e.response.data)),a.end()},onSubmit:function(){a=c.startSpan("email-password-login")},onClickWarning:J,onEmailChange:e.onChangeEmail,disablePasswordField:e.disablePasswordField,disableEmailField:e.disableEmailField}),!(null==v?void 0:v.active)&&(0,r.tZ)(i.xu,{mt:"sm-2",children:(0,r.tZ)(nk,{email:e.email})}),(0,r.tZ)(nh,{}),(0,r.BX)(r.HY,{children:[!I&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(ni,{containerWidth:e.loginStepsWidth}),j&&(0,r.tZ)(ny,{page:"login"}),(0,r.tZ)(nt,{page:"login"})]}),(0,r.BX)(i.xu,{mt:["md-1","md-1","md-2"],display:"flex",justifyContent:"center",alignItems:"center",children:[(0,r.BX)(i.xv,{m:"zero",children:[d("funnel.register.signup.footer.text")," "]}),(0,r.tZ)(i.rU,{ml:"sm-1",color:"primary.600","data-test-id":"signup-link",onClick:J,href:"/login",children:d("funnel.register.signup.footer.link")})]})]})]})})},nx=function(){var e=(0,l.ZP)("funnel").translate;return(0,r.tZ)(i.xv,{type:"body-md-regular",textAlign:"center",children:e("funnel.login.forgot-password.subheader")})},nZ=function(){var e=(0,tN.parse)(window.location.search),t=C().get(t8),n=Array.isArray(e.email)?e.email[0]:e.email;if(n){if((0,eo.Ju)(n))return n;try{var r=window.atob(n);if(!(0,eo.Ju)(r))return;return r}catch(e){}}return t?(C().remove(t8),t):C().get("hf_leadgen_email")},nA=n(64294),nL=function(e){var t=e.isOpen,n=e.setIsOpen,o=(0,l.ZP)("funnel").translate;return(0,r.tZ)(i.Vq,{isOpen:t,onClose:function(){return n(!1)},confirmButtonText:o("funnel.login.passwordless.goToHomePageButton"),onConfirm:function(){window.location.replace("/")},headerText:(0,r.tZ)(i.xv,{as:"h1",children:o("funnel.login.passwordless.404")}),bodyText:o("funnel.login.passwordless.404.message"),alignBody:"center",alignHeader:"center",maxWidth:"418px",children:(0,r.tZ)(i.xu,{textAlign:"center",mt:"global.sm-1",children:(0,r.tZ)(c.ZP,{src:(0,s.Z)("https://media.hellofresh.com/hellofresh_website/re-engagement-squad/404_dishes.png"),width:180,height:180,alt:""})})})},nI=n(903558),nR=n(666296);function nM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nM(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nD=function(){var e=(0,l.ZP)("funnel"),t=e.translate,n=e.translateRaw,a=(0,k.D)(),u=a.state,c=a.dispatch,s=(0,U.Z)(),d=(0,nn.Z)(),f=(0,b.t)(),p=nT((0,o.useState)(u.email),2),g=p[0],y=p[1],m=nT((0,o.useState)(!1),2),v=m[0],h=m[1],w=(0,D.Z)().push,O=(0,em.py)({runUsingStatsig:!0}).track,_=(0,L.T)().startSpan("login-passwordless-link-step"),P=(0,ev.O)(),E=P.id,j=P.attributes,C=nT((0,o.useState)(!1),2),x=C[0],Z=C[1],A=(0,nA.ZP)(),I=nT((0,o.useState)(!1),2),R=I[0],M=I[1],T=(0,nI.p)().mutate,B=(0,nR.F)().trackRequestLoginLinkClick,F=(0,o.useMemo)(function(){var e=f.query.redirect_url,t=!1;if(e&&"string"==typeof e)try{var n=decodeURIComponent(e),r=new URL(n,window.location.origin);t="true"===r.searchParams.get("from_express_checkout")||"express_checkout_phase_2"===r.searchParams.get("flow")||r.searchParams.has("cart_id")||r.pathname.includes("expressCheckout")}catch(e){t=!1}if(t&&e&&"string"==typeof e){var o=decodeURIComponent(e);return o.startsWith("/")?encodeURIComponent("".concat(window.location.origin).concat(o)):encodeURIComponent(o)}return encodeURIComponent("".concat(window.location.origin,"/my-account/deliveries/menu"))},[f.query.redirect_url]),z=function(){O({experimentationUserId:E,experimentationUserAttributes:j,eventName:"Login_PasswordLessGetLinkClick",eventTags:{brand:"HelloFresh",tribe:"Conversions",EventCategory:"",EventAction:"",EventLabel:""}})},N=function(){c({type:S.qB,payload:{step:S.R8,email:g}}),_.setAttributes({get_passwordless_link_success:!0}).end()},q=function(e){var t;(null===(t=e.response)||void 0===t?void 0:t.status)===500?M(!0):c({type:S.qB,payload:{step:S.qI,email:g}}),_.setAttributes({error:(null==e?void 0:e.message)||"Unknown error",get_passwordless_link_success:!1}).end()},V=function(){return g.length>0&&!(0,eo.Ju)(g)};return(0,r.BX)(r.HY,{children:[(0,r.BX)(i.xu,{textAlign:"center",mt:"xs",children:[(0,r.tZ)(i.xv,{color:"neutral.800",children:t("funnel.login.passwordless.linkDescription")}),(0,r.BX)(i.xu,{my:"sm-2",children:[(0,r.tZ)(i.NI,{labelText:n("funnel.login.passwordless.email"),children:(0,r.tZ)(i.NI.TextInput,{"data-test-id":"passwordlessLinkStepInputField",value:g,onChange:function(e){return y(e.target.value)},error:v,onFocus:function(){return h(!1)},onBlur:function(){return h(V)}})}),v&&(0,r.tZ)(i.xu,{textAlign:"left",children:(0,r.tZ)(i.xv,{type:"body-sm-regular",color:"error.600",mt:"xxs",children:t("funnel.login.passwordless.emailErrorMessage")})})]}),(0,r.tZ)(i.zx.Primary,{"data-test-id":"passwordlessLinkStepGetLink",onClick:function(){_.setAttributes({action:"get_passwordless_link_click"}),w({event:"gaEventTrigger",event_name:"Login_PasswordLessGetLinkClick",brand:"HelloFresh",tribe:"Conversions",screen:"Login",gaEventCategory:"Login",gaEventAction:"PasswordLessGetLinkClick",gaEventLabel:"PasswordLessGetLink"}),B(),z(),Z(!0),T({country:s,locale:d,email:g,channel:"email",send:"link",redirect_url:F,public_id:A},{onSuccess:function(){return N()},onError:function(e){return q(e)}}),Z(!1)},disabled:x||!(0,eo.Ju)(g),loading:x,children:t("funnel.login.passwordless.getLinkButton")}),(0,r.tZ)(i.xu,{mt:"sm-2",children:(0,r.tZ)(i.xv,{textAlign:"center",children:(0,r.tZ)(i.rU,{onClick:function(e){e.preventDefault(),c({type:S.qB,payload:{step:S.gw,email:g}})},"data-test-id":"passwordlessLinkStepGoBack",href:"/login",customColor:"neutral.700",hoverColor:"primary.600",children:t("funnel.login.passwordless.goBackButton")})})})]}),(0,r.tZ)(nL,{isOpen:R,setIsOpen:M})]})},nB=n(14949);function nF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nF(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nN=function(){var e=(0,l.ZP)("funnel").translate,t=(0,k.D)(),n=t.state,a=t.dispatch,u=(0,U.Z)(),d=(0,nn.Z)(),f=(0,L.T)().startSpan("login-passwordless-confirmation-step"),p=nz((0,o.useState)(!1),2),g=p[0],b=p[1],y=nz((0,o.useState)(!1),2),m=y[0],v=y[1],h=nz((0,o.useState)(!1),2),w=h[0],O=h[1],_=nz((0,o.useState)(!0),2),P=_[0],E=_[1],j=(0,D.Z)().push,C=(0,nA.ZP)(),x=(0,nI.p)().mutate,Z=(0,nB.k)().isEnabled;return(0,o.useEffect)(function(){setTimeout(function(){E(!1)},1e4)},[]),(0,o.useEffect)(function(){g&&setTimeout(function(){b(!1)},2e4)},[g]),(0,o.useEffect)(function(){m&&setTimeout(function(){v(!1)},5e3)},[m]),(0,r.BX)(i.xu,{position:"relative",textAlign:"center",mt:"xs",children:[(0,r.tZ)(i.xv,{"data-test-id":"passwordlessConfirmationStepText",children:e(Z?"funnel.login.passwordless.confirmationDescription.v2":"funnel.login.passwordless.confirmationDescription",{email:n.email})}),(0,r.tZ)(i.xu,{display:["none","block"],mt:"global.sm-1",children:(0,r.tZ)(c.ZP,{src:(0,s.Z)("https://media.hellofresh.com/hellofresh_website/re-engagement-squad/envelope-email.png"),width:180,height:180,alt:""})}),(0,r.tZ)(i.xu,{display:["block","none"],mt:"global.sm-1",children:(0,r.tZ)(c.ZP,{src:(0,s.Z)("https://media.hellofresh.com/hellofresh_website/re-engagement-squad/envelope-email.png"),width:180,height:180,alt:""})}),(0,r.tZ)(i.xu,{mt:"global.sm-1",children:(0,r.tZ)(i.zx.Secondary,{"data-test-id":"passwordlessConfirmationStepSendAgain",disabled:P||w||g,onClick:function(){j({event:"gaEventTrigger",event_name:"Login_PasswordLessSendAgainClick",brand:"HelloFresh",tribe:"Conversions",screen:"Login",event_category:"Login",gaEventAction:"PasswordLessSendAgainClick",gaEventLabel:"PasswordLessSendAgain"}),O(!0),m&&v(!1),x({country:u,locale:d,email:n.email,channel:"email",send:"link",redirect_url:encodeURIComponent("".concat(window.location.origin,"/my-account/deliveries/menu")),public_id:C},{onSuccess:function(){return b(!0)},onError:function(){return v(!0)}}),f.setAttributes({action:"get_passwordless_link_again_click"}).end(),O(!1)},loading:w,children:e("funnel.login.passwordless.sendAgainButton")})}),(0,r.tZ)(i.xu,{textAlign:"center",mt:"global.sm-1",children:(0,r.tZ)(i.rU,{onClick:function(){a({type:S.qB,payload:{step:S.JN,email:n.email}})},"data-test-id":"passwordlessErrorStepReturnToLogin",href:"javascript:void(0);",children:e("funnel.login.passwordless.goBackButton")})}),(0,r.BX)(i.xu,{position:"absolute",bottom:"-22px",left:"0",right:"0",children:[g&&(0,r.tZ)(i.xv,{"data-test-id":"passwordlessConfirmationStepNewEmailSentText",color:"global.gray.500",children:e("funnel.login.passwordless.confirmationNewEmailSent")}),m&&(0,r.tZ)(i.xv,{"data-test-id":"passwordlessConfirmationStepErrorText",color:"global.cherry.600",children:e("funnel.login.passwordless.confirmationError")})]})]})},nU=function(){var e=(0,l.ZP)("funnel").translate,t=(0,k.D)(),n=t.state,o=t.dispatch,a=(0,L.T)().startSpan("login-passwordless-error-step");return(0,r.BX)(i.xu,{textAlign:"center",mt:"xs",children:[(0,r.tZ)(i.xv,{"data-test-id":"passwordlessErrorStepText",children:e("funnel.login.passwordless.errorDescription")}),(0,r.tZ)(i.xu,{display:["block","none"],mt:"global.sm-1",children:(0,r.tZ)(c.ZP,{src:(0,s.Z)("https://media.hellofresh.com/hellofresh_website/re-engagement-squad/general-apology.png"),width:"180",height:"180",alt:""})}),(0,r.tZ)(i.xu,{display:["none","block"],my:"global.md-1",children:(0,r.tZ)(c.ZP,{src:(0,s.Z)("https://media.hellofresh.com/hellofresh_website/re-engagement-squad/envelope-email.png"),width:180,height:180,alt:""})}),(0,r.tZ)(i.xu,{mt:"global.sm-1",children:(0,r.tZ)(i.zx.Primary,{"data-test-id":"passwordlessErrorStepRequestNewLink",onClick:function(){o({type:S.qB,payload:{step:S.JN}}),a.setAttributes({action:"handleRequestNewLinkButtonClick"}).end()},children:e("funnel.login.passwordless.requestNewLinkButton")})}),(0,r.tZ)(i.xu,{textAlign:"center",mt:"global.sm-1",children:(0,r.tZ)(i.rU,{onClick:function(){o({type:S.qB,payload:{step:S.gw,email:n.email}}),a.setAttributes({action:"handleReturnToLoginClick"}).end()},"data-test-id":"passwordlessErrorStepReturnToLogin",href:"javascript:void(0);",children:e("funnel.login.passwordless.returnToLoginButton")})})]})};function nq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nq(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nW=function(){C().get(t6)&&C().remove(t6)},nG=function(){var e=nV((0,o.useState)(0),2),t=e[0],n=e[1];return(0,o.useEffect)(function(){var e=function(){n(window.innerWidth)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),t},nH=function(){var e=(0,Z.z)("website").data,t=(0,l.ZP)("funnel").translateRaw,n=null==e?void 0:e.isMaterialDesignEnabled,a=nG(),u=(0,x.e)(),c=(0,L.T)().startSpan("login-steps").setAttributes({step:"LoginStepsBasic"}),s=(0,k.D)().state,d=s.email,f=(0,o.useRef)(null),p=nV((0,o.useState)(0),2),g=p[0],b=p[1],y=nV((0,o.useState)(function(){var e=nZ()||"";return d||e}),2),m=y[0],v=y[1],h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};v("string"==typeof e?e:e.target.value),t&&t(),c.setAttributes({action:"user_typing_email"})},w=s.step===S.gw,O=s.step===S.hm,_=s.step===S.XL,P=s.step===S.JN,E=s.step===S.R8,j=s.step===S.qI;return(0,o.useEffect)(function(){nW()},[]),(0,o.useEffect)(function(){f.current&&b(f.current.offsetWidth)},[f,a]),(0,r.BX)(i.xu,{id:"hf-login-steps",minHeight:"200px",ref:f,children:[w&&(0,r.tZ)(nC,{email:m,onChangeEmail:h,loginStepsWidth:g,disableEmailField:!u,disablePasswordField:!u}),P&&(0,r.tZ)(nD,{}),E&&(0,r.tZ)(nN,{}),j&&(0,r.tZ)(nU,{}),O&&(0,r.tZ)(tn,{onChangeEmail:h,email:m,isMaterialDesignEnabled:n,helperText:t("funnel.login.forgot-password.subheader")}),_&&(0,r.tZ)(tg,{onChangeEmail:h,email:m,renderSubheader:function(){return(0,r.tZ)(nx,{})}})]})},nK=function(){var e=(0,l.ZP)("funnel.login").translate,t=(0,k.D)().state,n=t.step===S.gw,o=t.step===S.hm,a=t.step===S.XL,u=t.step===S._J,c=t.step===S.JN,s=t.step===S.qI,d=t.step===S.R8;return(0,r.BX)(i.xu,{textAlign:"center",display:"flex",justifyContent:"center",mb:["md-1","md-2"],children:[d&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.passwordless.checkInboxHeader")}),s&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.passwordless.errorHeader")}),c&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.passwordless.oneTimeLinkHeader")}),n&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.first-step.title")}),u&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.sign-in.title")}),o&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.sign-up.title")}),a&&(0,r.tZ)(i.xv,{as:"h2",children:e("funnel.login.forgot-password.title")})]})},nJ=n(273593),nX=function(e){var t=e.isModularLoginBannerVisible,n=e.renderBadge,o=(0,a.zv)();return(0,r.BX)(i.xu,{flexDirection:"column",justifyContent:"center",mt:["zero","lg-3"],mb:"lg-1",width:["100vw","456px"],maxWidth:"450px",id:"hf-login",backgroundColor:"alias.page-background.default",children:[t&&(0,r.tZ)(i.xu,{display:["flex","flex","none"],justifyContent:"center",my:["zero","md-1"],children:(0,r.tZ)(nJ.T,{})}),(0,r.BX)(i.xu,{as:"section",backgroundColor:"alias.page-background.default",px:"md-1",py:["md-1","md-2"],borderStyle:"solid",borderWidth:o?0:1,borderColor:"neutral.400",children:[(0,r.tZ)(nK,{}),n&&n(),(0,r.BX)(i.xu,{mb:"md-1",children:[(0,r.tZ)(E,{}),(0,r.tZ)(y,{})]}),(0,r.tZ)(nH,{})]})]})}},273593:function(e,t,n){"use strict";n.d(t,{T:function(){return p}});var r=n(687800),o=n(827378),i=n(768587),a=n(318066),l=n(277425),u=n(164528),c=n(268481);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var f=function(){var e=(0,c.Sj)(),t=d((0,o.useState)(0),2),n=t[0],r=t[1],i=d((0,o.useState)(0),2),a=i[0],l=i[1];return(0,o.useEffect)(function(){"desktop"===e?(r(155),l(159)):"tablet"===e?(r(130.75),l(133.95)):"mobile"===e&&(r(112.81),l(115.44))},[e]),{imgWidth:n,imgHeight:a}},p=function(){var e=(0,u.ZP)("reactivations").translate,t=(0,c.Sj)(),n=f(),o=n.imgWidth,s=n.imgHeight;return(0,r.BX)(i.xu,{bg:"reward.200",display:"flex",width:["100vw","456px","558px"],borderRadius:"border-radius-md",boxShadow:"mobile"===t?"shadow-none":"shadow-md",minHeight:[116,"auto"],children:[(0,r.tZ)(i.xu,{backgroundImage:"url(".concat("https://cdn.hellofresh.com/reactivation/modular_callout_textures_desk-tab_2x.png",")"),backgroundRepeat:"no-repeat",backgroundSize:"contain",p:["sm-2","md-1"],position:"relative",width:.5,children:(0,r.tZ)(i.xu,{bottom:["-8px","auto"],left:[0,"md-2"],position:"absolute",top:["auto","-30px","-40px"],children:(0,r.tZ)(a.ZP,{alt:"receipe box image",height:s,layout:"fixed",src:(0,l.Z)("https://cdn.hellofresh.com/reactivation/Modular-login-Recipe-card-delivery_2x.png"),width:o})})}),(0,r.BX)(i.xu,{p:["sm-2","md-1"],pl:["xxs","sm-2"],width:1,children:[(0,r.tZ)(i.xv,{as:"desktop"===t?"h3":"h4",children:e("reactivations.page.reactivate-and-save")}),(0,r.tZ)(i.xu,{pt:"xxs",children:(0,r.tZ)(i.xv,{type:"body-sm-regular",children:e("reactivations.page.log-in-reactivate-discount")})})]})]})}},265759:function(e,t,n){"use strict";n.d(t,{JN:function(){return d},Ki:function(){return r},R8:function(){return f},XL:function(){return l},_J:function(){return i},fR:function(){return u},gw:function(){return o},hm:function(){return a},qB:function(){return s},qI:function(){return p},uy:function(){return c}});var r="CUSTOMER_RESET_PASSWORD",o="CUSTOMER_REGISTRATION_FIRST_STEP",i="CUSTOMER_REGISTRATION_SIGNIN_STEP",a="CUSTOMER_REGISTRATION_SIGNUP_STEP",l="CUSTOMER_REGISTRATION_FORGOT_PASSWORD_STEP",u="".concat("CUSTOMER_EMAIL","_RESET"),c="CUSTOMER_ID_SET",s="SET_STEP",d="PASSWORDLESS_LOGIN_LINK_STEP",f="PASSWORDLESS_LOGIN_CONFIRMATION_STEP",p="PASSWORDLESS_LOGIN_ERROR_STEP"},463864:function(e,t,n){"use strict";n.d(t,{D:function(){return f},s:function(){return d}});var r=n(687800),o=n(827378),i=n(265759);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var c=o.createContext(void 0),s=function(e,t){switch(t.type){case i.qB:return u(l({},e),{step:t.payload.step,hasPasswordBeenReset:t.payload.hasPasswordBeenReset||!1,email:t.payload.email||e.email,isPasswordlessLogin:t.payload.isPasswordlessLogin||e.isPasswordlessLogin});case i.uy:return u(l({},e),{customerID:t.payload.customerID});case i.fR:return u(l({},e),{isVerified:!1,pending:!1,failed:!1,result:null});case i.Ki:return u(l({},e),{hasPasswordBeenReset:!0});default:throw Error("Unhandled action type: ".concat(t.type))}},d=function(e){var t,n=e.children,l=function(e){if(Array.isArray(e))return e}(t=o.useReducer(s,{step:i.gw,hasPasswordBeenReset:!1,customerID:"-1",email:"",isVerified:!1,pending:!1,failed:!1,result:null,resetPasswordMessage:"",isPasswordlessLogin:!1}))||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return a(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,2)}}
1(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=l[0],d=l[1];return(0,r.tZ)(c.Provider,{value:{state:u,dispatch:d},children:n})},f=function(){var e=o.useContext(c);if(void 0===e)throw Error("useAuthStep must be used within a AuthStepProvider");return e}},942706:function(e,t,n){"use strict";n.d(t,{c:function(){return r}});var r=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({event:"gaEventTrigger",gaEventCategory:"gaEventTrigger",gaEventAction:null,gaEventLabel:null},e)}},223470:function(e,t,n){"use strict";n.d(t,{Ju:function(){return l},yU:function(){return u},zd:function(){return s}});var r=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,o=/^(\w+:)?\/\/.*$/,i=/^\/[^.]*$/,a=/(^\/\\\s+\/\\)/,l=function(e){return!!(e||"").match(r)},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!e.match(o)},c=function(e){try{return new URL(e).hostname===window.location.hostname}catch(e){return!1}},s=function(e){return decodeURIComponent(decodeURI(e).replace(a,""))===decodeURIComponent(e)&&(i.test(decodeURI(e))||c(e))}},125846:function(e,t,n){"use strict";n.r(t);var r=n(687800);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}n(827378),t.default=function(e){var t=e.title,n=e.titleId,a=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["title","titleId"]);return(0,r.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":n}),a),{children:[t?(0,r.tZ)("title",{id:n,children:t}):null,(0,r.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 6h-3a4 4 0 0 0-8 0H5L4 22h16L19 6ZM8 8v2h2V8h4v2h2V8h1.121l.75 12H6.13l.75-12H8Zm6-2h-4a2 2 0 1 1 4 0Z",fill:"currentColor"})]}))}},299446:function(e,t,n){"use strict";n.r(t);var r=n(687800);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}n(827378),t.default=function(e){var t=e.title,n=e.titleId,a=function(e,t){if(null==e)return{};var n,r,o=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,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["title","titleId"]);return(0,r.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":n}),a),{children:[t?(0,r.tZ)("title",{id:n,children:t}):null,(0,r.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.4 6 8 3h8l.6 3H21v13h-2a2 2 0 1 1-4 0H9a2 2 0 1 1-4 0H3V6h4.4Zm2.04 0 .2-1h4.72l.2 1H9.44ZM19 17V8H5v9h14Z",fill:"currentColor"})]}))}}},function(e){e.O(0,[47057,38579,12737,8139,14206,44355,61403,274,3094,40412,70788,77498,43316,57252,36060,74050,64944,56360,95851,7563,36152,72822,95325,45692,58351,89073,94414,75182,24370,92888,49774,40179],function(){return e(e.s=197593)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.