PageSourceSearch

https://www.hellofresh.de/_next/static/chunks/pages/checkout-bf51e1c237160bd8.js

js hellofresh.de collected 2026-09-25 23:38:02 UTC 195,256 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2222,86282,10198],{211876:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout",function(){return r(303204)}])},10198:function(e,t,r){"use strict";r.d(t,{vr:function(){return j},SV:function(){return Z}});var n,o,i=r(456552),a=r(827378),u=r(534243),c=r(671718),l=r(26124),s=r(140224),d=r(841723),f=r(64294),p=r(808215),v=r(783244),y=function(e){var t,r,n,o,i,a,u,c,l,s,d,f,p=null===(t=e.products)||void 0===t?void 0:t[0];return{businessDivision:e.businessDivision,hfPublicID:e.hfPublicID,customerUUID:(null==e?void 0:e.customerUUID)||null,delivery:{handle:(null==p?void 0:p.deliveryOption)||null,date:(null==p?void 0:p.deliveryDate)||null},products:null!==(u=null===(r=e.products)||void 0===r?void 0:r.map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({handle:e.handle},e.quantityPerCourse&&e.quantityPerCourse.length>0&&{quantityPerCourse:e.quantityPerCourse},e.customer_selection&&e.customer_selection.length>0&&{customer_selection:e.customer_selection},e.hfWeek&&{hfWeek:e.hfWeek})}))&&void 0!==u?u:[],voucherCode:null!==(c=e.couponCode)&&void 0!==c?c:"",shippingAddress:e.shippingAddress?{address1:null!==(l=null==e?void 0:null===(n=e.shippingAddress)||void 0===n?void 0:n.address1Street)&&void 0!==l?l:"",city:null!==(s=null==e?void 0:null===(o=e.shippingAddress)||void 0===o?void 0:o.city)&&void 0!==s?s:"",phone:null!==(d=null==e?void 0:null===(i=e.shippingAddress)||void 0===i?void 0:i.phone)&&void 0!==d?d:"",postcode:null!==(f=null==e?void 0:null===(a=e.shippingAddress)||void 0===a?void 0:a.postcode)&&void 0!==f?f:""}:void 0,checkoutType:e.checkoutType}},h=function(e){var t,r,n=function(e){return e.units+e.nanos/1e9},o=null==e?void 0:null===(t=e.products)||void 0===t?void 0:t.map(function(t){return{handle:t.id,quantity:1,deliveryDate:null,deliveryOption:void 0,charges:null,priceId:t.priceId,couponMoneyValue:n(t.discount),couponRefundable:t.couponRefundable,currency:t.price.currencyCode,paidPrice:n(t.price)-n(t.discount),shippingAmount:n(t.shippingFee),shippingDiscountAmount:n(t.shippingDiscount),taxAmount:n(t.tax),taxPercent:t.taxPercent,unitPrice:n(t.price),couponCode:e.voucherCode||""}});return{Recalculate:!1,country:e.businessDivision.regionCode,couponCode:e.voucherCode||"",currency:(null===(r=e.products[0])||void 0===r?void 0:r.price.currencyCode)||"USD",customerID:0,discountAmount:n(e.totalDiscountApplied),grandTotal:n(e.grandTotal),isRecurring:!1,minimumValue:e.minimumValue,premiumShippingAmount:n(e.shipping.premium),products:o,remainingDiscountAmount:e.remainingDiscountAmount,shippingAddress:{city:"",postcode:""},city:"",postcode:"",shippingAmount:n(e.shipping.final),shippingDiscountAmount:n(e.shipping.discount),shippingTaxAmount:n(e.shipping.tax),standardShippingAmount:n(e.shipping.base),standardShippingDiscountAmount:n(e.shipping.discount),subTotal:n(e.subtotal),taxAmount:n(e.totalTax),useRemainingDiscountAsCredit:e.useRemainingDiscountAsCredit}},b=r(699219);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var g=function(e){return Object.fromEntries(Object.entries(e).filter(function(e){var t=(function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return m(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,2)}}(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.")}())[1];return null!=t&&""!==t}))},O=function(e){var t,r,n,o,i=null===(r=e.products)||void 0===r?void 0:r[0],a=g({handle:null==i?void 0:i.deliveryOption,date:"string"==typeof(t=null==i?void 0:i.deliveryDate)?t.split("T")[0]:t}),u=(null!==(o=e.products)&&void 0!==o?o:[]).map(function(e){var t,r;return g({handle:e.handle,hfWeek:e.hfWeek,quantityPerCourse:(null===(t=e.quantityPerCourse)||void 0===t?void 0:t.length)?e.quantityPerCourse:void 0,customer_selection:(null===(r=e.customer_selection)||void 0===r?void 0:r.length)?e.customer_selection:void 0})});return[b.Z["calculate.calculateCheckoutPrices"],g(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({businessDivision:e.businessDivision,customerUUID:e.customerUUID,delivery:a,products:u,voucherCode:e.couponCode,checkoutType:e.checkoutType,hfPublicIDSuffix:e.hfPublicIDSuffix},(null===(n=e.shippingAddress)||void 0===n?void 0:n.postcode)?{shippingAddress:{postcode:e.shippingAddress.postcode}}:{}))]};function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function S(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function P(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(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 I="hf_prefill_zipcode",A=(n=function(e,t){var r,n,o,i,a,l,s,d,p,v,b=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(m){switch(m.label){case 0:if(r=b.length>2&&void 0!==b[2]?b[2]:c.Z,n=e.systemCountry,o=e.businessDivision,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["systemCountry","businessDivision"]),d=(0,f.ZP)(),!(p=i.hfPublicIDSuffix&&d?(0,u.Z)("".concat(d,":").concat(i.hfPublicIDSuffix),u.Z.URL):d))throw Error("Missing required parameter: hfPublicID");return v=y(P(w({},i),{businessDivision:o,hfPublicID:p})),[4,r("/activations/checkout/price",t,{method:"POST",headers:w({"Content-Type":"application/json"},i.headers),data:P(w({},v),{country:n.toUpperCase()}),parentSpan:i.parentSpan,fetchSpanAttributes:{"request.backend_service":"price-service","request.backend_action":"activations-checkout-price","sales.channel":(null===(a=i.headers)||void 0===a?void 0:a["Checkout-Context-Sales-Channel"])||"none","sales.conversion_funnel":(null===(l=i.headers)||void 0===l?void 0:l["Checkout-Context-Conversion-Funnel"])||"none","sales.checkout_type":(null===(s=i.headers)||void 0===s?void 0:s["Checkout-Context-Type"])||"none","sales.headers_present":!!(i.headers&&Object.keys(i.headers).length>0)}})];case 1:return[4,m.sent().json()];case 2:return[2,h.apply(void 0,[m.sent()])]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){S(i,r,o,a,u,"next",e)}function u(e){S(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),j=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,s.O)(),o=(0,p.Z)(),i=o.brand,a=o.region_code,u=k((0,v.Z)(I)||[""],1)[0],c=(null===(t=e.shippingAddress)||void 0===t?void 0:t.postcode)||u||"",d=P(w({},e),{businessDivision:{brand:i,regionCode:a},shippingAddress:P(w({},e.shippingAddress),{postcode:c})}),f=O(d);return(0,l.Z)(f,function(e){return A(w({},d,n),f,e)},w({enabled:!!c,staleTime:3e4},r))},Z=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=k((0,v.Z)(I)||[""],1)[0],o=(0,i.useQueryClient)(),u=(0,s.O)(),c=(null===(t=e.shippingAddress)||void 0===t?void 0:t.postcode)||n||"",f=(0,p.Z)(),y=f.brand,h=f.regi
1on_code,b=k((0,a.useState)(""),2),m=b[0],g=b[1],_=!!c&&(0,d.v)(c,u.systemCountry);(0,a.useEffect)(function(){_&&c&&g(c)},[c,_]);var S=P(w({},e),{businessDivision:{brand:y,regionCode:h},shippingAddress:P(w({},e.shippingAddress),{postcode:c})}),j=_?c:m,Z=O(P(w({},S),{shippingAddress:P(w({},S.shippingAddress),{postcode:j})}));return(0,l.Z)(Z,function(e){return A(w({},S,u),Z,e)},w({enabled:!!j,staleTime:3e4,initialData:!_&&m?o.getQueryData(Z):void 0},r))}},631520:function(e,t,r){"use strict";r.d(t,{p:function(){return p}});var n,o,i=r(671718),a=r(407108),u=r(140224),c=r(699219),l=r(383817);function s(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var f=(n=function(e,t){var r,n,o,a,u,c,l=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(s){switch(s.label){case 0:var f,p;return r=e.parentSpan,n=e.plan_type,o=e.locale,a=e.country,u=e.params,c=e.body,[4,(l.length>2&&void 0!==l[2]?l[2]:i.Z)("/api/subscribe/cart-abandoned/".concat(u.email),t,{method:"POST",headers:{"Content-Type":"application/json"},query:{locale:o,country:a},data:(f=d({},c),p=p={plan_type:n},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(p)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(p)).forEach(function(e){Object.defineProperty(f,e,Object.getOwnPropertyDescriptor(p,e))}),f),parentSpan:r,fetchSpanAttributes:{"request.backend_service":"api-v2","request.backend_action":"subscribe-cart-abandoned"}})];case 1:return s.sent(),[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"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,u.O)(),r=t.locale,n=t.systemCountry,o=(0,l.U)(),i=[c.Z["cart-abandonment.subscribe"]];return(0,a.Z)(i,function(e,t){return f(d({locale:r,country:n,plan_type:o},t),i,e)},e)}},520578:function(e,t,r){"use strict";r.d(t,{n:function(){return n}});var n=function(e){var t;return!e||e.planCreationAllowed?"none":null!==(t=e.redirect)&&void 0!==t?t:"none"}},953142:function(e,t,r){"use strict";r.d(t,{y:function(){return a}});var n=r(463171),o=r(681335),i=r(520578),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.enabled,r=(0,n.Z)("plans-4848_consumer-core_subscription-endpoint_use-plans-api"),a=r.isEnabled,u=r.isReady,c=a&&(void 0===t||t),l=(0,o.kH)({},{suspense:!1,enabled:c}),s=l.data,d=l.isSuccess,f=l.isError,p=l.isFetched;return{isFeatureFlagReady:u,isCheckoutStatusEnabled:a,shouldUseCheckoutStatusEndpoint:c,checkoutRedirect:f?"home":(0,i.n)(s),isCheckoutStatusSuccess:d,isCheckoutStatusError:f,isCheckoutStatusFetched:p,data:s}}},917780:function(e,t,r){"use strict";r.d(t,{Y:function(){return f}});var n,o,i=r(456552),a=r(671718),u=r(447178),c=r(699219),l=r(140224);function s(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var d=(n=function(e,t){var r,n,o,i,u=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(c){switch(c.label){case 0:return r=e.parentSpan,n=e.customer_id,o=e.cartId,i=e.data,[4,(u.length>2&&void 0!==u[2]?u[2]:a.Z)("/pcs/v2/pre_checkout/".concat(o),t,{method:"PUT",headers:{"Content-Type":"application/json"},data:i,query:{legacyCustomerId:n},parentSpan:r})];case 1:return c.sent(),[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,l.O)(),r=(0,u.Z)().fetch,n=[c.Z["pre-checkout-selection.savePreCheckoutSelection"]];return(0,i.useMutation)(function(e){return d(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,t),n,r)},e)}},786282:function(e,t,r){"use strict";r.d(t,{m:function(){return k}});var n,o,i=r(827378),a=r(567921),u=r.n(a),c=r(581340),l=r(671718),s=r(26124),d=r(783244);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var p=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=(0,c.t)().asPath,n=(function(e){if(Array.isArray(e))return e}(e=(0,d.Z)("hf_goals_plan_sku_cookie")||[""])||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return f(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],o=u().get("hf_ssr_stored_sku"),a=null==r?void 0:r.includes("/reactivat");return(0,i.useMemo)(function(){var e=null!=o?o:n,r=t.filter(function(e){return e&&"string"==typeof e});if(a&&r.length>0)return r;if(e&&"string"==typeof e&&r.length>0){var i=e.split("-").slice(0,2).join("-"),u=r.filter(function(e){return e.split("-").slice(0,2).join("-")===i});if(u.length>0){var c=new Set(u);return c.add(e),Array.from(c)}}return e&&"string"==typeof e?[e]:r.length>0?r:[]},[o,n,t,a])},v=r(140224),y=r(699219),h=function(e){var t=e.voucherCode,r=e.productSkus,n=e.locale,o=e.systemCountry,i=e.discountCommunicationId,a=e.zipcode,u=e.hf_public_id,c=e.checkoutType;return[y.Z["price-presentation.discountCommunication"],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({voucherCode:t,productSkus:r,locale:n,systemCountry:o,hf_public_id:u},i&&{discountCommunicationId:i},a&&{zipcode:a},c&&{checkoutType:c})]},b=r(870771),m=r(364468),g=r(64294);function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function w(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var P=(n=function(e,t){var r,n,o,i,a,u,c,s,d,f=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(p){switch(p.label){case 0:return r=e.voucherCode,n=e.productSkus,o=e.systemCountry,i=e.locale,a=e.parentSpan,u=e.discountCommunicationId,c=e.zipcode,s=e.hf_public_id,d=e.checkoutType,[4,(f.length>2&&void 0!==f[2]?f[2]:l.Z)("/price-presentation/v2/discount_communication/voucher/".concat(r),t,{query:S({country:o,locale:i,skus:n.join(","),dc_id:u||"",zipcode:c||"",hf_public_id:s||""},void 0!==d&&{checkout_type:d}),parentSpan:a,fetchSpanAttributes:{"request.backend_service":"price-presentation-service","request.backend_action":"get-voucher-discount-communication",discountCommunicationId:u,voucherCode:r}})];case 1:return[2,p.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){_(i,r,o,a,u,"next",e)}function u(e){_(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),k=function(e,t){var r,n,o,a=p(e.productSkus),l=(0,c.t)().asPath,f=(function(e){if(Array.isArray(e))return e}(r=(0,d.Z)(b.gi)||[""])||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(r,1)||function(e,t){if(e){if("string"==typeof e)return O(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,1)}}(r,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],y=(0,i.useMemo)(function(){var e;return(null===(e=u().get("hf_discount_comm_id"))||void 0===e?void 0:e.trim())||""},[]),_=new URLSearchParams((null==l?void 0:l.split("?")[1])||""),k=_&&(null===(n=_.get("discount_comm_id"))||void 0===n?void 0:n.trim())||y||e.discountCommunicationId,I=e.zipcode||f,A=(0,m.Z)().isEnabled,j=(0,i.useMemo)(function(){return u().get(b.m4)},[]),Z=(0,i.useMemo)(function(){return j||(0,g.ZP)()},[j]),E=S(w(S(w(S({},e),{productSkus:a}),(0,v.O)()),{discountCommunicationId:e.ignoreDiscountCommId?void 0:k}),I&&{zipcode:I},Z&&{hf_public_id:Z}),x=h(E),C="string"==typeof e.voucherCode&&e.voucherCode.length>0,D=(null===(o=null==t?void 0:t.enabled)||void 0===o||o)&&C&&a.length>0&&(!A||!!I);return(0,s.Z)(x,function(e){if(A&&!I)throw Error("Zipcode is required for price presentation with regional pricing enabled");return P(E,x,e)},w(S({},t),{enabled:D}))}},364468:function(e,t,r){"use strict";var n=r(463171),o=r(870771);t.Z=function(){var e=(null===n.Z||void 0===n.Z?void 0:(0,n.Z)(o.Fv))||{isEnabled:!1,isReady:!0};return{isEnabled:e.isEnabled,isReady:e.isReady}}},180686:function(e,t,r){"use strict";r.d(t,{T:function(){return d}});var n,o,i=r(456552),a=r(671718),u=r(407108),c=r(699219);function l(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var s=(n=function(e,t){var r,n,o=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(i){switch(i.label){case 0:return[4,(o.length>2&&void 0!==o[2]?o[2]:a.Z)("/v1/profile/me/unified-preferences",t,{method:"PUT",headers:{"Content-Type":"application/json"},data:{unifiedPreferences:e}})];case 1:return[4,i.sent().json()];case 2:return[2,null!==(n=null==(r=i.sent())?void 0:r.unifiedPreferences)&&void 0!==n?n:{}]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){l(i,r,o,a,u,"next",e)}function u(e){l(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.useQueryClient)(),r=[c.Z["profile.update-unified-preferences"]];return(0,u.Z)(r,function(e,t){return s(t,r,e)},function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({onSuccess:function(e){t.setQueryData([c.Z["profile.get-unified-preferences"]],e)}},e))}},503177:function(e,t,r){"use strict";r.d(t,{n:function(){return f}});var n,o,i=r(456552),a=r(671718),u=r(447178),c=r(699219);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var d=(n=function(e,t){var r,n,o,i=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(u){switch(u.label){case 0:var c,s;return r=i.length>2&&void 0!==i[2]?i[2]:a.Z,n=e.variant_ids,[4,r("/questionnaire/surveys/response",t,(c=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({method:"POST",headers:{"Content-Type":"application/json"},data:o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["variant_ids"])},(null==n?void 0:n.length)&&{query:{variant_id:function(e){if(Array.isArray(e))return l(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return l(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}),s=s={fetchSpanAttributes:{"request.backend_service":"questionnaire-service","request.backend_action":"submit-survey-response",survey_id:o.survey_id,survey_translation_id:o.translation_id}},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(s)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(s,e))}),c))];case 1:return[2,u.sent().ok]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,u.Z)().fetch,r=[c.Z["questionnaire.survey-response"]];return(0,i.useMutation)(r,function(e){return d(e,r,t)},e)}},727137:function(e,t,r){"use strict";r.d(t,{H:function(){return S}});var n,o,i=r(699219),a=r(367481),u=r(140224),c=r(892940),l=c.z.object({applicable_to:c.z.enum(["products","shipping","both"]),discount_value:c.z.number().int(),discount_sku:c.z.record(c.z.object({discount_value:c.z.number().int()}).partial().passthrough()).optional()}).passthrough(),s=c.z.object({box_rule:c.z.record(l),customer_unique_usage_limit:c.z.number().int(),subscription_unique_usage_limit:c.z.number().int()}).passthrough(),d=c.z.enum(["subscription","addon-basket","premium-surcharge","free-addon"]),f=s.and(c.z.object({benefit_category:d}).partial().passthrough()),p=c.z.object({discount_value:c.z.number().int(),discount_sku:c.z.array(c.z.string()).min(1).max(1)}).passthrough(),v=c.z.object({lifetime:c.z.enum(["Static","Unlimited","Repetitive"]),discount_type:c.z.literal("Percentage"),box_rule:c.z.record(p)}).passthrough().and(c.z.object({benefit_category:d}).passthrough()),y=c.z.object({customer_type:c.z.string(),product_type:c.z.array(c.z.string()),lifetime:c.z.string(),box_count:c.z.number().int(),discount_type:c.z.string(),discount_rule:f,additional_discounts:c.z.array(v).max(1),use_remaining_discount_as_credit:c.z.boolean()}).partial().passthrough(),h=c.z.object({code:c.z.string(),category:c.z.string(),channel:c.z.string(),channel_split:c.z.string(),partner:c.z.string(),customer_status:c.z.string(),order_status:c.z.string(),discount_type:c.z.enum(["Percentage","Fixed","percent","fixed"]),discount_value:c.z.number(),shipping_amount:c.z.number().int(),voucher_type:c.z.enum(["PERMANENT","SEM_PERMANENT","ONE_TIME"]),success_message:c.z.string(),is_active:c.z.boolean(),is_gift:c.z.boolean(),available_products:c.z.array(c.z.string()),available_families:c.z.array(c.z.string()),limit_per_code:c.z.number().int(),limit_per_subscription:c.z.number().int(),limit_per_customer:c.z.number().int(),repetition_rate:c.z.number().int(),repetition_limit:c.z.number().int(),repetition_from_first:c.z.boolean(),repetition_from_redemption:c.z.boolean(),min_total:c.z.number().int(),val
1id_from:c.z.string(),valid_to:c.z.string(),discount_settings:y,source:c.z.enum(["VOUCHER_SERVICE","INTFOOD"]),is_hellocredit:c.z.boolean(),is_helloshare:c.z.boolean()}).partial().passthrough();c.z.object({status:c.z.string(),error_type:c.z.string(),error_code:c.z.string(),msg:c.z.string()}).partial().passthrough();var b=c.z.object({promise_id:c.z.string().uuid(),plan_id:c.z.string().uuid(),expiration_time:c.z.string()}).partial().passthrough();c.z.object({code:c.z.string(),order_status:c.z.literal("new"),template_type:c.z.string(),discount_type:c.z.enum(["fixed","percent"]),discount_value:c.z.number().int(),discount_sku:c.z.array(c.z.object({discount_value:c.z.string()}).partial().passthrough()),skus_to_apply:c.z.array(c.z.string()),applicable_to:c.z.enum(["products","shipping","both"]),apply_to_shipping:c.z.boolean(),is_helloshare:c.z.boolean(),is_hellocredit:c.z.boolean(),coupon_category:c.z.number().int(),is_refundable:c.z.boolean(),use_remaining_as_credit:c.z.boolean(),shipping_amount:c.z.number().int(),has_future_discount:c.z.boolean(),success_message:c.z.string(),box_redeemed:c.z.number().int(),box_count:c.z.number().int(),related_promise:b}).partial().passthrough();var m=r(671718),g=r(447178);function O(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var _=(n=function(e,t){var r,n,o,i,a=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(u){switch(u.label){case 0:return r=e.code,n=e.systemCountry,o=e.locale,i=e.parentSpan,[4,(a.length>2&&void 0!==a[2]?a[2]:m.Z)("/voucher/vouchers/".concat(r),t,{method:"GET",query:{country:n,locale:o},parentSpan:i,fetchSpanAttributes:{"request.backend_service":"voucher-validation-service","request.backend_action":"voucher-details",voucherCode:r}})];case 1:return[2,u.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){O(i,r,o,a,u,"next",e)}function u(e){O(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,g.Z)().fetch,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,(0,u.O)()),o=[i.Z["voucher.details"],n];return(0,a.Z)(o,h,function(){return _(n,o,r)},t)}},536136:function(e,t,r){"use strict";r.d(t,{M:function(){return u}});var n=r(827378),o=r(60074),i=r(873241),a=r(52130),u=function(){var e=(0,a.L3)().trackJanusEvent;return{trackAddressFieldEdit:(0,n.useCallback)(function(t,r){try{e(i.z.janusEvent({uiComponentEntities:[i.z.uiComponent({uiComponentName:t,uiComponentLabel:r})]}))}catch(e){(0,o.Tb)(e,{tags:{event:"CheckoutAddress_Edit_Address_InputField_Type",component:"useCheckoutAddressEditFieldSnowplowEvent"}})}},[e])}}},131571:function(e,t,r){"use strict";r.d(t,{q:function(){return u}});var n=r(827378),o=r(60074),i=r(778051),a=r(52130),u=function(){var e=(0,a.L3)().trackJanusEvent;return{trackAddressErrorMessage:(0,n.useCallback)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var r=i.S;e(r.janusEvent({event:r.event({systemMessage:null!=t?t:null})}))}catch(e){(0,o.Tb)(e,{tags:{event:"CheckoutAddress_ErrorMessage_SystemAction",component:"useCheckoutAddressErrorMessageSnowplowEvent"}})}},[e])}}},739968:function(e,t,r){"use strict";r.d(t,{B:function(){return u}});var n=r(827378),o=r(60074),i=r(929292),a=r(52130),u=function(){var e=(0,a.L3)().trackJanusEvent;return{trackZipcodeInvalid:(0,n.useCallback)(function(t){try{var r=i.s;e(r.janusEvent({event:r.event({systemMessage:"zipcode_invalid:".concat(t)})}))}catch(e){(0,o.Tb)(e,{tags:{event:"CheckoutAddress_ZipcodeInvalid_SystemAction",component:"useCheckoutAddressZipcodeInvalidSnowplowEvent"}})}},[e])}}},267273:function(e,t,r){"use strict";r.r(t),r.d(t,{defaultConfig:function(){return c}});var n,o,i=r(76898),a=r(543790),u=r(411941),c={isNoPolicyCheckbox:!0,isAutomaticPolicyAgreement:!1,showEasilyCancelTermsAndConditions:!1,translationKey:u.gj,giftCardCheckoutTermsEnabled:!1,nonRecurrentProductsCheckEnabled:!1,complianceTranslationKey:"",autoRenewalTranslationKey:"",useStateBasedDrawerDisplay:!1,complianceStates:[]},l=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},c),o=o={overrides:[{systemCountry:i.Rc[a.Z.hellofresh].DE,values:{isAutomaticPolicyAgreement:!0}},{systemCountry:i.Rc[a.Z.hellofresh].AT,values:{isAutomaticPolicyAgreement:!0}},{systemCountry:i.Rc[a.Z.hellofresh].US,values:{isNoPolicyCheckbox:!1,showEasilyCancelTermsAndConditions:!0,translationKey:u.Iu,giftCardCheckoutTermsEnabled:!0,nonRecurrentProductsCheckEnabled:!0,complianceTranslationKey:u.eS,autoRenewalTranslationKey:u.nd,useStateBasedDrawerDisplay:!0,complianceStates:["NY","CA"]}},{systemCountry:[i.Rc[a.Z.everyplate].US,i.Rc[a.Z.greenchef].US],values:{complianceTranslationKey:u.eS}},{systemCountry:[i.Rc[a.Z.factor].US],values:{complianceTranslationKey:u.eS,autoRenewalTranslationKey:u.qK}}]},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n);t.default=l},504009:function(e,t,r){"use strict";r.d(t,{CD:function(){return d},D0:function(){return c},Ds:function(){return s},Rj:function(){return l}});var n,o=r(575085),i=r(267273);function a(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var u=(0,o.Z)("checkout-terms-and-conditions-feature.config",(n=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(e){return[2,Promise.resolve().then(r.bind(r,267273))]})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function u(e){a(i,r,o,u,c,"next",e)}function c(e){a(i,r,o,u,c,"throw",e)}u(void 0)})})),c=u.ProjectConfigProvider,l=u.configMiddleware,s=u.useConfig,d=function(){try{return s()}catch(e){return i.defaultConfig}}},411941:function(e,t,r){"use strict";r.d(t,{BY:function(){return v},FI:function(){return u},Iu:function(){return l},aV:function(){return y},eS:function(){return s},gj:function(){return c},l0:function(){return i},nd:function(){return d},q5:function(){return b},qK:function(){return f},rq:function(){return a},tA:function(){return h},tb:function(){return p}});var n,o,i="features.checkout-terms-and-conditions",a="checkout.terms-and-conditions.gift-card",u="checkout.terms-and-conditions.non-recurrent",c="checkout.terms-and-conditions.description.INTL",l="checkout.terms-and-conditions.us",s="checkout.terms-and-conditions.compliance",d="checkout.terms-and-conditions.hf-us-auto-renewal",f="checkout.terms-and-conditions.factor-auto-renewal",p="checkout.terms-and-conditions.loyalty-disclaimer",v="checkout.terms-and-conditions.loyalty-terms-conditions",y=(o='By clicking "{{ctaButtonText}}" I accept <a href="/about/termsandconditions" target="_blank" rel="noopener" id="termsandconditions">Terms and Conditions</a>, the <a href="/about/privacy" target="_blank" rel="noopener" id="privacypolicy">Privacy Policy</a>, and, unless I cancel, the weekly auto-renewal price at {{productPriceWithShipping}} after my discount period ends. I can cancel anytime in my account at least 5 days before my next delivery.',d in(n={})?Object.defineProperty(n,d,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[d]=o,n),h="hf_ssr_e_gift_card_purchase",b="hf_ssr_e_gift_card_checkout"},46885:function(e,t,r){"use strict";r.d(t,{U:function(){return n}});var n={DISMISSED:"APPLEPAY_DISMISSED",ADDRESS_EMPTY:"APPLEPAY_ADDRESS_EMPTY_ERR",ADDRESS_EMPTY_NAME:"APPLEPAY_ADDRESS_EMPTY_NAME_ERR",ADDRESS_ZIPCODE_VALIDATION:"APPLEPAY_ADDRESS_ZIPCODE_VALIDATION_ERR",ADDRESS_INCOMPLETE:"APPLEPAY_ADDRESS_INCOMPLETE_ERR",ADDRESS_PHONE_INVALID:"APPLEPAY_ADDRESS_PHONE_INVALID_ERR",REGISTRATION_FAILED:"REGISTRATION_FAILED"}},809197:function(e,t,r){"use strict";r.d(t,{p:function(){return n}});var n=function(){try{return!!(window.ApplePaySession&&ApplePaySession.canMakePayments())}catch(e){return!1}}},209660:function(e,t,r){"use strict";r.d(t,{E:function(){return u}});var n=r(630820),o=r(76898),i=/^\+[1-9]\d{1,14}$/,a=function(e){var t=n.Z8.find(function(t){var r=(0,n.ow)(t);return(null==r?void 0:r.iso2.toUpperCase())===e.toUpperCase()});if(!t)return null;var r=(0,n.ow)(t);return(null==r?void 0:r.dialCode)||null},u=function(e,t){if(!e)return null;var r,n,u=e.replace(/[^\d+]/g,"");if(!u)return null;try{r=(0,o.bP)(t)}catch(e){return null}var c=a(r);if(!c)return null;if(u.startsWith("+"))n=u;else{var l=u.startsWith("0")?u.slice(1):u;n="+".concat(c).concat(l)}return!i.test(n)||n.length<10?null:n}},490697:function(e,t,r){"use strict";r.d(t,{W:function(){return a}});var n=r(827378),o=r(567921),i=r.n(o),a=function(e){var t=e.origin,r=e.appliedVoucherCode,o=(0,n.useMemo)(function(){return i().get("origin_metadata")},[]),a={};return"string"==typeof o&&(a=JSON.parse(o)),{origin:void 0===t?"website-registered":t,source:"utm_source"in a?a.utm_source:"",medium:"utm_medium"in a?a.utm_medium:"",campaign:"utm_campaign"in a?a.utm_campaign:"",content:"utm_content"in a?a.utm_content:"",term:"utm_term"in a?a.utm_term:"",jtbd:"jtbd"in a?a.jtbd:"",path:window.location.pathname,voucher:r||"",timestamp:"".concat(new Date().toISOString().slice(0,-5),"Z")}}},186229:function(e,t){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,void 0);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 r(e,void 0)}}(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.")}()}t.Z=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t){var r,o;return r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,t),o=o={overrides:n(e.overrides||[]).concat(n(t.overrides||[]))},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r},{})}},230379:function(e,t,r){"use strict";function n(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function o(e){return i.apply(this,arguments)}function i(){var e;return e=function(e){var t;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(r){switch(r.label){case 0:return t=new TextEncoder().encode(e),[4,crypto.subtle.digest("SHA-256",t)];case 1:return[2,Array.from(new Uint8Array(r.sent())).map(function(e){return e.toString(16).padStart(2,"0")}).join("")]}})},(i=function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function u(e){n(a,o,i,u,c,"next",e)}function c(e){n(a,o,i,u,c,"throw",e)}u(void 0)})}).apply(this,arguments)}r.d(t,{k:function(){return o}})},546138:function(e,t,r){"use strict";r.d(t,{c:function(){return n}});var n="hf_qs_variant_ids"},704802:function(e,t,r){"use strict";r.d(t,{F1:function(){return n},Tt:function(){return a},YA:function(){return c},Yx:function(){return l},Zz:function(){return s},eN:function(){return i},q6:function(){return u},tN:function(){return o}});var n="partner_referral_token",o="partner",i="partner-referral",a="c",u="VirtaHealthKetoPartnership",c="VirtaHealth",l=["1028","1043"],s="/contact"},867356:function(e,t,r){"use strict";r.d(t,{KB:function(){return u}});var n=r(463171),o=r(783244),i=r(200770);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var u=function(){var e,t=(0,i.Z)(),r=(0,n.Z)("rtevms-2965-virtahealth-referral",{country:t}),u=r.isEnabled,c=r.isReady,l=(function(e){if(Array.isArray(e))return e}(e=(0,o.Z)("hf_virtahealth_referral_enabled"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return a(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return{isEnabled:c&&u||"true"===l,isReady:c}}},841723:function(e,t,r){"use strict";r.d(t,{v:function(){return c}});var n,o=r(57502),i=r(26730);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=(a(n={},i.Z.US,o.XA),a(n,i.Z.ER,o.XA),a(n,i.Z.MR,o.XA),a(n,i.Z.FJ,o.XA),a(n,i.Z.AU,o.vm),a(n,i.Z.AO,o.vm),a(n,i.Z.YE,o.vm),a(n,i.Z.GB,o.RK),a(n,i.Z.GN,o.RK),a(n,i.Z.CA,o.wo),a(n,i.Z.CK,o.wo),a(n,i.Z.CF,o.wo),a(n,i.Z.NL,o.fS),a(n,i.Z.GQ,o.fS),a(n,i.Z.TT,o.fS),a(n,i.Z.BE,o.tL),a(n,i.Z.TO,o.tL),a(n,i.Z.SE,o.Pb),a(n,i.Z.TV,o.Pb),a(n,i.Z.DK,o.je),a(n,i.Z.TK,o.je),a(n,i.Z.DE,o.t1),a(n,i.Z.TZ,o.t1),a(n,i.Z.AT,o.E8),a(n,i.Z.CH,o.Wg),a(n,i.Z.ES,o.G$),a(n,i.Z.FR,o.kn),a(n,i.Z.IE,o.GO),a(n,i.Z.IT,o.CZ),a(n,i.Z.LU,o.Pj),a(n,i.Z.NO,o.qT),a(n,i.Z.NZ,o.FT),n),c=function(e,t){var r=u[t];return!!r&&r.test(e)}},231140:function(e,t,r){"use strict";r.d(t,{Z:function(){return w}});
1var n=r(687800),o=r(827378),i=r(581340),a=r(141323),u=r(953137),c=r(64294),l=r(200770),s=r(24165),d=r(874123),f=r(497249),p=r(344884),v=r(587018),y=r(479922),h=function(e){var t=new Date(e||"");return Math.round((new Date().getTime()-t.getTime())/864e5)||-1};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(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 O=function(){return console.warn("Sprig environment id not set for this market. Please add it in the @/libs/sprig/config")},_={track:O,setAttribute:O,setAttributes:O,setUserId:O},S=function(e){var t,b,O=e.children,S=e.whitelist,w=(0,d.C)(),P=(0,i.t)().query,k=(0,l.Z)(),I=(0,v.RN)(),A=I.environmentId,j=I.usePrefixInUserId,Z=(0,a.j)({},{suspense:!1}).data,E=(0,s.Z)(),x=g((0,o.useState)(!1),2),C=x[0],D=x[1],T=g((0,o.useState)(!1),2),R=T[0],U=T[1],M=(0,u.u)({},{suspense:!1}).data,N=!S||S.includes(k),z=(0,f.T)(),q=(0,o.useMemo)(function(){return P.subsriptionId?((null==M?void 0:M.items)||[]).find(function(e){return e.id===P.subscriptionId}):((null==M?void 0:M.items)||[])[0]},[null==M?void 0:M.items,P.subscriptionId,P.subsriptionId]),F=(0,o.useRef)(_);return(0,o.useEffect)(function(){A&&N&&!w.isCypress&&r.e(10775).then(r.bind(r,810775)).then(function(e){var t=e.sprig,r=z.startSpan("sprig-sdk-configure");try{F.current=t.configure({environmentId:A}),U(!0),r.setStatus({code:p.Z.OK}),r.end()}catch(e){r.setStatus({code:p.Z.ERROR,message:(null==e?void 0:e.message)||"Failed to configure Sprig SDK"}),r.recordException(e),r.end(),F.current=_}}).catch(function(e){var t=z.startSpan("sprig-sdk-load-error");t.setStatus({code:p.Z.ERROR,message:(null==e?void 0:e.message)||"Failed to load Sprig SDK"}),t.recordException(e),t.end(),F.current=_})},[A,N,w.isCypress,z]),(0,o.useEffect)(function(){if(R){var e=z.startSpan("sprig-set-attributes");try{var t={};if(Z){t.loyaltyLevel=Z.boxesReceived,F.current.setUserId(j?"".concat(k,"-").concat(Z.id):Z.id);var r,n=null==Z?void 0:null===(r=Z.freeAddOnSubscriptions)||void 0===r?void 0:r.find(function(e){return e.subscriptionId===Z.activeSubscriptionId});t.isFreeForLifeEnabled=(null==n?void 0:n.isEnabled)&&!(null==n?void 0:n.isRevoked)}else{var o,i=(null==E?void 0:null===(o=E.user_data)||void 0===o?void 0:o.id)||(0,c.ZP)();F.current.setUserId(i)}q&&(t.couponCode=q.couponCode,t.daysSinceCancellation=h(q.canceledAt),t.reactivationCount=q.reactivationCount),Z&&q&&F.current.setAttributes(m({},{country:k},t)),e.setStatus({code:p.Z.OK}),e.end()}catch(t){e.setStatus({code:p.Z.ERROR,message:(null==t?void 0:t.message)||"Failed to set Sprig user attributes"}),e.recordException(t),e.end()}finally{Z&&q&&D(!0)}}},[k,Z,q,E,M,R,j,z]),(0,n.tZ)(y.u.Provider,{value:(t=m({},F.current),b=b={attributesReady:C,isConfigured:R},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(b)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(b)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(b,e))}),t),children:O})},w=function(e){var t=e.children,r=e.whitelist;return(0,n.tZ)(v.pL,{children:(0,n.tZ)(S,{whitelist:r,children:t})})}},587018:function(e,t,r){"use strict";r.d(t,{pL:function(){return Z},RN:function(){return E}});var n,o,i,a=r(186229),u=r(575085),c=r(175010),l=r(396887),s=r(26730),d=r(543790);function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p="GF_ykPoRt",v="cj6iriK8oJ1t",y="usNrlBRd54Ak",h="PCy8gvXsqXW9",b=(f(o={},s.Z.US,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.NZ,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.NL,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.DE,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.AU,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.AT,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.BE,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.CA,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.CH,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.DK,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.ES,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.FR,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.GB,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.IE,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.IT,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.LU,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.NO,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.SE,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.JP,{environmentId:p,brand:d.Z.hellofresh,usePrefixInUserId:!1}),f(o,s.Z.FJ,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.CF,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.TZ,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.TK,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.TO,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.TT,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.TV,{environmentId:v,brand:d.Z.factor,usePrefixInUserId:!0}),f(o,s.Z.YE,{environmentId:"XCtjD1EGk7aG",brand:d.Z.youfoodz,usePrefixInUserId:!0}),f(o,s.Z.KN,{environmentId:"F7ACw6BrPffA",brand:d.Z.petstable,usePrefixInUserId:!0}),f(o,s.Z.MR,{environmentId:"9dT5etAktWTR",brand:d.Z.goodchop,usePrefixInUserId:!0}),f(o,s.Z.CG,{environmentId:y,brand:d.Z.greenchef,usePrefixInUserId:!0}),f(o,s.Z.GN,{environmentId:y,brand:d.Z.greenchef,usePrefixInUserId:!0}),f(o,s.Z.GQ,{environmentId:y,brand:d.Z.greenchef,usePrefixInUserId:!0}),f(o,s.Z.ER,{environmentId:h,brand:d.Z.everyplate,usePrefixInUserId:!0}),f(o,s.Z.AO,{environmentId:h,brand:d.Z.everyplate,usePrefixInUserId:!0}),f(o,s.Z.CK,{environmentId:"j4AQHkHZUQpU",brand:d.Z.chefsplate,usePrefixInUserId:!0}),o),m=(0,c.Z)("systemCountry",b,void 0,{serverEnv:[l.Xe.staging,l.Xe.local]});function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O="YrX2rPQTtq",_="x7LUly6nqa9D",S="_AqtdbkFbKjJ",w="4J3CjyUyCdM4",P=(g(i={},s.Z.US,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.NZ,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.NL,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.DE,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.AU,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.AT,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.BE,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.CA,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.CH,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.DK,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.ES,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.FR,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.GB,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.IE,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.IT,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.LU,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.NO,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.SE,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.JP,{environmentId:O,brand:d.Z.hellofresh,usePrefixInUserId:!1}),g(i,s.Z.FJ,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.CF,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.TZ,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.TK,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.TO,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.TT,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.TV,{environmentId:_,brand:d.Z.factor,usePrefixInUserId:!0}),g(i,s.Z.YE,{environmentId:"zW9ESwpgNtss",brand:d.Z.youfoodz,usePrefixInUserId:!0}),g(i,s.Z.KN,{environmentId:"2mLA-ZKNqNso",brand:d.Z.petstable,usePrefixInUserId:!0}),g(i,s.Z.MR,{environmentId:"-gPGMIBCOpxk",brand:d.Z.goodchop,usePrefixInUserId:!0}),g(i,s.Z.CG,{environmentId:S,brand:d.Z.greenchef,usePrefixInUserId:!0}),g(i,s.Z.GN,{environmentId:S,brand:d.Z.greenchef,usePrefixInUserId:!0}),g(i,s.Z.GQ,{environmentId:S,brand:d.Z.greenchef,usePrefixInUserId:!0}),g(i,s.Z.ER,{environmentId:w,brand:d.Z.everyplate,usePrefixInUserId:!0}),g(i,s.Z.AO,{environmentId:w,brand:d.Z.everyplate,usePrefixInUserId:!0}),g(i,s.Z.CK,{environmentId:"h_QaElrA-Dd3",brand:d.Z.chefsplate,usePrefixInUserId:!0}),i),k=(0,c.Z)("systemCountry",P,void 0,{serverEnv:l.Xe.live});function I(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var A=(0,a.Z)(m,k),j=(0,u.Z)("hf.sprig-configuration",(n=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(e){return[2,A]})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){I(i,r,o,a,u,"next",e)}function u(e){I(i,r,o,a,u,"throw",e)}a(void 0)})})),Z=j.ProjectConfigProvider,E=(j.configMiddleware,j.useConfig)},75850:function(e,t,r){"use strict";function n(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function o(e,t,r){return(o=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&a(o,r.prototype),o}).apply(null,arguments)}
1function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return o(e,arguments,i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,e)})(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}r.d(t,{Fb:function(){return d},NO:function(){return l}});var l=function(e){function t(){var e,r,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=i(e),(n=c()?Reflect.construct(e,r||[],i(this).constructor):e.apply(this,r))&&("object"==(n&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof n)?n:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,e),t}(u(Error));function s(){var e;return e=function(e){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t,r){return setTimeout(t,e)})];case 1:throw t.sent(),new l("Timed out after ".concat(e," ms."))}})},(s=function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function u(e){n(a,o,i,u,c,"next",e)}function c(e){n(a,o,i,u,c,"throw",e)}u(void 0)})}).apply(this,arguments)}function d(e,t){return Promise.race([t,function(e){return s.apply(this,arguments)}(e)])}},70258:function(e,t,r){"use strict";
1var n=r(567921),o=r.n(n),i=r(435172),a=r(695743);t.Z=function(){var e,t,r,n,u=(0,a.z)("website").data,c=(null==u?void 0:null===(e=u.checkout)||void 0===e?void 0:e.seasonalProductSkus)||[],l=o().get("hf_cart_id")||"",s=(0,i.P)({id:l},{enabled:!!l,suspense:!1}).data;return{isSeasonalFlow:!!((null!==(n=null==s?void 0:null===(t=s.items)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0&&(null==s?void 0:null===(r=s.items)||void 0===r?void 0:r.every(function(e){return c.includes(e.sku)})))}}},303204:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return rs},default:function(){return rd}});var n,o,i=r(687800),a=r(31748),u=r(164949),c=r(184883),l=r(827378),s=r(768587),d=r(863626),f=r(96965),p=r(165218),v=r.n(p),y={AddressFormContainer:v()(function(){return Promise.all([r.e(95067),r.e(34908),r.e(96769),r.e(37384),r.e(26742),r.e(59658),r.e(2669),r.e(24804),r.e(24284),r.e(19950),r.e(60743),r.e(59336)]).then(r.bind(r,850927))},{loadableGenerated:{webpack:()=>[850927]}}),ExpressCheckoutComponentContainer:v()(function(){return Promise.all([r.e(63463),r.e(70788),r.e(10196),r.e(38584),r.e(68074),r.e(75182),r.e(88130),r.e(37384),r.e(59658),r.e(10218),r.e(68873),r.e(19950),r.e(49183)]).then(r.bind(r,868802))},{loadableGenerated:{webpack:()=>[868802]}}),OrderSummaryContainer:v()(function(){return Promise.all([r.e(13296),r.e(10447),r.e(72232),r.e(59658),r.e(34200),r.e(67206),r.e(36934)]).then(r.bind(r,925802))},{loadableGenerated:{webpack:()=>[925802]}}),DeliverySummaryContainer:v()(function(){return Promise.all([r.e(95067),r.e(34908),r.e(26742),r.e(24804),r.e(24284),r.e(17507)]).then(r.bind(r,21249))},{loadableGenerated:{webpack:()=>[21249]}}),PaymentFormContainer:v()(function(){return Promise.all([r.e(63463),r.e(70788),r.e(10196),r.e(34908),r.e(38584),r.e(75182),r.e(88130),r.e(59658),r.e(10218),r.e(34200),r.e(68873),r.e(60743),r.e(98844)]).then(r.bind(r,990586))},{loadableGenerated:{webpack:()=>[990586]}}),ValuePropositionContainer:v()(function(){return r.e(19418).then(r.bind(r,219418))},{loadableGenerated:{webpack:()=>[219418]}}),OrderSummaryMobileContainer:v()(function(){return Promise.all([r.e(13296),r.e(10447),r.e(72232),r.e(59658),r.e(34200),r.e(67206),r.e(73887)]).then(r.bind(r,173887))},{loadableGenerated:{webpack:()=>[173887]}}),DeliveryDetailsDesktopContainer:v()(function(){return Promise.all([r.e(95067),r.e(26742),r.e(24804),r.e(22207)]).then(r.bind(r,867714))},{loadableGenerated:{webpack:()=>[867714]}})},h=r(204534),b=r(449301),m=r(651507),g=function(){return(0,i.tZ)(s.xu,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"300px",children:(0,i.tZ)(s.$j,{size:"lg",variant:"primary"})})},O=function(e,t,r){if(e===h.hI.NONE)return null;if(e===h.hI.SIMPLE){var n=t.simpleTextTranslationKey;return n?{component:"SimpleTextDisclaimer",props:{id:"".concat(r,"-disclaimer-simple-text"),translationKey:n}}:null}if(e===h.hI.SHOW_MORE){var o=t.openTranslationKey,i=t.closeTranslationKey,a=t.seeMoreTranslationKey;return o&&i&&a?{component:"ShowMoreDisclaimer",props:{id:"".concat(r,"-disclaimer-show-more"),openTranslationKey:o,closeTranslationKey:i,seeMoreTranslationKey:a}}:null}return null},_=r(553911),S=r(783045),w=r(713113),P=r(164528),k=function(e){var t=e.translationKey,r=e.id,n=(0,S.LU)().isHelloFreshTheme,o=(0,(0,P.ZP)(w.l3).translateRaw)(t);return(0,i.tZ)(i.HY,{children:(0,i.tZ)(s.xu,{mb:"global.sm-1",children:(0,i.tZ)(s.xv,{as:"p","data-test-id":r,type:["body-xs-regular","body-sm-regular"],pseudo:{"& a":{color:"alias.interactive.foreground.default",fontWeight:n?"body-bold":"body-regular",textDecoration:"underline"},"& a:hover":{textDecoration:"none"}},children:(0,i.tZ)(_.Z,{copy:o,hasMarkdown:!0})})})})},I=r(878250);function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var j=function(e){var t=e.step,r=(0,f.v7)().disclaimerConfig,n=null==r?void 0:r.pages[t];if(!r||!n)return null;var o=O(n,r,t);return o?"SimpleTextDisclaimer"===o.component?(0,i.tZ)(s.xu,{flexDirection:"column",paddingTop:"global.sm-2",paddingBottom:["global.md-2","global.sm-2"],px:["global.sm-2","global.md-2"],maxWidth:"1200px",children:(0,i.tZ)(k,A({},o.props))}):"ShowMoreDisclaimer"===o.component?(0,i.tZ)(s.xu,{flexDirection:"column",paddingTop:"global.sm-2",paddingBottom:["global.md-2","global.sm-2"],px:["global.sm-2","global.md-2"],maxWidth:"1200px",children:(0,i.tZ)(I.Z,A({},o.props))}):null:null},Z=r(200770),E=r(26730),x=function(e){var t=e.isRenderedOnPaymentPage,r=(0,Z.Z)()===E.Z.US,n=(0,P.ZP)("senf-footer").translate,o=(0,f.v7)().isCTAStickyOnPaymentPage,a=(0,d.W)().isMobile,u=n("senf-footer.hellofresh");return(0,i.tZ)(s.xu,{display:"flex",justifyContent:"center",marginTop:r?"global.none":["global.sm-2","global.md-2"],marginBottom:a&&o&&void 0!==t&&t?"global.xxl":"global.sm-2",children:(0,i.BX)(s.xv,{textAlign:"center","data-test-id":"hellofresh-copyright-text",type:"body-sm-bold",color:"shared-alias.neutral.foreground.default",children:[(0,i.BX)(s.xv,{as:"span",type:"body-sm-regular",children:["\xa9"," "]}),u," ",new Date().getFullYear()]})})}
1,C=r(169821),D=r(798714),T=r(802017),R=r(952274),U=r(318066),M=r(783244),N=r(268481),z=r(497249),q=r(887824),F=function(e){var t=e.isMobile,r=e.isOpen,n=e.children,o=(0,l.useRef)(null);return n?t?(0,i.tZ)(s.dy.Container,{placement:"bottom",isOpen:r,returnFocusRef:o,isModal:!0,"data-test-id":"ndd-delivery-warning",width:"100%",paddingY:"sm-2",paddingX:"sm-2",hideCloseButton:!0,children:n}):(0,i.tZ)(s.Vq,{isOpen:r,headless:!0,hasCloseButton:!1,"data-test-id":"ndd-delivery-warning",children:n}):null},L=r(581340),B=r(229714);function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(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 V=function(){var e=(0,P.ZP)("checkout").translate,t=(0,q.Z)().push,r=H((0,M.Z)("hf_ndd_delivery_warning"),3),n=r[0],o=r[1],a=r[2],u=H((0,M.Z)("hf_first_delivery_date"),3),c=u[0],d=u[2],f=H((0,M.Z)("hf_cutoff_date"),1)[0],p=H((0,M.Z)("hf_stored_zipcode"),1)[0],v=(0,D.SZ)(),y=v.cutoffTimeOffsetMinutes,b=v.timezone,m=v.isNddEnabled,g="mobile"===(0,N.Sj)(),O=(0,L.t)(),_=O.query,S=O.push,w=new Date(f).getTime(),k=6e4*Number(y),I=H((0,T.Gj)(w-k,b),4)[3],A=(0,z.T)().startSpan("next-day-delivery.checkout"),j=(0,R.o)().trackNddMissedModalImpression,Z=function(){var e=document.querySelector('[data-test-id="delivery-details-desktop-container"] button');e&&e.click()};return((0,l.useEffect)(function(){m&&I&&(0,B.ix)(c)&&(0,D.DG)(c,b)&&(o("true"),A.setAttribute("ndd_action","cutoff_pop_up_shown"),A.end(),t({event:"gaEventTrigger",event_name:"CheckoutAddress_NextDayDeliveryMissed",brand:"HelloFresh",tribe:"Conversions",screen:"Checkout address form",gaEventCategory:"funnel",gaEventAction:"missedCutOffNDD",gaEventLabel:"[]"}),j())},[t,A,m,I,p,o,c,b]),m&&"true"===n)?(0,i.tZ)(s.xu,{children:(0,i.tZ)(F,{isMobile:g,isOpen:"true"===n,children:(0,i.BX)(s.xu,{textAlign:"center",children:[(0,i.tZ)(s.xu,{children:(0,i.tZ)(U.ZP,{src:"/hellofresh_website/ndd/ndd-delivery-warning.svg",width:104,height:104,alt:"ndd-image"})}),(0,i.BX)(s.xu,{my:"md-1",textAlign:g?"left":"center",children:[(0,i.tZ)(s.xu,{mb:"sm-2",children:(0,i.tZ)(s.xv,{as:"h3",children:e("checkout.ndd.delivery.warning.heading")})}),(0,i.tZ)(s.xu,{children:(0,i.tZ)(s.xv,{type:"body-md-regular",children:e("checkout.ndd.delivery.warning.subheading",{date:(0,D.gN)(c)})})})]}),(0,i.tZ)(s.zx.Primary,{onClick:function(){o("false"),a(),d(),g&&_.step!==h.T3.delivery?(_.step=h.T3.delivery,S({pathname:"/checkout",query:_},void 0,{shallow:!0}).then(function(){Z()})):Z()},"data-test-id":"ndd-delivery-warning-cta",children:e("checkout.ndd.delivery.warning.cta.change")})]})})}):null},G=r(70258),Y=function(e){var t=e.applangaPrefix,r=e.el,n=(0,P.ZP)("lego-checkout").translateRaw,o=(0,G.Z)().isSeasonalFlow&&2===r;return(0,i.BX)(s.xu,{width:["100%","33.33333%"],"data-test-id":"lego-checkout-FAQItem".concat(r),children:[(0,i.tZ)(s.xu,{my:"sm-2",children:(0,i.tZ)(s.xv,{as:"h4",children:(0,i.tZ)(_.Z,{copy:n("".concat(t,".title.item-").concat(r)),hasMarkdown:!0})})}),(0,i.tZ)(s.xu,{mb:"sm-2",children:(0,i.tZ)(s.xv,{type:"body-md-regular",children:(0,i.tZ)(_.Z,{copy:n("".concat(t,".text.item-").concat(r).concat(o?".seasonal":"")),hasMarkdown:!0})})})]})},W=[1,2,3],Q=function(e){var t=e.applangaPrefix,r=(0,P.ZP)("lego-checkout").translate;return(0,i.tZ)(s.xu,{backgroundColor:"alias.elevation.level-1",pb:["global.lg-1","global.none"],"data-test-id":"lego-checkout-FAQs-section",children:(0,i.tZ)(s.xu,{mx:"auto",px:["global.xs","global.sm-1","global.none"],maxWidth:["auto","960px","1144px"],children:(0,i.BX)(s.xu,{py:["global.sm-2","global.sm-2"],px:["global.sm-2","global.none"],children:[(0,i.tZ)(s.xv,{as:"h3",textAlign:"center",my:"global.sm-2",children:r("".concat(t,".title"))}),(0,i.tZ)(s.xu,{display:"flex",flexDirection:["column","row"],justifyContent:["inherit","center"],columnGap:"global.md-2",rowGap:"global.sm-1",children:W.map(function(e){return(0,i.tZ)(Y,{applangaPrefix:t,el:e},e)})})]})})})},$=r(718583),X=r(408558),J=r(37017),ee=r(876808),et=r(295332),er=r(431113),en=r(907567);function eo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ei(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eo(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 ea=function(){var e=(0,z.T)(),t=(0,X.iQ)(),r=(0,en.W)({},{suspense:!1}).data,n=ei((0,J.KO)(er.mP),1)[0],o=ei((0,J.KO)(ee.tu),1)[0],i=(0,l.useMemo)(function(){var e;return(null==t?void 0:t.items)&&(null===(e=t.items[0])||void 0===e?void 0:e.sku)||""},[null==t?void 0:t.items]),a=(null==t?void 0:t.voucher)||"",u=(0,l.useMemo)(function(){return o.selectedDeliveryDate?(0,et.Z)(o.selectedDeliveryDate,"YYYY-MM-DD"):""},[o.selectedDeliveryDate]),c=(0,l.useMemo)(function(){return(null==o?void 0:o.selectedDeliveryTime)||""},[null==o?void 0:o.selectedDeliveryTime]),s=(0,l.useMemo)(function(){return i?[{handle:i,deliveryDate:u,deliveryOption:c}]:[]},[i,u,c]),d=(0,l.useMemo)(function(){return n?{address1Street:n.formData.address1,city:n.formData.city,postcode:n.formData.postcode,region:n.formData.region}:void 0},[n]),f=(0,l.useMemo)(function(){return(null==r?void 0:r.id)||0},[null==r?void 0:r.id]),p=(0,l.useMemo)(function(){return{products:s,couponCode:a,customerID:f,shippingAddress:d}},[s,a,d,f]);(0,l.useEffect)(function(){try{$.ZP.setItem("hf_calculate_payload",JSON.stringify(p))}catch(r){var t;e.startSpan("checkout.local-storage.set-item-failed").setAttributes({"local-storage.key":"hf_calculate_payload","error-message":(null!=(t=Error)&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](r):r instanceof t)?r.message:String(r)}).end()}},[p,e])},eu=r(656938),ec=r(764291),el=r(385613),es=r(570588),ed=r(504009);function ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ep=function(){var e,t,r,n,o=(0,ed.Ds)(),a=o.useStateBasedDrawerDisplay,u=o.complianceStates,c=(0,es.E)().query,d=l.useMemo(function(){return $.ZP.getItem("StoredCouponCode")||(null==c?void 0:c.c)||""},[null==c?void 0:c.c]),f=c.discount_comm_id,p=Array.isArray(f)?f[0]:f,v=(0,ec.Z)().data,y=(null==v?void 0:null===(n=v.plans)||void 0===n?void 0:null===(r=n[0])||void 0===r?void 0:null===(t=r.children)||void 0===t?void 0:t.map(function(e){return e.handle}))||[],h=(0,X.iQ)(),b=l.useMemo(function(){var e;return(null==h?void 0:h.items)&&h.items.length>0?null===(e=h.items[0])||void 0===e?void 0:e.sku:""},[h]),m=(function(e){if(Array.isArray(e))return e}(e=(0,J.KO)(er.mP))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return ef(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ef(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],g=(0,l.useMemo)(function(){return(null==m?void 0:m.formData)?{address1Street:m.formData.address1||"",city:m.formData.city||"",postcode:m.formData.postcode||"",region:m.formData.region||""}:void 0},[null==m?void 0:m.formData]),O=(0,el.T)({voucherCode:d}).isGWPVoucher;return(0,i.tZ)(s.xu,{maxWidth:["100%","960px","1144px"],paddingY:"sm-2",paddingX:["sm-2","xxs","zero"],margin:"auto",children:(0,i.tZ)(eu.Z,{storedVoucherCode:d,discountCommunicationId:p,productSkus:y,defaultSku:b,removePadding:!0,userAddress:g,useStateBasedDrawerDisplay:!O&&a,complianceStates:u})})},ev=function(){return(0,i.tZ)(ed.D0,{children:(0,i.tZ)(ep,{})})},ey=r(190341),eh=r(953137);function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eb(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 eg=function(){var e=em((0,l.useState)(),2),t=e[0],r=e[1],n=em((0,l.useState)(!1),2),o=n[0],i=n[1],a=em((0,l.useState)(!1),2),u=a[0],c=a[1],s=(0,en.W)({},{suspense:!1}).data,d=!!(null==s?void 0:s.id),f=(0,eh.u)({},{suspense:!1,enabled:d}).data;return(0,l.useEffect)(function(){if(f){var e,t=f.items,n=t&&t.length?t.filter(function(e){return!e.canceledAt}):[],o=n.filter(function(e){var t,r,n;return null==e?void 0:null===(n=e.productType)||void 0===n?void 0:null===(r=n.family)||void 0===r?void 0:null===(t=r.tags)||void 0===t?void 0:t.includes("is_mealbox")});r((null===(e=o[0])||void 0===e?void 0:e.productType)||{}),i(!!n.length&&!!o.length),c(!!t.length)}},[f]),{plan:t,hasActiveSub:o,shouldGetSubscriptions:d,hasSubscriptions:u}},eO=r(527157),e_=r(543790),eS=r(112525),ew=r(953142),eP=r(60074),ek=r(553563),eI=r(52130),eA=function(){var e=(0,eI.L3)().trackJanusEvent;return{trackDuplicateAccountPromptImpression:(0,l.useCallback)(function(){try{e(ek.a.janusEvent())}catch(e){(0,eP.Tb)(e,{tags:{event:"CheckoutAddress_Modal_DuplicateAccountPrompt_Impression",component:"useCheckoutAddressDuplicateAccountPromptSnowplowEvent"}})}},[e])}};function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var eZ="/my-account/deliveries/menu",eE=function(){var e,t,r,n,o=function(e){if(Array.isArray(e))return e}(e=(0,l.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return ej(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ej(e,2)}}(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.")}(),a=o[0],u=o[1],c=(0,q.Z)().push,d=(0,P.ZP)("lego-checkout"),p=d.translate,v=d.translateRaw,y=(0,P.ZP)("product-names").translateRaw,h=(0,Z.Z)()===E.Z.US,b=(0,f.v7)(),m=b.allowSubscriptionsModal,g=b.subscriptionModalImageUrl,O=(0,ey.G)().mobileWebView,S=!!(null==O?void 0:O.active),w=eg(),k=w.plan,I=w.hasActiveSub,A=w.hasSubscriptions,j=null==k?void 0:null===(t=k.family)||void 0===t?void 0:t.handle,x=null==k?void 0:null===(r=k.specs)||void 0===r?void 0:r.size,C=null==k?void 0:null===(n=k.specs)||void 0===n?void 0:n.meals,D=y("product-names.".concat(j)),T=(m||h&&S)&&I,R=(0,eO.Z)(),U=(0,eS.H)().code,M=(0,ew.y)(),N=M.isFeatureFlagReady,z=M.shouldUseCheckoutStatusEndpoint,F=M.checkoutRedirect,L=M.isCheckoutStatusFetched,B=eA().trackDuplicateAccountPromptImpression,K=function(){S?window.location.assign("".concat(R,"://my-deliveries?fromCheckout=true").concat(U?"&ac=".concat(U):"")):window.location.assign(R===e_.Z.hellofresh?eZ:"/my-deliveries")};(0,l.useEffect)(function(){if(N){if(z){if(!L)return;if("home"===F){K();return}"reactivation"===F&&window.location.assign("/reactivate");return}T?H():A&&K()}},[N,z,L,F,T,A]);var H=function(){u(!0),c({event:"gaEventTrigger",gaEventCategory:"funnel",gaEventAction:"duplicateSubPopup",gaEventLabel:"view",event_name:"Checkout_DuplicateSubscriptionPopupShow",screen:"Checkout address form"}),B()};return a?(0,i.tZ)(s.Vq,{isOpen:a,"data-test-id":"subscription-modal",headless:!0,hasCloseButton:!1,width:["90vw","50vw"],children:(0,i.BX)(s.xu,{padding:"global.sm-2",children:[g&&(0,i.tZ)(s.xu,{as:"img",src:g,alt:D,"data-test-id":"subscription-image",width:"100%"}),(0,i.BX)(s.xu,{children:[(0,i.tZ)(s.xv,{as:"h3","data-test-id":"subscription-title",my:"global.sm-1",children:p("lego-checkout.subscriptions-modal.title")}),(0,i.tZ)(s.xu,{my:"global.sm-1",children:(0,i.tZ)(s.xv,{"data-test-id":"subscription-body-text",type:"body-md-regular",children:(0,i.tZ)(_.Z,{copy:v("lego-checkout.subscriptions-modal.description",{planName:D,people:x,meals:C}),hasMarkdown:!0})})}),(0,i.tZ)(s.zx.Primary,{size:"sm",onClick:function(){S?window.location.assign("".concat(R,"://my-deliveries")):window.location.assign(eZ)},"data-test-id":"redirect-to-menus-button",children:p("lego-checkout.subscriptions-modal.button-menus-redirect")})]})]})}):(0,i.tZ)(i.HY,{})},ex=r(867356),eC=r(704802),eD=function(e){var t=e.isOpen,r=e.partner,n=e.onDismiss,o=(0,z.T)(),a=(0,P.ZP)("checkout").translateRaw,u="partner-eligibility-".concat(l.useId()),c=r===eC.q6?{message:a("checkout.partner_eligibility.alternate_offer",{brand:eC.YA}),cta:a("checkout.partner_eligibility.alternate_offer_cta"),redirectPath:eC.Zz}:null,d=c?c.message:"",f=c?c.cta:"",p=t&&!!d;return((0,l.useEffect)(function(){if(p)try{o.startSpan("partner-eligibility-dialog-shown",{attributes:{partner:r}}).end()}catch(e){}},[p,r,o]),p&&c)?(0,i.tZ)(s.Vq,{isOpen:!0,"data-test-id":"partner-eligibility-dialog",headless:!0,hasCloseButton:!1,"aria-labelledby":u,confirmButtonText:f,onConfirm:function(){return window.location.assign(c.redirectPath)},onClose:n,onDismiss:n,children:(0,i.tZ)(s.xv,{as:"p",id:u,type:"body-md-regular",textAlign:"center","data-test-id":"partner-eligibility-dialog-message",children:d})}):null},eT=r(830644),eR=r.n(eT),eU=r(727137);function eM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eN=function(){var e=(0,ex.KB)().isEnabled;return(0,l.useMemo)(function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){eM(e,t,r[t])})}return e}({},e&&eM({},eC.q6,eC.Yx))},[e])},ez={suspense:!1,useErrorBoundary:!1,staleTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},eq=function(){var e,t,r=(0,eS.H)(),n=r.code,o=r.checked,i=r.valid,a=r.error,u=eN(),c=Object.keys(u).length>0,l=eR()(a)||""===a?"":String(a),s=!!(c&&o&&!1===i&&l),d=(0,eU.H)({code:n},(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},ez),t=t={enabled:s},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)).data,f=(null==d?void 0:d.partner)||"",p=f&&Object.prototype.hasOwnProperty.call(u,f)&&u[f]||[],v=s&&p.includes(l);return{isIneligible:v,partner:v?f:""}};function eF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eF(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 eB=function(){var e=(0,ex.KB)(),t=e.isEnabled,r=e.isReady,n=eq(),o=n.isIneligible,a=n.partner,u=eL((0,l.useState)(!1),2),c=u[0],s=u[1],d=eL((0,l.useState)(!1),2),f=d[0],p=d[1];return((0,l.useEffect)(function(){o&&!f&&s(!0)},[o,f]),c&&a&&r&&t)?(0,i.tZ)(eD,{isOpen:!0,partner:a,onDismiss:function(){s(!1),p(!0)}}):null},eK=r(10198),eH=r(446159),eV=r(340332),eG=r(617947),eY=r(196334),eW=r(799146),eQ=r(256130);function e$(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eX(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return e$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e$(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 eJ=function(){var e,t,r,n,o,i,a,u,c,s,d,f,p=(0,eI.L3)().trackJanusEvent,v=(0,l.useRef)(!1),y=(0,X.iQ)(),h=(0,en.W)({},{suspense:!1}).data,b=(0,eV.SX)(),m=eX((0,J.KO)(er.mP),1)[0],g=eX((0,J.KO)(ee.tu),1)[0],O=eX((0,M.Z)("hf_prefill_zipcode"),1)[0],_=(null==y?void 0:null===(t=y.items)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.sku)||"",S=(0,eH.M)({sku:_},{enabled:!!(null==y?void 0:null===(n=y.items)||void 0===n?void 0:null===(r=n[0])||void 0===r?void 0:r.sku),suspense:!1}).data,w=(0,eW.B)(eQ.d.ACTIVATION_SUBSCRIPTION),P=$.ZP.getItem("StoredCouponCode"),k=(null==y?void 0:null===(a=y.items)||void 0===a?void 0:null===(i=a[0])||void 0===i?void 0:null===(o=i.metadata)||void 0===o?void 0:o.productFamily)||"",I=(null==y?void 0:null===(s=y.items)||void 0===s?void 0:null===(c=s[0])||void 0===c?void 0:null===(u=c.metadata)||void 0===u?void 0:u.mealsPreset)||"",A=g.selectedDeliveryDate||"",j=g.selectedDeliveryTime||"",Z=(0,eG.Z)(),E=(0,l.useMemo)(function(){return A?(0,et.Z)(A,"YYYY-MM-DD"):""},[A]),x=(0,eK.vr)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({products:[{handle:_,deliveryDate:E,deliveryOption:j,hfWeek:Z}],customerID:(null==h?void 0:h.id)||0,customerUUID:null!==(f=null==h?void 0:h.uuid)&&void 0!==f?f:"",couponCode:(null==y?void 0:y.voucher)||"",shippingAddress:{postcode:m.formData.postcode,address1Street:m.formData.address1Street,city:m.formData.city}},w&&{headers:w}),{enabled:!!(_&&E&&Z&&!(null==g?void 0:g.isLoading)&&(null==g?void 0:g.selectedDeliveryTime)&&(null==g?void 0:g.resolvedForPostcode)===((null==m?void 0:null===(d=m.formData)||void 0===d?void 0:d.postcode)||O||"")),suspense:!1}).data,C=(0,l.useCallback)(function(){if(!v.current&&_&&x&&E){var e=eY.eV.event({systemMessage:"user_starts_checkout",systemStatus:eY.h3.Success}),t=eY.eV.conversion({checkoutIdentifierType:(null==h?void 0:h.uuid)?eY.So.CustomerUuid:eY.So.CustomerPlanId,firstDeliveryDate:E,hasNextDayDelivery:g.isNDDDeliveryPresent||!1}),r=eY.eV.ecommerceProduct({productCategory:k,productName:(null==S?void 0:S.productName)||"",productPreference:I,productSku:_}),n=eY.eV.ecommercePrice({currency:b,productPrice:x.subTotal||0,productPriceInclDiscount:(x.subTotal||0)-(x.discountAmount||0),productSku:_,shippingPrice:x.shippingAmount||0,shippingPriceInclDiscount:(x.shippingAmount||0)+(x.shippingDiscountAmount||0),totalOrderPrice:Number(((x.subTotal||0)+(x.shippingAmount||0)).toFixed(2)),totalOrderPriceInclDiscount:x.grandTotal||0}),o=eY.eV.voucher({voucherCode:P||""});p(eY.eV.janusEvent({event:e,conversion:t,ecommerceProductEntities:[r],ecommercePriceEntities:[n],voucherEntities:[o]})),v.current=!0}},[_,x,E,g.isNDDDeliveryPresent,null==h?void 0:h.uuid,k,null==S?void 0:S.productName,I,b,P,p]);(0,l.useEffect)(function(){C()},[C])},e0=r(440492),e1=r(966622),e2=r(943701),e8=function(){var e=(0,L.t)().query,t=(0,e1.py)({runUsingStatsig:!0}).track,r=(0,e2.R)({runUsingStatsig:!0}),n=r.id,o=r.attributes,i=(0,Z.Z)(),a=(0,eO.Z)(),u=(0,eS.H)().code,c=(0,X.iQ)(),s=(0,l.useMemo)(function(){var e;return(null==c?void 0:c.items)&&c.items.length>0?null===(e=c.items[0])||void 0===e?void 0:e.sku:""},[c]),d=(0,e0.W)({country:i,code:u,products:[s],customer_id:Number(n)||0},{enabled:!!s&&!!u&&!!n,suspense:!1}),f=d.status,p=d.isFetched,v=(null==e?void 0:e.step)&&"string"==typeof e.step?e.step.toUpperCase():"ADDRESS",y=(0,l.useRef)(new Set);(0,l.useEffect)(function(){if(p&&n&&f&&"loading"!==f){var e="".concat(v,":").concat(u);y.current.has(e)||(t({eventName:"VOUCHER_APPLIED_".concat(v),experimentationUserId:n,experimentationUserAttributes:o,eventTags:{voucher_code:u,voucher_status:f,brand:a,country:i}}),y.current.add(e))}},[f,p,n,o,t,u,v,a,i])},e3=r(180686),e7=r(503177),e4=r(671718),e6=r(407108),e5=r(699219);function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function te(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var tt=(n=function(e,t){var r,n,o,i=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(a){switch(a.label){case 0:var u,c;return r=i.length>2&&void 0!==i[2]?i[2]:e4.Z,n=e.variant_ids,[4,r("/questionnaire/funnels/response",t,(u=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({method:"POST",headers:{"Content-Type":"application/json"},data:o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["variant_ids"])},(null==n?void 0:n.length)&&{query:{variant_id:function(e){if(Array.isArray(e))return e9(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return e9(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e9(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}),c=c={fetchSpanAttributes:{"request.backend_service":"questionnaire-service","request.backend_action":"submit-funnel-response",funnel_id:o.funnel_id,customer_uuid:o.customer_uuid}},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(c)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(c)).forEach(function(e){Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(c,e))}),u))];case 1:return[2,a.sent().ok]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){te(i,r,o,a,u,"next",e)}function u(e){te(i,r,o,a,u,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),tr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[e5.Z["questionnaire.funnel-response"]];return(0,e6.Z)(t,function(e,r){return tt(r,t,e)},e)},tn=r(329006),to=r(808215),ti=r(344884),ta=function(e,t,r){var n=e.map(function(e){var r,n=t.find(function(t){return t.preferenceName===e});return{preference_name:e,preference_text:(null==n?void 0:null===(r=n.content)||void 0===r?void 0:r.title)||""}});if(n.some(function(e){return!e.preference_name||!e.preference_text})){var o=r.startSpan("questionnaire.generatePreferenceResponse",{attributes:{selectedPreferences:e,preferences:t.map(function(e){return e.preferenceName}),preferenceTitles:t.map(function(e){var t;return(null==e?void 0:null===(t=e.content)||void 0===t?void 0:t.title)||""})}});return o.setStatus({code:ti.Z.ERROR,message:"missing preference name or preference title"}),o.end(),n.filter(function(e){return e.preference_name&&e.preference_text})}return n},tu=r(546138);function tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var tl=[],ts=function(){var e,t=(0,L.t)().query,r=(function(e){if(Array.isArray(e))return e}(e=(0,M.Z)(tu.c))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return tc(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tc(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n="string"==typeof t.force_variant_id?t.force_variant_id:null;return(0,l.useMemo)(function(){if(n)return[n];if(!r)return tl;try{var e=JSON.parse(r);if(Array.isArray(e)&&e.every(function(e){return"string"==typeof e}))return e;return tl}catch(e){return tl}},[n,r])},td=r(463171),tf=function(){var e=(0,td.Z)("uscro-8316_intelligent_funnel_response"),t=e.isEnabled,r=e.isReady;
1return{shouldSendFunnelResponse:r&&t,isReady:r}};function tp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function ty(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function th(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tp(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 tb=function(e,t,r){e.setStatus({code:r?ti.Z.ERROR:ti.Z.OK,message:r?r.message:""}),e.setAttribute("error_message",(null==r?void 0:r.message)||""),e.end()},tm=function(e,t,r){var n=e.responses,o=ty(e,["responses"]);if(!n||0===n.length)return!1;var i=n.every(function(e){var t,r,n;return!!e.question_id&&("answer_ids"in e?!!(null===(t=e.answer_ids)||void 0===t?void 0:t.length):"answer_text"in e?!!(null===(r=e.answer_text)||void 0===r?void 0:r.length):"ranking_items"in e&&!!(null===(n=e.ranking_items)||void 0===n?void 0:n.length))}),a=Object.values(o).every(function(e){return!!e});return i&&a||(r.setAttribute("invalid_survey_responses",t),r.setAttribute("areResponsesValid",i),r.setAttribute("areOtherKeysValid",a),r.setStatus({message:"Invalid survey responses in local storage",code:ti.Z.ERROR})),r.end(),i&&a},tg=function(e,t,r){var n=e.responses,o=ty(e,["responses"]);if(!n||0===n.length)return!1;var i=n.every(function(e){var t,r,n,o;return!!e.question_id&&!!e.question_handle&&("answer_ids"in e&&"answer_handles"in e?!!(null===(t=e.answer_ids)||void 0===t?void 0:t.length)&&!!(null===(r=e.answer_handles)||void 0===r?void 0:r.length):"answer_text"in e?!!(null===(n=e.answer_text)||void 0===n?void 0:n.length):"ranking_items"in e&&!!(null===(o=e.ranking_items)||void 0===o?void 0:o.length))}),a=Object.values(o).every(function(e){return!!e});return i&&a||(r.setAttribute("invalid_funnel_responses",t),r.setAttribute("areResponsesValid",i),r.setAttribute("areOtherKeysValid",a),r.setStatus({message:"Invalid funnel responses in local storage",code:ti.Z.ERROR})),r.end(),i&&a},tO=function(e){var t=e.surveyLocalStorageKey,r=(0,en.W)({},{suspense:!1}).data,n=null==r?void 0:r.uuid,o=(0,z.T)(),i=(0,L.t)().asPath,a=(0,tn.Z)().preferencesConfig,u=(0,X.iQ)(),c=(0,e3.T)(),s=tf().shouldSendFunnelResponse,d=(0,to.Z)(),f=(0,l.useMemo)(function(){var e,t,r;return(null==u?void 0:null===(r=u.items)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.presets)||[]},[u]),p=(0,l.useMemo)(function(){if(f&&a){var e=ta(f,a,o);if(f.length>0&&0===e.length){var t=o.startSpan("questionnaire.preferenceResponsesAllFiltered",{attributes:{selectedPreferences:f,availablePreferenceNames:a.map(function(e){return e.preferenceName})}});t.setStatus({code:ti.Z.ERROR,message:"All selected preferences were filtered out — none matched plans-config. multiPreference will not be written."}),t.end()}return e}return[]},[f,a,o]),v=(0,e7.n)().mutate,y=tr().mutate,h=ts(),b=th((0,M.Z)(t),1)[0],m=(0,l.useMemo)(function(){var e;try{e=b?JSON.parse(b):{}}catch(t){e={}}return e}
1,[b]),g=th((0,M.Z)("hf_contentful_funnel_responses"),1)[0],O=(0,l.useMemo)(function(){var e;try{e=g?JSON.parse(g):{}}catch(t){e={}}return e},[g]),_=(0,l.useMemo)(function(){return tm(m,b,o.startSpan("questionnaire.validateStoredSurveyResponses"))},[m]),S=(0,l.useMemo)(function(){return tg(O,g,o.startSpan("questionnaire.validateStoredFunnelResponses"))},[O]),w=(0,l.useRef)(new Set),P=function(e){return!w.current.has(e)&&(w.current.add(e),!0)},k=function(e){w.current.delete(e)};(0,l.useEffect)(function(){var e=c&&p.length>0,t=n&&_,r=n&&S&&s;if(e){var a=p.map(function(e){return e.preference_name}),u="profile:".concat(JSON.stringify(a));if(P(u)){var l=o.startSpan("questionnaire.updateUserProfileWithPreferences");c.mutate({multiPreference:a},{onSettled:function(e,t){t&&k(u),tb(l,e,null!=t?t:void 0)}})}}if(r){var f=tv({customer_uuid:n,source_url:O.source_url,funnel_id:O.funnel_id,business_division:{brand:d.brand,region_code:d.region_code},responses:O.responses,preferences:p},h.length>0&&{variant_ids:h}),b="funnel:".concat(JSON.stringify(f));if(!P(b))return;var g=o.startSpan("questionnaire.postFunnelResponse");g.setAttributes({pathname:i,single_page_checkout:!0}),y(f,{onSuccess:function(){g.setStatus({message:"funnel responses posted",code:ti.Z.OK}),g.end()},onError:function(e){k(b),g.setStatus({message:e.message,code:ti.Z.ERROR}),g.end()}})}else if(t){var w=tv({customer_uuid:n,source_url:m.source_url,survey_id:m.survey_id,translation_id:m.translation_id,responses:m.responses,preferences:p},h.length>0&&{variant_ids:h}),I="survey:".concat(JSON.stringify(w));if(!P(I))return;var A=o.startSpan("questionnaire.postSurveyResponse");A.setAttributes({pathname:i,single_page_checkout:!0}),v(w,{onSuccess:function(){A.setStatus({message:"responses posted",code:ti.Z.OK}),A.end()},onError:function(e){k(I),A.setStatus({message:e.message,code:ti.Z.ERROR}),A.end()}})}},[v,y,n,_,S,m,O,s,o,i,p,h])},t_=r(809805);function tS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tS(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 tP="tada_experiment",tk="prospect",tI="activation_flow_experiment_name",tA="activation_customer_priority",tj=function(){var e=tw((0,M.Z)("hf_prefill_zipcode"),1)[0],t=tw((0,M.Z)("hf_stored_zipcode"),1)[0]||e,r=(0,X.iQ)(),n=(0,l.useMemo)(function(){var e,t,n,o;return null!==(o=null==r?void 0:null===(n=r.items)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.productFamily)&&void 0!==o?o:null},[r]),o=tw((0,M.Z)("hf_activation_flow_customer_priority",{expiresIn:3600}),2)[1],i=(0,e1.py)({runUsingStatsig:!0}),a=i.decide,u=i.isReady,c=(0,e2.R)({runUsingStatsig:!0}),s=c.id,d=c.attributes,f=c.isReady,p=(0,t_.Ae)(tP),v=(null==p?void 0:p.isReady)?null==p?void 0:p.value:null,y=(0,z.T)(),h=(0,l.useRef)(null);(0,l.useEffect)(function(){if(!t){o(tk);return}if(h.current||(h.current=y.startSpan("tada-experiment-customer-priority"),h.current.setAttributes({"experiment.dynamic_config_name":tP,"experiment.default_value":tk,"experiment.dynamic_config_flow_key":tI,"experiment.variation_customer_priority_key":tA})),p.isReady&&n&&t&&u&&f){if(v&&(null===(i=Object.keys(v))||void 0===i?void 0:i.length)===0){o(tk),h.current&&(h.current.setAttributes({"experiment.flow":"empty_dynamic_config","experiment.customer_priority":tk}),h.current.end());return}var e,r,i,c,l=null!==(c=null==v?void 0:v[tI])&&void 0!==c?c:"";if(!l){o(tk),h.current&&(h.current.setAttributes({"experiment.flow":"no_experiment_name","experiment.customer_priority":tk}),h.current.end());return}var b=a({experimentKey:l,experimentationUserId:s,experimentationUserAttributes:(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},d),r=r={postcode:t,productFamily:n},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e)}),m=b.variationKey,g=b.parameters;if(!m||!g||g&&0===Object.keys(g).length){o(tk),h.current&&(h.current.setAttributes({"experiment.key":l,"experiment.flow":"no_variation_or_parameters","experiment.variation_key":m||"not_available","experiment.customer_priority":tk}),h.current.end());return}try{if(!g[tA]){o(tk),h.current&&(h.current.setAttributes({"experiment.key":l,"experiment.flow":"parameter_not_found","experiment.variation_key":m,"experiment.customer_priority":tk}),h.current.end());return}var O=g[tA].toString().toLowerCase();o(O),h.current&&(h.current.setAttributes({"experiment.key":l,"experiment.flow":"success","experiment.variation_key":m,"experiment.customer_priority":O}),h.current.end())}catch(e){o(tk),h.current&&(h.current.setStatus({code:ti.Z.ERROR,message:e||"Unknown error"}),h.current.setAttributes({"experiment.key":l,"experiment.flow":"error","experiment.customer_priority":tk}),h.current.end())}}return function(){h.current&&(h.current.end(),h.current=null)}},[p.isReady,u,f,v,t,n,s,d,a,y])},tZ=r(285087),tE=function(){(0,l.useEffect)(function(){var e,t;(null===(e=window)||void 0===e?void 0:e.usabilla_live)&&(null===(t=window)||void 0===t||t.usabilla_live("hide"))},[])},tx=r(958042),tC=r(90295),tD=r(877520),tT=r(487803);function tR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var tU="warning-delivery-moment-holiday",tM=function(){var e,t,r,n,o,i=(0,P.ZP)("checkout").translateRaw,a=(function(e){if(Array.isArray(e))return e}(e=(0,J.KO)(ee.tu))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return tR(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tR(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],u=(0,tx.Z)(),c=null==a?void 0:null===(r=a.selectedDelivery)||void 0===r?void 0:null===(t=r.deliveryDate)||void 0===t?void 0:t.holidayMessage;if(!c){(0,tC.FV)({id:tU,state:tD.mG.open,text:"",type:tD.k$.warn,testId:"".concat(tU,"-test"),onClose:function(){},close:function(){}});return}var l=null==a?void 0:null===(n=a.availableDeliveryDateOptions)||void 0===n?void 0:n.find(function(e){var t,r;return e.deliveryDate.deliveryDate===(null==a?void 0:null===(r=a.selectedDelivery)||void 0===r?void 0:null===(t=r.deliveryDate)||void 0===t?void 0:t.holidayDelivery)});if(l){var s=l.deliveryDate.deliveryOption,d=s?", ".concat(s.deliveryFrom," - ").concat(s.deliveryTo):"",f=(0,tT.p6)(null==l?void 0:null===(o=l.deliveryDate)||void 0===o?void 0:o.deliveryDate,u,"ddd, MMM DD"),p="".concat(i("checkout.form-deliveryMoments.holidayDelivery.headerNotification")).concat(f," ").concat(d);c&&p&&(0,tC.wN)({id:tU,state:tD.mG.open,text:p,type:tD.k$.warn,testId:"".concat(tU,"-test"),meta:{disableDismiss:!0,disablePersist:!0},close:function(){(0,tC.FV)({id:tU,state:tD.mG.open,text:p,type:tD.k$.warn,testId:"".concat(tU,"-test"),onClose:function(){},close:function(){}})},onClose:function(){}})}},tN=r(631520),tz=r(209660),tq=r(490697),tF=r(853280),tL=r(230379);function tB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tK(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function tH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function tV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tB(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 tG=["checkout-success","products"],tY=function(){var e,t,r,n,o,i,a,u=tV((0,M.Z)("hf_cart_abandonment",{expiresIn:864e5}),2),c=u[0],s=u[1],d=(0,eS.H)().code,p=(0,X.iQ)(),v=null==p?void 0:null===(r=p.items)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.sku,y=(0,tN.p)().mutate,h=(0,en.W)({},{suspense:!1}).data,b=null==h?void 0:h.email,m=tV((0,J.KO)(tF.s),1)[0],g=tV((0,J.KO)(ee.tu),1)[0],O=tV((0,J.KO)(er.mP),1)[0],_=tV((0,M.Z)("hf_prefill_zipcode"),1)[0],S=(0,f.v7)(),P=S.showReceiveOffersSection,k=S.hideNewsletterCheckbox,I=(0,Z.Z)(),A=(0,z.T)(),j=(0,eG.Z)(),E=(0,et.Z)(null==g?void 0:g.selectedDeliveryDate,"YYYY-MM-DD")||"",x=(0,eH.M)({sku:null!=v?v:""},{enabled:!!v,suspense:!1}).data,C=(0,eW.B)(eQ.d.ACTIVATION_SUBSCRIPTION),D=(0,eK.vr)(tH({products:[{handle:null!=v?v:"",deliveryDate:E,deliveryOption:(null==g?void 0:g.selectedDeliveryTime)||"",hfWeek:j}],customerID:(null==h?void 0:h.id)||0,customerUUID:(null==h?void 0:h.uuid)||"",couponCode:(null==p?void 0:p.voucher)||"",shippingAddress:{postcode:(null==O?void 0:null===(n=O.formData)||void 0===n?void 0:n.postcode)||"",address1Street:(null==O?void 0:null===(o=O.formData)||void 0===o?void 0:o.address1Street)||"",city:(null==O?void 0:null===(i=O.formData)||void 0===i?void 0:i.city)||""}},C&&{headers:C}),{enabled:!!(E&&j&&v&&!(null==g?void 0:g.isLoading)&&(null==g?void 0:g.selectedDeliveryTime)&&(null==g?void 0:g.resolvedForPostcode)===((null==O?void 0:null===(a=O.formData)||void 0===a?void 0:a.postcode)||_||"")),suspense:!1}).data,T=(0,tq.W)({origin:"cart-abandonment",appliedVoucherCode:d});return(0,l.useCallback)((e=function(){var e,t,r,n,o,i,a,u,l,f,p,v,h;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(g){switch(g.label){case 0:if(c||!b||!x||!D)return[2];return t=(null==O?void 0:null===(e=O.formData)||void 0===e?void 0:e.phone)||"",r=["pending-opt-in","opted-in"].includes(m),n="true"===$.ZP.getItem(w.XH),o=!P&&k,a=(i=P?r:o||n)&&t?(0,tz.E)(t,I):null,l=(u=A.startSpan("cart-abandonment.request")).setAttributes,f={},p="cart_abandonment.customer_email_hash_sha256",[4,(0,tL.k)(b)];case 1:if(f[p]=g.sent(),v="cart_abandonment.phone_number_hash_sha256",!a
1)return[3,3];return[4,(0,tL.k)(a)];case 2:return h=g.sent(),[3,4];case 3:h="",g.label=4;case 4:return l.apply(u,[(f[v]=h,f["cart_abandonment.phone_included"]=!!a,f["cart_abandonment.is_phone_entered"]=!!t,f["cart_abandonment.origin_metadata"]=T.origin,f["cart_abandonment.debug_consentState"]=null!=m?m:"null",f["cart_abandonment.debug_showReceiveOffersSection"]=P,f["cart_abandonment.debug_hasSmsConsent"]=r,f["cart_abandonment.debug_hasImpliedConsent"]=o,f["cart_abandonment.debug_hasNewsletterConsent"]=n,f["cart_abandonment.debug_shouldIncludePhone"]=i,f)]),s("true"),[4,y({params:{email:b},body:tH({cart_info:tW({product:x,subTotal:Math.round(100*D.subTotal),total:Math.round(100*D.grandTotal),discountAmount:Math.round(100*D.discountAmount),appliedVoucherCode:d}),origin_metadata:T},a&&{phone_number:a}),parentSpan:u})];case 5:return g.sent(),u.end(),[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){tK(i,n,o,a,u,"next",e)}function u(e){tK(i,n,o,a,u,"throw",e)}a(void 0)})}),[b,c,T,D,x,y,s,d,O,m,P,k,I,A])},tW=function(e){var t,r=e.product,n=e.subTotal,o=e.total,i=e.discountAmount,a=e.appliedVoucherCode;return{products:[{price:n,sku:r.handle,familyHandle:null!==(t=r.family.handle)&&void 0!==t?t:"",name:r.productName,preferred_meal:""}],discount:i,sub_total:n,total:o,coupon:a}},tQ=function(){var e=(0,L.t)(),t=tY();(0,l.useEffect)(function(){var r=function(e){e&&tG.some(function(t){return e.includes(t)})||t()};return e.events.on("routeChangeStart",r),function(){e.events.off("routeChangeStart",r)}},[e,t]),(0,l.useEffect)(function(){return window.addEventListener("beforeunload",t),function(){window.removeEventListener("beforeunload",t)}},[t]),(0,l.useEffect)(function(){var e=setTimeout(function(){t()},12e4);return function(){return clearTimeout(e)}},[t])},t$=r(567921),tX=r.n(t$),tJ=r(141323),t0=r(917780),t1=r(599506),t2=r(134094);function t8(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var t3=function(){var e,t=(function(e){if(Array.isArray(e))return e}(e=(0,t1.Z)())||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return t8(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t8(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],r=(0,tJ.j)({},{suspense:!1}).data,n=(0,z.T)(),o=(0,t0.Y)().mutate,i=(0,l.useMemo)(function(){return tX().get(t2.KQ)},[]),a=(0,l.useRef)(null),u=(0,l.useCallback)(function(){if(i&&(null==r?void 0:r.id)&&t.week&&t.productSKU&&t.meals.length){var e,u,c,l=n.startSpan("meal-selection-to-pcs");a.current=l,l.setAttributes({"customer-id":r.id,week:t.week,productSku:t.productSKU,meals:t.meals.length,"cart-id":i}),o({cartId:i,customer_id:r.id.toString(),data:(e={},u=t.week,c={productSku:t.productSKU,meals:t.meals.map(function(e){return{index:e.index,quantity:e.quantity}}),extras:[]},u in e?Object.defineProperty(e,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[u]=c,e)},{onSuccess:function(){l.setStatus({message:"meal selection saved",code:ti.Z.OK}),l.end(),a.current=null},onError:function(e){l.setStatus({message:e.message,code:ti.Z.ERROR}),l.end(),a.current=null}})}},[i,null==r?void 0:r.id,t.week,t.productSKU,t.meals,n,o]);(0,l.useEffect)(function(){u()},[u])};function t7(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var t4=function(){var e=(0,tZ.l)(),t=(0,es.E)().query,r=(0,b.n)(),n=r.step,o=r.goToNextPage,a=(0,td.Z)("greenchef_nl_migration").isEnabled,u=(0,f.v7)(),p=u.layoutConfig,v=u.dis
1playFAQsSection,O=u.showTermsAndConditionsFeature;tO({surveyLocalStorageKey:"hf_selected_single_questions_survey_responses"});var _=(0,S.LU)().isHelloFreshTheme,w=(0,d.W)(),P=w.isMobile,k=w.isTablet,I=!P&&!k;tj(),t3();var A=p.filter(function(e){var t;return(null==e?void 0:e.container)===h.a9.MAIN&&(null==e?void 0:null===(t=e.pages)||void 0===t?void 0:t.includes(n))}),Z=p.filter(function(e){var t;return(null==e?void 0:e.container)===h.a9.SUMMARY&&(null==e?void 0:null===(t=e.pages)||void 0===t?void 0:t.includes(n))}),E=p.filter(function(e){var t;return(null==e?void 0:e.container)===h.a9.MOBILE_SUMMARY&&(null==e?void 0:null===(t=e.pages)||void 0===t?void 0:t.includes(n))});ea(),eJ(),e8(),tE(),tM(),tQ(),(0,m.G)();var D=(0,l.useCallback)(function(e){return e.map(function(e){var t=e.id,r=e.component,n=r&&y[r];return n?(0,i.tZ)(c.Z,{scope:"lego-checkout.".concat(t),fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(l.Suspense,{fallback:(0,i.tZ)(g,{}),children:(0,i.tZ)(n,{id:t,goToNextPage:o})})},t):null})},[o]),T=(0,l.useCallback)(function(){var e,t=["value-proposition-container","delivery-summary-container","express-checkout-component-container"];return D(function(e){if(Array.isArray(e))return t7(e)}(e=A.filter(function(e){return t.includes(e.id)}
1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return t7(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t7(e,void 0)}}(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.")}())},[A,D]);(0,l.useEffect)(function(){t.step!==h.T3.address&&t.step?t.step===h.T3.delivery&&e.removeItem("payment_page_visited"):(e.removeItem("address_delivery_window_step_completed"),e.removeItem("payment_page_visited"))},[t.step,e]);var R=(n===h.T3.address||n===h.T3.delivery||n===h.T3.payment&&I||n===h.T3.expressCheckout&&I)&&!!v;return(0,i.BX)(s.xu,{backgroundColor:"alias.page-background.default",minHeight:{tablet:"90vh"},paddingTop:a?"global.lg-3":"global.none",paddingBottom:["global.lg-3","global.none"],children:[(0,i.tZ)(eE,{}),(0,i.tZ)(c.Z,{scope:"lego-checkout.partner-eligibility-modal",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(C.Z,{children:(0,i.tZ)(eB,{})})}),(0,i.BX)(s.xu,{px:P?"global.none":"global.lg-3",children:[(0,i.BX)(s.xu,{display:"grid","data-test-id":"lego-checkout-container",gridTemplateColumns:I?"66fr 33fr":"repeat(1, 1fr)",maxWidth:"1200px",margin:"auto",minHeight:["calc(70vh - 49px)","calc(85vh - 49px)",R?"calc(80vh - 49px)":"calc(90vh - 49px)"],columnGap:"global.md-2",children:[(0,i.BX)(s.xu,{children:[(k&&n===h.T3.payment||P)&&(0,i.tZ)(c.Z,{scope:"lego-checkout.mobile-summary-container",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(C.Z,{children:(0,i.tZ)(l.Suspense,{children:D(E)})})}),(0,i.tZ)(c.Z,{scope:"lego-checkout.main-container",fallback:(0,i.tZ)(i.HY,{}),children:n===h.T3.expressCheckout?T():D(A)})]}),I&&(0,i.tZ)(s.xu,{children:(0,i.tZ)(s.xu,{width:380,py:"global.sm-2",mb:"global.sm-1",children:(0,i.tZ)(c.Z,{scope:"lego-checkout.summary-container",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(C.Z,{children:(0,i.tZ)(l.Suspense,{children:D(Z)})})})})})]}),O&&(0,i.tZ)(c.Z,{scope:"lego-checkout.terms-and-conditions-feature",children:(0,i.tZ)(s.xu,{"data-test-id":"terms-and-condition-section",children:(0,i.tZ)(ev,{})})}),(0,i.tZ)(s.xu,{justifyContent:"center",display:"flex",children:(0,i.BX)(s.xu,{children:[(0,i.tZ)(j,{step:n}),!_&&(0,i.tZ)(s.iz,{"data-test-id":"copy-right-divider"})]})})]}),R&&(0,i.tZ)(c.Z,{scope:"lego-checkout.faq-".concat(n),children:(0,i.tZ)(Q,{applangaPrefix:"lego-checkout.".concat(n,".FAQS")})}),(0,i.tZ)(s.xu,{justifyContent:"center",display:"flex",mb:"global.sm-2",children:(0,i.tZ)(x,{isRenderedOnPaymentPage:n===h.T3.payment})}),(0,i.tZ)(C.Z,{children:(0,i.tZ)(l.Suspense,{children:(0,i.tZ)(V,{})})})]})},t6=r(401524),t5=r(237947),t9=function(){var e,t=(0,L.t)(),r=(0,t5.o)(),n=(0,z.T)(),o=t.query,i=(null==o?void 0:o.cart_id)||"",a=(null==o?void 0:o.c)||"",u=(null==o?void 0:o.pageVariation)||"",c=(null==o?void 0:o.public_id)||"",l=r.hf_ssr_single_page_checkout,s=tX().get("hf_single_page_checkout_allocation");if(u&&(l||tX().set("hf_ssr_single_page_checkout",u,{expires:30}),s||tX().set("hf_single_page_checkout_allocation",u,{expires:30})),i&&tX().set("hf_cart_id",i,{expires:30}),c&&tX().set("hf_public_id",c),a)try{$.ZP.setItem("StoredCouponCode",a)}catch(t){n.startSpan("restore-vital-data.local-storage.set-item-failed").setAttributes({"local-storage.key":"StoredCouponCode","error-message":(null!=(e=Error)&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e)?t.message:String(t)}).end()}},re=r(43011);function rt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var rr=function(e,t){var r=(0,L.t)().replace,n=(0,es.E)().query,o=(0,re.Z)(),i=(0,eO.Z)(),a=(0,tZ.l)();(0,l.useEffect)(function(){e&&(n.step,r({pathname:"/plans",query:rt(n,["step"])}));var u=(null==n?void 0:n.step)==="expressCheckout",c=!!a.getItem("hf_applepay_error");
1if(t&&!o&&!u&&!c){var l=i===e_.Z.hellofresh?"/register":"/plans";n.step;var s=rt(n,["step"]),d="/plans"===l?s:n;r({pathname:l,query:d})}},[e,n,o,i])},rn=r(231140),ro=r(481989),ri=r(929651),ra=r(932066);function ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function rc(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var rl=function(e){var t=e.ssrPayload,r=(null==t?void 0:t.brand)||"";return(rr(t.shouldRedirectToPlans,t.shouldRedirectToRegister),t9(),r===e_.Z.hellofresh)?(0,i.BX)(i.HY,{children:[(0,i.tZ)(a.Z,{}),(0,i.tZ)(c.Z,{scope:"lego-checkout",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(f.C8,{children:(0,i.tZ)(eS.x,{children:(0,i.tZ)(b.f,{children:(0,i.tZ)(ra.Z,{funnelId:null==t?void 0:t.funnelId,visitId:null==t?void 0:t.visitId,funnelName:null==t?void 0:t.funnelName,children:(0,i.tZ)(rn.Z,{children:(0,i.tZ)(t4,{})})})})})})})]}):(0,i.BX)(i.HY,{children:[(0,i.tZ)(a.Z,{}),(0,i.tZ)(c.Z,{scope:"lego-checkout-wl",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(ri.sE,{children:(0,i.tZ)(t6.Gi,{children:(0,i.tZ)(X.ZP,{children:(0,i.tZ)(f.C8,{children:(0,i.tZ)(eS.x,{children:(0,i.tZ)(ra.Z,{funnelId:null==t?void 0:t.funnelId,visitId:null==t?void 0:t.visitId,funnelName:null==t?void 0:t.funnelName,children:(0,i.tZ)(b.f,{children:(0,i.tZ)(t4,{})})})})})})})})})]})};rl.customLayout=function(e){var t;return((null==e?void 0:null===(t=e.ssrPayload)||void 0===t?void 0:t.brand)||"")===e_.Z.hellofresh?(0,i.tZ)(u.Z,rc(ru({},e),{ssrPayload:e.ssrPayload})):(0,i.tZ)(C.Z,{suspense:!0,children:(0,i.tZ)(ro.A5,rc(ru({},e),{disableFooter:!0}))})},rl.provideCustomLayoutProps=function(e){return{ssrPayload:e.ssrPayload,claim:{name:"activations-mealkits",githubTeam:"hellofresh/squad-checkout",tribe:"conversions",alliance:"growth",jiraPrefix:"UFI",slackChannel:"#squad-checkout",slackAlertsChannel:"#ufi-private",ski
1pLabelsOnPR:!0,teamIdentifier:"activations-mealkits"},disableFooter:!0}};var rs=!0,rd=rl},96965:function(e,t,r){"use strict";function n(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}r.d(t,{C8:function(){return a},v7:function(){return u}});var o,i=(0,r(575085).Z)("hf.checkout.config",(o=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(e){return[2,r.e(70483).then(r.bind(r,470483))]})},function(){var e=this,t=arguments;return new Promise(function(r,i){var a=o.apply(e,t);function u(e){n(a,r,i,u,c,"next",e)}function c(e){n(a,r,i,u,c,"throw",e)}u(void 0)})})),a=i.ProjectConfigProvider,u=(i.configMiddleware,i.useConfig)},713113:function(e,t,r){"use strict";r.d(t,{$L:function(){return p},$m:function(){return w},AC:function(){return h},B2:function(){return f},BY:function(){return k},Bt:function(){return W},DG:function(){return L},Ef:function(){return G},Eq:function(){return eo},GF:function(){return en},Iv:function(){return C},KB:function(){return o},Md:function(){return I},Mj:function(){return j},NF:function(){return q},Nm:function(){return R},O4:function(){return s},QI:function(){return N},Qx:function(){return A},S9:function(){return H},Sj:function(){return et},Sn:function(){return S},Tx:function(){return i},Ve:function(){return $},WK:function(){return z},WU:function(){return M},X6:function(){return Q},XH:function(){return b},Zo:function(){return v},_n:function(){return a},am:function(){return D},be:function(){return Y},c6:function(){return er},cB:function(){return B},f6:function(){return K},i7:function(){return l},ip:function(){return u},kB:function(){return F},kI:function(){return ee},l3:function(){return P},m5:function(){return V},mg:function(){return J},nM:function(){return U},p5:function(){return E},q:function(){return X},q5:function(){return g},qC:function(){return d},qk:function(){return x},rK:function(){return _},rO:function(){return c},tA:function(){return m},uS:function(){return T},uY:function(){return y},v8:function(){return n},w7:function(){return Z},z3:function(){return O}});var n="lego-checkout",o="single-page-checkout",i="single-page-checkout.phone-disclaimer-label-text",a="single-page-checkout.phone-disclaimer-terms-text",u="single-page-checkout.phone-disclaimer-terms-link",c="single-page-checkout.phone-disclaimer-terms-label",l="single-page-checkout.phone-disclaimer-privacy-link",s="single-page-checkout.phone-disclaimer-privacy-label",d="StoredCouponCode",f="address-form",p="billing-form",v="Payment method blocked as it is a prepaid card.",y={id:"id",address1:"address1",address2:"address2",address1Street:"address1Street",address1No:"address1No",addressType:"addressType",isOffice:"isOffice",company:"company",region:"region",postcode:"postcode",city:"city",phone:"phone",address2Comment:"address2Comment",deliveryNotesDropdown:"deliveryNotesDropdown",suburb:"suburb",uspAlternativeDeliveryPermission:"uspAlternativeDeliveryPermission",uspAlternativeDeliveryComment:"uspAlternativeDeliveryComment",isBilling:"isBilling"}
1,h="checkout accordeon",b="isSubscribedToNewsletter",m="hf_ssr_e_gift_card_purchase",g="hf_ssr_e_gift_card_checkout",O="/checkout-api/finish/placeorder/",_="hf_payment_data",S="hf-checkout-address-form",w="hf-checkout-billing-form",P="lego-checkout",k="lego-checkout.cta.next",I="lego-checkout.cta.place-order-payment",A="lego-checkout.postcode.delivery.error",j="lego-checkout.address.title",Z="lego-checkout.payment.title",E="lego-checkout.delivery-details.title",x="lego-checkout.delivery-details.desktop-title",C=["HelloShare","HelloShare Offline","HelloShare Online","Freebies","Freebies Offline","Freebies Online"],D="Adyen_CreditCard",T="Adyen_IDeal",R="Adyen_Klarna",U="Adyen_BcmcMobile",M="Adyen_Twint",N="ProcessOut_Vipps",z="ProcessOut_Mobilepay",q="hf_checkout_with_subscription_just_completed",F=9907,L=9930,B="lego-checkout.footer.terms",K="lego-checkout.footer.legal-disclaimer-with-see-more.text",H="lego-checkout.footer.legal-disclaimer-with-see-more.open",V="lego-checkout.footer.legal-disclaimer-with-see-more.close",G="lego-checkout.summary.delivery.disclaimer",Y="Request failed with status code 500",W="lego-checkout.automatic.agreement.label-with-see-more.text",Q="lego-checkout.automatic.agreement.label-with-see-more.open",$="lego-checkout.automatic.agreement.label-with-see-more.close",X="lego-checkout.automatic.payment.reassurance.lawNote",J="lego-checkout.opt-in.legal-optimization.text",ee="lego-checkout.form-register.isSubscribedToNewsletter.label",et="lego-checkout.delivery-summary.satisfaction-badge.image",er="lego-checkout.delivery-summary.satisfaction-badge.title",en="lego-checkout.delivery-summary.satisfaction-badge.subtitle",eo="lego-checkout.delivery-summary.satisfaction-badge.alt"},112525:function(e,t,r){"use strict";r.d(t,{x:function(){return G},H:function(){return Y}});var n=r(687800),o=r(827378),i=r(830644),a=r.n(i),u=r(718583),c=r(408558),l=r(456552),s=r(447178),d=r(497249),f=r(75850),p=r(463171),v=r(808215),y=(r(874570),r(140224)),h=r(699219);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function m(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function g(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){m(i,n,o,a,u,"next",e)}function u(e){m(i,n,o,a,u,"throw",e)}a(void 0)})}}function O(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(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 w(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var P=function(e,t){var r,n,i,a,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=(0,s.Z)().fetch,b=(0,d.T)(),m=(0,y.O)();(0,p.Z)("mnlth-1166_voucher-validate-attachment-migration");var P=(0,v.Z)(),k=(0,o.useMemo)(function(){return _({},e,m)},[e,m]),I=S((0,o.useState)(0),2),A=I[0],j=I[1],Z=S((0,o.useState)(!1),2),E=Z[0],x=Z[1],C=(0,o.useCallback)((r=g(function(e){var r,n,o,i;return w(this,function(a){switch(a.label){case 0:r=b.startSpan("voucher-validation-attempt",{attributes:{"voucher.code":k.code,"voucher.attempt":e,"voucher.max_retries":t.maxRetries,"voucher.timeout_ms":t.timeoutBeforeRetry,"system.country":k.country,"customer.id":k.customer_id,"config.retry_enabled":t.enabled,"voucher.new_endpoint":!1}}),a.label=1;case 1:return a.trys.push([1,3,,4]),n=g(function(){return w(this,function(t){switch(t.label){case 0:var n,o;return[4,c("/voucher/validate",[h.Z["voucher.validate"],k],{method:"POST",data:(n=_({},k),o=o={subscription_id:0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n),parentSpan:r,fetchSpanAttributes:{"request.backend_service":"voucher-validation-service","request.backend_action":"voucher-validation",voucherCode:k.code,"request.attempt":e}})];case 1:return[2,t.sent().json()]}})})(),[4,(0,f.Fb)(t.timeoutBeforeRetry,n)];case 2:o=a.sent();try{r.setAttributes({"voucher.validation_success":!0,"voucher.response_received":!0}),r.end(),e>1&&b.startSpan("voucher-validation-succeeded-after-retry").setAttributes({"voucher.code":k.code,"voucher.total_attempts":e,"system.country":k.country}).end()}catch(e){}return[2,o];case 3:if(O(i=a.sent(),f.NO))try{x(!0),b.startSpan("voucher-validation-timeout-aborted").setAttributes({"voucher.code":k.code,"voucher.attempt":e,"voucher.timeout_ms":t.timeoutBeforeRetry,"system.country":k.country}).end()}catch(e){}try{r.setAttributes({"voucher.validation_success":!1,"voucher.error":O(i,Error)?i.message:String(i)}),r.end()}catch(e){}if(t.enabled&&e<t.maxRetries+1&&(O(i,f.NO)||O(i,Error))){try{b.startSpan("voucher-validation-retry-attempted").setAttributes({"voucher.code":k.code,"voucher.attempt":e,"voucher.next_attempt":e+1,"voucher.max_retries":t.maxRetries,"system.country":k.country,"error.message":O(i,Error)?i.message:"","error.type":O(i,Error)?i.constructor.name:"unknown"}).end()}catch(e){}return j(e),[2,C(e+1)]}throw i;case 4:return[2]}})}),function(e){return r.apply(this,arguments)}),[k,t,c,b,!1,P]),D=h.Z["voucher.validate"],T=(0,l.useQuery)([D,k,t],function(){return C(1)},{enabled:null===(n=u.enabled)||void 0===n||n,suspense:null!==(i=u.suspense)&&void 0!==i&&i,retry:!1,onSuccess:function(e){try{b.startSpan("voucher-validation-completed").setAttributes({"voucher.code":k.code,"voucher.total_attempts":A+1,"voucher.success":!0,"voucher.did_timeout":E,"system.country":k.country,"config.retry_enabled":t.enabled}).end()}catch(e){}try{var r;null===(r=u.onSuccess)||void 0===r||r.call(u,e)}catch(e){}},onError:function(e){try{b.startSpan("voucher-validation-completed").setAttributes({"voucher.code":k.code,"voucher.total_attempts":A+1,"voucher.success":!1,"voucher.did_timeout":E,"voucher.error":e.message,"system.country":k.country,"config.retry_enabled":t.enabled}).end()}catch(e){}try{var r;null===(r=u.onError)||void 0===r||r.call(u,e)}catch(e){}}});return{status:T.isLoading||T.isFetching?"loading":T.isError?"error":T.isSuccess&&T.data?"valid":"invalid",data:T.data,error:null!==(a=T.error)&&void 0!==a?a:void 0,isFetching:T.isFetching,isFetched:T.isFetched,retryCount:A,didTimeout:E}},k=r(440492),I=r(200770),A=r(907567),j=r(581340),Z=r(468891),E=r(592610),x=function(e){var t,r,n,o,i=e.router,a=e.pathname,u=e.newVoucher,c=(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},(0,Z.parse)(null===(o=window)||void 0===o?void 0:null===(n=o.location)||void 0===n?void 0:n.search)),r=r={c:u},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t);return i.replace({pathname:a,query:c},void 0,{shallow:!0})},C=function(e){if(e.query.c)return(0,E.T)(e.query.c);var t,r,n=(0,Z.parse)(null===(r=window)||void 0===r?void 0:null===(t=r.location)||void 0===t?void 0:t.search).c;return Array.isArray(n)?(0,E.T)(n[0]):(0,E.T)(n)},D=r(713113),T=function(e){try{var t=e.responseResult;if(t){var r=JSON.parse(t),n=r.error_code,o=r.msg;return{errorCode:n,errorMessage:o}}throw Error("No response Result")}catch(e){return{errorCode:"",errorMessage:""}}},R=r(431328),U=r(435172),M=r(567921),N=r.n(M);function z(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}var q=function(){var e,t,r=(0,R.u)(),n=r.mutate,i=r.isSuccess,a=r.data,l=(0,c.iQ)(),s=(0,U.P)({id:null==l?void 0:l.id},{suspense:!1,enabled:!!(null==l?void 0:l.id)}),d=s.data,f=s.refetch;return(0,o.useEffect)(function(){(null==a?void 0:a.voucher)&&(N().set(D.qC,a.voucher),u.ZP.setItem(D.qC,a.voucher))},[a]),(0,o.useEffect)(function(){f()},[i]),{patchCartWithVoucherCode:(e=function(e){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(t){return d&&d.id&&e&&n({cartId:d.id,voucher:e}),[2]})},t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){z(i,n,o,a,u,"next",e)}function u(e){z(i,n,o,a,u,"throw",e)}a(void 0)})},function(e){return t.apply(this,arguments)})}},F=r(115857),L=r(96965);function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function H(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var V=(0,o.createContext)(null),G=function(e){var t,r,i,l,s=e.children,f=(0,c.iQ)(),p=q().patchCartWithVoucherCode,v=(0,o.useMemo)(function(){return(null==f?void 0:f.voucher)||""},[null==f?void 0:f.voucher]),y=(0,j.t)(),h=C(y),b=u.ZP.getItem(D.qC)||"",m=(0,A.W)({},{suspense:!1}).data,g=(null==f?void 0:null===(l=f.items)||void 0===l?void 0:null===(i=l[0])||void 0===i?void 0:null===(r=i.metadata)||void 0===r?void 0:r.checkoutType)==="one_time_purchase",O=(0,o.useMemo)(function(){return g?v:h||b||v},[g,h,b,v]),_=(null==m?void 0:m.id)||0,S=(0,I.Z)(),w=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)({code:"",valid:!0,error:"",checked:!1,manuallyRemoved:!1}))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return B(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(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.")}(),Z=w[0],E=w[1],R=(0,o.useMemo)(function(){return(null==f?void 0:f.items)&&f.items.length>0?f.items[0].sku:""},[f]),U=(0,d.T)(),M=(0,L.v7)().voucherValidationStrategy,N=(0,o.useCallback)(function(e){var t,r=e.code,n=e.valid,o=e.checked,i=e.error,a=e.manuallyRemoved;a&&Z.code&&((0,F.M)("manually_removed"),U.startSpan("voucher-manually-removed").setAttributes({"voucher.code":Z.code,"voucher.was_valid":!!Z.valid,"voucher.was_checked":!!Z.checked,"system.country":S,"checkout.page":(null==y?void 0:null===(t=y.query)||void 0===t?void 0:t.step)||"","customer.id":_,context:"VoucherCodeContext.manual_removal"}).end()),E({code:r,valid:n,checked:o,error:i,manuallyRemoved:a}),!g&&(n&&o&&!a&&(x({router:y,pathname:y.pathname,newVoucher:r}),u.ZP.setItem(D.qC,r),p(r)),a&&(u.ZP.removeItem(D.qC),x({router:y,pathname:y.pathname,newVoucher:""})))},[p,y,Z.code,Z.valid,Z.checked,U,S,_,g]),z=!!(null==M?void 0:M.enableRetryLogic),G=!!R&&!!Z.code&&!Z.checked;(0,o.useEffect)(function(){if(G&&Z.code){var e;U.startSpan("voucher-validation-started").setAttributes({"voucher.code":Z.code,"system.country":S,"config.retry_enabled":z||!1,"config.always_send_to_ops":(null==M?void 0:M.alwaysSendVoucherToOPS)||!1,"customer.id":_,"checkout.page":(null==y?void 0:null===(e=y.query)||void 0===e?void 0:e.step)||""}).end()}},[G,Z.code]);var Y=(0,o.useCallback)(function(e){var t,r,n=T(e),o=(null==n?void 0:n.errorCode)||"";(0,F.M)("validation_failed"),N(H(K({},Z),{checked:!0,valid:!1,error:o})),U.startSpan("voucher-removed").setAttributes({"voucher.removal_reason":"validation_failed","voucher.code":Z.code,"voucher.error_code":o,"voucher.error_message":(null==n?void 0:n.errorMessage)||"","voucher.source.url":h||"","voucher.source.local_storage":b||"","voucher.source.cart":v||"","checkout.page":(null==y?void 0:null===(t=y.query)||void 0===t?void 0:t.step)||"","cart.product_sku":R||"","customer.id":_||0,context:"VoucherCodeContext.validation"}).end(),U.startSpan("voucher-validation-error").setAttributes({"voucher-code":Z.code,"error-code":o,"error-message":(null==n?void 0:n.errorMessage)||"",voucherFromUrl:h,voucherFromLocalStorage:b,voucherFromCart:v,page:null==y?void 0:null===(r=y.query)||void 0===r?void 0:r.step}).end()},[Z,N,U,h,b,v,y,R,_]),W=(0,o.useCallback)(function(){N(H(K({},Z),{checked:!0,valid:!0}))},[Z,N]);
1P({country:S,code:Z.code,products:[R],customer_id:_},{enabled:z,maxRetries:(null==M?void 0:M.maxRetries)||2,timeoutBeforeRetry:(null==M?void 0:M.timeoutBeforeRetry)||3e3},{enabled:z&&G,suspense:!1,onError:Y,onSuccess:W}),(0,k.W)({country:S,code:Z.code,products:[R],customer_id:_},{enabled:!z&&G,suspense:!1,onError:Y,onSuccess:W}),(0,o.useEffect)(function(){if(!(Z.checked&&Z.code===O||a()(O))){if(Z.code&&Z.code!==O){var e;U.startSpan("voucher-revalidation-triggered").setAttributes({"voucher.previous_code":Z.code,"voucher.new_code":O||"","voucher.was_checked":!!Z.checked,"voucher.was_valid":!!Z.valid,"voucher.source.url":h||"","voucher.source.local_storage":b||"","voucher.source.cart":v||"","checkout.page":(null==y?void 0:null===(e=y.query)||void 0===e?void 0:e.step)||"",context:"VoucherCodeContext.revalidation"}).end()}E({code:O,checked:!1,valid:void 0,error:"",manuallyRemoved:!1})}},[Z.checked,O]);var Q=(0,o.useMemo)(function(){return{code:Z.code,valid:Z.valid,checked:Z.checked,error:Z.error,manuallyRemoved:Z.manuallyRemoved,updateVoucherCode:N}},[Z.code,Z.checked,Z.valid,Z.error,Z.manuallyRemoved,N]);return(0,n.tZ)(V.Provider,{value:Q,children:s})},Y=function(){var e=(0,o.useContext)(V);if(!e)throw Error("useVoucherCodeContext must be used within a VoucherCodeProvider");return e}},361193:function(e,t,r){"use strict";r.d(t,{x:function(){return s}});var n=r(966622),o=r(943701),i=r(581340),a=r(285087),u=r(809197),c=r(96965),l=r(292788),s=function(){var e,t=(0,n.py)({runUsingStatsig:!0}),r=t.decide,s=t.isReady,d=(0,a.l)(),f=null===(e=(0,i.t)().asPath)||void 0===e?void 0:e.includes("".concat("express-checkout-test","=true")),p=(0,o.R)({runUsingStatsig:!0}),v=p.id,y=p.attributes,h=p.isReady,b=!1,m=s&&h,g=(0,u.p)(),O=(0,l.W)().shouldPerformCharge,_=g&&!O,S=(0,c.v7)().shouldRolloutExpressCheckout;return g?f||_&&S?{isReady:!0,isExpressCheckoutEnabled:!0}:(m&&_&&!S&&(b="Variation"===r({experimentKey:"pcon-2219-express-checkout-experiment-factor",experimentationUserId:v,experimentationUserAttributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},y)}).variationKey)&&d.setItem("hf_express_checkout_variation","true"),{isReady:m,isExpressCheckoutEnabled:b}):{isReady:!0,isExpressCheckoutEnabled:!1}}},292788:function(e,t,r){"use strict";r.d(t,{W:function(){return c}});var n=r(581340),o=r(307495),i=r(70258),a=r(112525),u=r(929113),c=function(){var e=(0,n.t)(),t=((null==e?void 0:e.asPath)||"").includes("payment"),r=(0,a.H)().code,c=(0,u.l)().isGiftCardBuyer,l=(0,i.Z)().isSeasonalFlow,s=(0,o.Z)({voucherCode:r,isSeasonalFlow:l,isGiftCardBuyer:c}),d=s.shouldPerformCharge;return{shouldPerformCharge:t&&d,isReady:s.isReady}}},645135:function(e,t,r){"use strict";r.d(t,{I:function(){return p}});var n=r(827378),o=r(37017),i=r(573150),a=r(285087),u=r(90295),c=r(877520),l=r(164528),s=r(46885),d=r(361193);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var p=function(){var e,t,r,p=(0,d.x)().isExpressCheckoutEnabled,v=(0,l.ZP)("express-checkout").translateRaw,y=(0,a.l)().getItem("hf_applepay_error"),h=(function(e){if(Array.isArray(e))return e}(e=(0,o.KO)(i.I))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return f(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,1)}}
1(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],b=(null==h?void 0:h.errCode)||"",m=(null==h?void 0:null===(t=h.paymentData)||void 0===t?void 0:t.errCode)||"",g=(null==h?void 0:null===(r=h.errDetails)||void 0===r?void 0:r.code)||"",O=b||m||g||y,_=m.includes(s.U.DISMISSED)||b.includes(s.U.DISMISSED)||g.includes(s.U.DISMISSED),S=window.location.search.includes("step=expressCheckout"),w=[s.U.ADDRESS_EMPTY_NAME,s.U.ADDRESS_INCOMPLETE,s.U.ADDRESS_ZIPCODE_VALIDATION,s.U.ADDRESS_PHONE_INVALID].some(function(e){return m.includes(e)||b.includes(e)||g.includes(e)})&&S,P=(0,n.useRef)(!1);return(0,n.useEffect)(function(){!p||!O||_||w||P.current||((0,u.L9)(),(0,u.wN)(c.ZP.create(v("express-checkout.generic-error"),"apple pay generic error",{type:c.k$.error})),P.current=!0)},[O,_,v,p,w]),{applePayError:O||"",isDismissed:_||!1}}},651507:function(e,t,r){"use strict";r.d(t,{G:function(){return O}});var n=r(827378),o=r(37017),i=r(747012),a=r(408558),u=r(783244),c=r(907567),l=r(798714),s=r(285087),d=r(96965),f=r(876808),p=r(431113),v=r(570588),y=r(720890);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(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 O=function(){var e,t,r,h,O,_,S,w,P=g((0,n.useState)(""),2),k=P[0],I=P[1],A=(0,v.E)().query,j=(0,n.useRef)(void 0),Z=(0,s.l)(),E=(0,a.iQ)(),x=g((0,o.KO)(f.tu),2),C=x[0],D=x[1],T=g((0,o.KO)(p.mP),1)[0],R=g((0,o.KO)(p.HV),1)[0],U=g((0,u.Z)("hf_prefill_zipcode"),1)[0],M=g((0,u.Z)("hf_activation_flow_customer_priority"),1)[0],N=g((0,u.Z)("hf_cutoff_date"),2)[1],z=g((0,u.Z)("hf_first_delivery_handle"),2)[1],q=g((0,u.Z)("hf_first_delivery_date"),2)[1],F=g((0,u.Z)("hf_stored_zipcode"),2)[1],L=Z.getItem("hf_user_selected_delivery_date")||"",B=Z.getItem("hf_user_selected_delivery_time")||"",K=(0,c.W)({},{suspense:!1}).data,H=(0,l.SZ)(),V=H.cutoffTimeOffsetMinutes,G=H.isNddEnabled,Y=H.timezone,W=(0,d.v7)(),Q=W.selectDefaultDeliveryOption,$=W.selectClosestDeliveryDate,X=W.numDeliveries,J=(0,y.Z)().trackUserZipcodeFilled,ee=(null===(e=T.formData)||void 0===e?void 0:e.postcode)||U||"",et=(null==E?void 0:null===(t=E.items)||void 0===t?void 0:t.length)&&(null===(h=E.items[0])||void 0===h?void 0:null===(r=h.metadata)||void 0===r?void 0:r.productFamily)?null==E?void 0:null===(S=E.items)||void 0===S?void 0:null===(_=S[0])||void 0===_?void 0:null===(O=_.metadata)||void 0===O?void 0:O.productFamily:"",er=(null==E?void 0:null===(w=E.items)||void 0===w?void 0:w.length)&&E.items[0].sku||"",en=(0,i.Sj)(b({family:et,postcode:ee||"",customerJourney:"checkout",customerPriority:M,product:er,numDeliveries:X},(null==K?void 0:K.uuid)&&{customerUUID:K.uuid},V&&{cutoffTimeThreshold:V}),{suspense:!1,enabled:!!(ee&&et&&R&&M)});return(0,n.useEffect)(function(){var e=A.step;void 0!==j.current&&j.current!==e&&en.refetch&&ee&&et&&R&&M&&en.refetch(),j.current=e},[A.step,en.refetch,ee,et,R,M]),(0,n.useEffect)(function(){var e,t=null==en?void 0:en.data;if(t){if((null===(e=t.items)||void 0===e?void 0:e.length)===0){D(m(b({},C),{isDeliverable:!1,isLoading:!1,refetch:en.refetch,isNDDDeliveryPresent:!1,resolvedForPostcode:ee})),J(ee,!1,et),I(ee);return}var r=(0,f.bl)(t.items,G,Y,Q,$);if(null==r?void 0:r.deliveryDateOption){var n=r.deliveryDateOption,o=r.defaultHandle,i=""!==k&&k!==ee;i&&(Z.removeItem("hf_user_selected_delivery_date"),Z.removeItem("hf_user_selected_delivery_time"));var a=n.deliveryDate.deliveryDate,u=a,c=o,l=n;if(L&&B&&!i){var s=t.items.find(function(e){return e.deliveryDate.deliveryDate===L});s&&s.deliveryOptions.find(function(e){return e.handle===B})?(u=L,c=B,l=s):(Z.removeItem("hf_user_selected_delivery_date"),Z.removeItem("hf_user_selected_delivery_time"))}if(!((null==C?void 0:C.selectedDeliveryDate)===u&&(null==C?void 0:C.selectedDeliveryTime)===c)&&(!(null==C?void 0:C.selectedDeliveryDate)||i||L&&B))D({selectedDelivery:l,availableDeliveryDateOptions:t.items,selectedDeliveryDate:u,selectedDeliveryTime:c,firstDeliveryDate:(null==C?void 0:C.firstDeliveryDate)||a||u,firstDeliveryTime:(null==C?void 0:C.firstDeliveryTime)||o||c,isDeliverable:t.items.length>0,isLoading:!1,dosId:(null==t?void 0:t.dos_id)||"",refetch:en.refetch,isNDDDeliveryPresent:r.isNDDDeliveryPresent||!1,resolvedForPostcode:ee}),N(l.deliveryDate.cutoffDate||""),z(c||""),q(u||""),F(ee);else{var d=t.items.length>0,p=(null==t?void 0:t.dos_id)||"",v=r.isNDDDeliveryPresent||!1;(null==C?void 0:C.availableDeliveryDateOptions)===t.items&&(null==C?void 0:C.isDeliverable)===d&&(null==C?void 0:C.isLoading)===!1&&(null==C?void 0:C.dosId)===p&&(null==C?void 0:C.refetch)===en.refetch&&(null==C?void 0:C.isNDDDeliveryPresent)===v&&(null==C?void 0:C.resolvedForPostcode)===ee||D(m(b({},C),{availableDeliveryDateOptions:t.items,isDeliverable:d,isLoading:!1,dosId:p,refetch:en.refetch,isNDDDeliveryPresent:v,resolvedForPostcode:ee}))}J(ee,!0,et),I(ee)}}},[null==en?void 0:en.data,null==en?void 0:en.refetch,G,Y,Q,$,ee,
1null==C?void 0:C.selectedDeliveryDate,null==C?void 0:C.firstDeliveryDate,null==C?void 0:C.firstDeliveryTime,k]),{deliveryOptions:C,deliveryOptionsQuery:en,isLoading:C.isLoading,isSuccess:en.isSuccess,isError:en.isError,productFamily:et,product:er}}},929113:function(e,t,r){"use strict";r.d(t,{l:function(){return i}});var n=r(237947),o=r(713113),i=function(){var e=(0,n.o)(),t="1"===e[o.q5];return{isGiftCardBuyer:"1"===e[o.tA],isGiftCardRedeemer:t}}},863626:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var n=r(235487),o=r(268481),i=function(){var e=(0,n.D)(),t=e.isMobile,r=e.isTablet,i=(0,o.Sj)();return{isMobile:t||"mobile"===i,isTablet:r||"tablet"===i}}},570588:function(e,t,r){"use strict";r.d(t,{E:function(){return c}});var n=r(827378),o=r(581340),i=r(748966),a=function(){var e;function t(e){var r,n;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=void 0,(r="_query")in this?Object.defineProperty(this,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[r]=n,this._query=e||{},this.setQueryKey=this.setQueryKey.bind(this),this.removeQueryKey=this.removeQueryKey.bind(this),this.toQueryParams=this.toQueryParams.bind(this),this.toQueryString=this.toQueryString.bind(this)}return e=[{key:"setQueryKey",value:function(e,t){return this._query[e]=t,this}},{key:"removeQueryKey",value:function(e){var t=this;return"string"==typeof e?delete this._query[e]:(null==e?void 0:e.length)&&e.forEach(function(e){delete t._query[e]}),this}},{key:"toQueryParams",value:function(){return this._query}},{key:"toQueryString",value:function(){return"?"+(0,i.stringify)(this._query)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),u=function(e){try{return(0,i.parse)(e)}catch(e){return{}}},c=function(){var e,t=(0,o.t)().asPath,r=n.useMemo(function(){var e,r,n;return new a(Object.keys(n=u(null!==(r=null==t?void 0:null===(e=t.split("?"))||void 0===e?void 0:e[1])&&void 0!==r?r:"")).reduce(function(e,t){var r=n[t];return void 0===r||(e[t]=r),e},{}))},[t]);return{query:r.toQueryParams(),queryBuilder:r,path:null==t?void 0:null===(e=t.split("?"))||void 0===e?void 0:e[0]}}},720890:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(966622),o=r(943701),i=r(887824),a=r(285087),u=r(783244),c=r(827378),l=r(973635),s=r(365567),d=r.n(s),f=r(361193),p=r(536136),v=r(739968),y=r(131571),h=r(60074),b=r(206627),m=r(52130),g=function(){var e=(0,m.L3)().trackJanusEvent;return{trackZipcodeAvailable:(0,c.useCallback)(function(t){try{e(b.i.janusEvent({event:b.i.event({systemMessage:"zipcode_available:".concat(t)})}))}catch(e){(0,h.Tb)(e,{tags:{event:"CheckoutAddress_ZipcodeAvailable_SystemAction",component:"useCheckoutAddressZipcodeAvailableSnowplowEvent"}})}},[e])}};function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_(e,t,r[t])})}return e}function w(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))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.")}()}var k="This field is required",I=function(){var e=(0,i.Z)().push,t=(0,n.py)({runUsingStatsig:!0}).track,r=(0,o.R)({runUsingStatsig:!0}),s=r.id,h=r.attributes,b=(0,p.M)().trackAddressFieldEdit,m=P((0,c.useState)({}),2),O=m[0],I=m[1],A=P((0,c.useState)({}),2),j=A[0],Z=A[1],E=(0,f.x)(),x=E.isReady,C=E.isExpressCheckoutEnabled,D=g().trackZipcodeAvailable,T=(0,v.B)().trackZipcodeInvalid,R=(0,y.q)().trackAddressErrorMessage,U=(0,a.l)(),M=P((0,u.Z)("hf_funnel_name"),1)[0],N=U.getItem("hf_applepay_error"),z=U.getItem("hf_express_checkout_use_normal_flow"),q="Variation"===U.getItem("hf_express_checkout_variation_phase_2"),F=x&&C||q,L=function(r){var n=r.event_name,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,["event_name"]);e(r),s&&t({experimentationUserId:s,experimentationUserAttributes:h,eventName:n,eventTags:Object.keys(o).reduce(function(e,t){var r=o[t],n=(0,l.zf)(t);return w(S({},e),_({},n,"string"==typeof r?r:d()(r)))},{})})},B=function(){var e=(0,l.TN)(j);e&&(L({event:"gaEventTrigger",event_name:"CheckoutAddress_SubmitError",screen:"Checkout address form",error_info:e,gaEventCategory:"checkout accordeon",gaEventAction:"section error addressForm",gaEventLabel:e}),R(e))};return{trackAddressFieldTouch:function(e,t){if(!O[e]&&l.wx[e]&&t&&(L(l.wx[e]),I(function(t){return w(S({},t),_({},e,!0))})),"billingAddressType"===e){var r="billing"===t;L((0,l.An)(r)),L((0,l._3)(r)),L((0,l.Dz)(r))}},trackAddressFieldError:function(e,t,r,n){if("phone"===e&&(n!==k||r)&&L((0,l.qA)()),!r){var o=n||k,i=j[e];B(),i&&i===o||(L((0,l.is)(o)[e]),Z(function(t){return w(S({},t),_({},e,o))}))}},trackUserZipcodeFilled:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e&&(L((0,l.xU)(e,t,r)),t?D(e):T(e),!t&&s&&L((0,l.aC)(s)))},trackUpdatedField:function(e){var t=(0,l.gD)(e);t&&(L(t),b(e,t.changedField))},trackAddressCTANextStepClick:function(r,n,o){e({event:"gaEventTrigger",gaEventCategory:"deliveryInstructionsFunnel",gaEventLabel:"".concat(r," | ").concat(n),delivery_slot:r,first_delivery_date:n,delivery_instructions:"",gaEventNonInteraction:!1,gaEventAction:"clickNextStepCta",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Checkout address form",event_name:"CheckoutAddress_NextStepCtaClick"}),F&&(e(S({event:"gaEventTrigger",event_name:"CheckoutAddress_UseOtherPaymentMethod",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:"ExpressCheckoutUseOtherPaymentMethodClick",gaEventLabel:'a user clicks on "Use other payment method" ("Next" CTA) on address page - isExpressCheckoutPhase2: '.concat(q),brand:"HelloFresh",tribe:"Payments",screen:"Checkout address form"},M?{funnel_name:M}:{})),t({experimentationUserId:s||"",experimentationUserAttributes:h,eventName:"CheckoutAddress_UseOtherPaymentMethod",eventTags:S({event:"gaEventTrigger",EventCategory:"Payments_ExpressCheckout",EventAction:"ExpressCheckoutUseOtherPaymentMethodClick",EventLabel:'a user clicks on "Use other payment method" ("Next" CTA) on address page - isExpressCheckoutPhase2: '.concat(q),screen:"Checkout address form"},M?{funnel_name:M}:{})})),t({experimentationUserId:s||"",experimentationUserAttributes:h,eventName:"CheckoutAddress_NextStepCtaClick",eventTags:{event:"gaEventTrigger",delivery_slot:r,first_delivery_date:n,delivery_instructions:o||"",EventCategory:"deliveryInstructionsFunnel",EventAction:"clickNextStepCta",EventLabel:"".concat(r," ").concat(n," ").concat(o)}})},trackAddressCTALoad:function(){e({event:"gaEventTrigger",event_name:"CheckoutAddress_CTALoad",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:"AddressStep|NextStepCta|load",gaEventLabel:"Next CTA loaded on page - isExpressCheckoutVariation: ".concat(C||"false",", hasApplePayError: ").concat(N||"false",", isNormalCheckoutFlow: ").concat(z||"false"),screen:"Checkout address form"})},trackAddressCTAScroll:function(){e({event:"gaEventTrigger",event_name:"CheckoutAddress_CTAScroll",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:"AddressStep|NextStepCta|scroll",gaEventLabel:"Next CTA scrolled into view - isExpressCheckoutVariation: ".concat(C||"false",", hasApplePayError: ").concat(N||"false",", isNormalCheckoutFlow: ").concat(z||"false"),screen:"Checkout address form"})}}}},431113:function(e,t,r){"use strict";r.d(t,{HV:function(){return f},Q0:function(){return d},T1:function(){return p},Xs:function(){return v},mP:function(){return l},oP:function(){return s}});
1var n=r(37017),o=r(859737),i=r(194924),a=r(718583),u=r(713113);function c(){return{getItem:function(e){var t=a.ZP.getItem(e);if(null===t)return o.o5;try{return JSON.parse(t)}catch(e){return o.o5}},setItem:function(e,t){try{a.ZP.setItem(e,JSON.stringify(t))}catch(e){}},removeItem:function(e){return a.ZP.removeItem(e)}}}var l=(0,i.O4)(u.Sn,{isValid:!1,formData:{firstName:"",lastName:"",address1:"",address1Street:"",address2:"",city:"",region:"",postcode:"",phone:"",address2Comment:"",address2CommentCustom:""}},c()),s=(0,i.O4)("".concat(u.Sn,"-valid"),!1,c()),d=(0,n.cn)(function(e){var t;return null===(t=e(l).formData)||void 0===t?void 0:t.postcode}),f=(0,n.cn)(!0),p=(0,n.cn)(!0),v=(0,n.cn)(null)},876808:function(e,t,r){"use strict";r.d(t,{bl:function(){return u},tu:function(){return a}});var n=r(37017),o=r(696418),i=r(229714),a=(0,n.cn)({selectedDelivery:null,availableDeliveryDateOptions:[],selectedDeliveryDate:"",selectedDeliveryTime:"",firstDeliveryDate:"",firstDeliveryTime:"",isDeliverable:!1,isLoading:!0,dosId:"",isNDDDeliveryPresent:!1,resolvedForPostcode:""}),u=function(e,t,r){var n,a,u=!(arguments.length>3)||void 0===arguments[3]||arguments[3],c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=(0,i.gP)(e,t,r),s=l.deliveryDateOption,d=l.defaultHandle,f=!!(t&&s&&d);if(c)return n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},(0,o.Cs)(e)),a=a={isNDDDeliveryPresent:f},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(a)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}),n;if(t&&s&&d)return{deliveryDateOption:s,defaultHandle:d,isNDDDeliveryPresent:f};var p=(0,o.e2)(e);return u&&p.defaultMoment&&p.defaultHandle?{deliveryDateOption:p.defaultMoment,defaultHandle:p.defaultHandle,isNDDDeliveryPresent:f}:{deliveryDateOption:e[0],defaultHandle:e[0].deliveryOptions[0].handle,isNDDDeliveryPresent:f}}},573150:function(e,t,r){"use strict";r.d(t,{$:function(){return i},I:function(){return o}});
1var n=r(37017),o=(0,n.cn)(null),i=(0,n.cn)(!1)},853280:function(e,t,r){"use strict";r.d(t,{r:function(){return i},s:function(){return o}});var n=r(37017),o=(0,r(194924).O4)("checkout-receive-offers-consent-state",null),i=(0,n.cn)(null)},204534:function(e,t,r){"use strict";var n,o,i,a,u,c,l,s;r.d(t,{OX:function(){return a},T3:function(){return i},a9:function(){return o},hI:function(){return n}}),(u=n||(n={})).SIMPLE="simple",u.SHOW_MORE="showMore",u.NONE="none",(c=o||(o={})).MAIN="main",c.SUMMARY="summary",c.MOBILE_SUMMARY="mobile-summary",(l=i||(i={})).address="address",l.delivery="delivery",l.payment="payment",l.expressCheckout="expressCheckout",(s=a||(a={})).neutral="neutral",s.valid="valid",s.progress="progress",s.error="error"},487803:function(e,t,r){"use strict";r.d(t,{p6:function(){return k}});var n=r(858087),o=r.n(n),i=r(7106),a=r.n(i),u=r(385963),c=r.n(u),l=r(518002),s=r.n(l),d=r(512052),f=r.n(d),p=r(895951),v=r.n(p),y=r(931721),h=r.n(y),b=r(973205),m=r.n(b),g=r(179478),O=r.n(g),_=r(680199),S=r.n(_),w=r(244502),P=r.n(w),k=function(e,t,r){return S()(P()(e&&e.includes("+")?e.substr(0,e.indexOf("+")):e),r,{locale:{"de-DE":o(),"de-CH":o(),"de-AT":o(),"en-GB":a(),"en-US":a(),"en-AU":a(),"en-NZ":a(),"en-CA":a(),"en-DK":a(),"en-SE":a(),"en-BE":a(),"en-NL":a(),"en-DE":a(),"fr-FR":c(),"fr-CA":c(),"fr-LU":c(),"fr-BE":c(),"nl-BE":s(),"nl-NL":s(),"sv-SE":f(),"da-DK":v(),"nb-NO":h(),"it-IT":m(),"es-ES":O()}[t]||a()})}},696418:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{Cs:function(){return a},F4:function(){return i},e2:function(){return o}});var o=function(e){var t=null,r="",n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c=a.value,l=c.deliveryOptions.find(function(e){return e.isDefault});if(l){t=c,r=l.handle;break}}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return{defaultMoment:t,defaultHandle:r}},i=function(e){var t,r,n=null==e?void 0:e.selectedDeliveryTime,o=null==e?void 0:null===(r=e.selectedDelivery)||void 0===r?void 0:null===(t=r.deliveryOptions)||void 0===t?void 0:t.find(function(e){return e.handle===n});return{delivery_time:(null==o?void 0:o.subscriptionDeliveryOptionHandle)||n||"",delivery_weekday:(null==o?void 0:o.deliveryDay)||""}},a=function(e){if(!e||0===e.length)return{deliveryDateOption:null,defaultHandle:""};var t=function(e,t){var r=function(e){var t=new Date("January 1 1970 ".concat(e.deliveryFrom));return new Date("January 1 1970 ".concat(e.deliveryTo)).getTime()-t.getTime()},n=r(e),o=r(t);return n===o?0:n<o?1:-1},r={},o=!0,i=!1,a=void 0;try{for(var u,c,l=e[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var s,d=c.value,f=null==d?void 0:null===(s=d.deliveryOptions)||void 0===s?void 0:s.filter(function(e){return 0===e.price||!e.price});if(f.length>0){var p=((function(e){if(Array.isArray(e))return n(e)})(f)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e,t){if(e){if("string"==typeof e)return n(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,void 0)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(t);r[d.deliveryDate.deliveryDate]={options:p,moment:d}}}}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}var v=Object.keys(r)[0],y=v?r[v]:null,h=y&&y.options&&y.options.length>0?y.options[0]:null;return h?{deliveryDateOption:(null==y?void 0:y.moment)||null,defaultHandle:h.handle}:{deliveryDateOption:e[0],defaultHandle:(null===(u=e[0].deliveryOptions[0])||void 0===u?void 0:u.handle)||""}}},229714:function(e,t,r){"use strict";r.d(t,{gP:function(){return a},ix:function(){return u},mr:function(){return i},r5:function(){return o}});var n=r(798714),o=function(e){return!!e.find(function(e){var t,r,n=(null!==(r=null===(t=e.deliveryDate)||void 0===t?void 0:t.supportedOptionTypes)&&void 0!==r?r:[]).includes("NEXT_DAY_DELIVERY"),o=e.deliveryOptions.some(function(e){return"NEXT_DAY_DELIVERY"===e.type});return n&&o})},i=function(e,t){return e.find(function(e){var r,o;return(0,n.ev)(null==e?void 0:null===(r=e.deliveryDate)||void 0===r?void 0:r.deliveryDate,t)||(0,n.HK)(null==e?void 0:null===(o=e.deliveryDate)||void 0===o?void 0:o.deliveryDate,t)})},a=function(e,t,r){if(!t||!o(e))return{deliveryDateOption:null,defaultHandle:null};var n,a=i(e,r||""),u=null==a?void 0:null===(n=a.deliveryOptions)||void 0===n?void 0:n.find(function(e){return 0===e.price});return{deliveryDateOption:a,defaultHandle:null==u?void 0:u.handle}},u=function(e){return!!e&&!isNaN(new Date(e).getTime())}},973635:function(e,t,r){"use strict";r.d(t,{An:function(){return E},Dz:function(){return C},Go:function(){return z},TN:function(){return D},_3:function(){return x},aC:function(){return U},gD:function(){return M},is:function(){return j},qA:function(){return T},wx:function(){return A},xU:function(){return R},zf:function(){return N}});var n,o,i=r(713113);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u="address1",c="address2",l="address1Street",s="address1No",d="firstName",f="lastName",p="postcode",v="
1city",y="phone",h="address2Comment",b="address_firstname",m="address_lastname",g="address_address",O="address_address2",_="address_address_house",S="address_city",w="address_postcode",P="address_phone",k="address_address2Comment",I=function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}({event:"gaEventTrigger",gaEventCategory:"checkout accordeon",gaEventAction:t?"formError":"form",gaEventNonInteraction:!1,event_name:"CheckoutAddress_Field_Fullfilled"},e)},A=(a(n={},d,I({gaEventLabel:b})),a(n,f,I({gaEventLabel:m})),a(n,u,I({gaEventLabel:g})),a(n,c,I({gaEventLabel:O})),a(n,h,I({gaEventLabel:k})),a(n,l,I({gaEventLabel:g})),a(n,s,I({gaEventLabel:_})),a(n,v,I({gaEventLabel:S})),a(n,"region",I({gaEventLabel:"address_region"})),a(n,p,I({gaEventLabel:w})),a(n,y,I({gaEventLabel:P})),n),j=function(e){var t;return a(t={},d,I({gaEventLabel:"".concat(b,"_").concat(e)},!0)),a(t,f,I({gaEventLabel:"".concat(m,"_").concat(e)},!0)),a(t,u,I({gaEventLabel:"".concat(g,"_").concat(e)},!0)),a(t,c,I({gaEventLabel:"".concat(O,"_").concat(e)},!0)),a(t,h,I({gaEventLabel:"".concat(k,"_").concat(e)},!0)),a(t,l,I({gaEventLabel:"".concat(g,"_").concat(e)})),a(t,s,I({gaEventLabel:"".concat(_,"_").concat(e)})),a(t,v,I({gaEventLabel:"".concat(S,"_").concat(e)},!0)),a(t,p,I({gaEventLabel:"".concat(w,"_").concat(e)},!0)),a(t,y,I({gaEventLabel:P},!0)),t},Z=(a(o={},d,"firstname"),a(o,f,"lastname"),a(o,y,"phone"),a(o,u,"addressLine1"),a(o,l,"addressLine1"),a(o,v,"City"),a(o,p,"PostCode"),o),E=function(e){return{event:"gaEventTrigger",gaEventCategory:"deliveryInstructionsFunnel",gaEventLabel:"current: ".concat(e?"sameBillingAddress":"differentBillingAddress"),gaEventNonInteraction:!1,gaEventAction:"clickOnBillingAddress",screen:"Checkout address form",event_name:"CheckoutAddress_BillingAddressClick"}},x=function(e){return I({gaEventLabel:"".concat("address_billing","_").concat(e?"differentBillingAddress":"sameBillingAddress")})},C=function(e){return{event:"gaEventTrigger",gaEventCategory:"deliveryInstructionsFunnel",gaEventLabel:"current: ".concat(e?"sameBillingAddress":"differentBillingAddress"," | changeTo: ").concat(e?"differentBillingAddress":"sameBillingAddress"),gaEventNonInteraction:!1,gaEventAction:"changeBillingAddress",screen:"Checkout address form",event_name:"CheckoutAddress_BillingAddressEdit"}},D=function(e){var t=document.forms.namedItem(i.B2);if(t){var r=t.querySelectorAll('input[aria-invalid="true"]');if(0!==r.length){var n=[];return r.forEach(function(t){var r=e[t.name];r&&n.push("".concat(t.name,"_").concat(r))}),n.join(", ")}}},T=function(){return I({gaEventLabel:"".concat(P,"-validating")},!1)},R=function(e,t,r){if(t){var n=e.substring(0,3);return{event:"gaEventTrigger",event_name:"CheckoutAddress_ZIPCodeFilled",gaEventCategory:"checkout accordeon",gaEventAction:"ZIPCodeEntered",screen:"Checkout address form",gaEventLabel:n,ZIP_first_3_digits:n}}return I({event:"gaEventTrigger",gaEventCategory:"funnel",gaEventAction:"zip code not served",gaEventLabel:"".concat(e,"_").concat(r),zip_code:"".concat(e),screen:"Checkout address form",event_name:"CheckoutAddress_ZipcodeNotValid"},!0)},U=function(e){return{event:"gaEventTrigger",squad:"checkout",tribe:"Conversions",gaEventCategory:"checkout accordeon",gaEventAction:"formError",gaEventLabel:"ShippingRescue|".concat(e),gaEventNonInteraction:!1,event_name:"Checkout_FormFieldError",error_info:"ShippingRescue|".concat(e)}},M=function(e){var t=Z[e];if(t)return{event:"gaEventTrigger",event_name:"CheckoutAddress_ChangeFilledField",squad:"checkout",tribe:"Conversions",screen:"Checkout address form",gaEventCategory:"checkout accordeon",gaEventAction:"addressField | change",gaEventLabel:t,changedField:t}},N=function(e){switch(e){case"gaEventCategory":return"EventCategory";case"gaEventAction":return"EventAction";case"gaEventLabel":return"EventLabel";default:return e}},z=function(e){return JSON.stringify(Object.fromEntries(e))}},878250:function(e,t,r){"use strict";var n=r(687800),o=r(827378),i=r(768587),a=r(783045),u=r(713113),c=r(164528),l=r(553911);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}t.Z=function(e){var t,r=e.openTranslationKey,d=e.closeTranslationKey,f=e.seeMoreTranslationKey,p=e.id,v=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return s(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(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.")}(),y=v[0],h=v[1],b=(0,c.ZP)(u.l3).translateRaw,m=(0,a.LU)().isHelloFreshTheme,g=b(r),O=b(d),_=b(f);return(0,n.tZ)(n.HY,{children:(0,n.BX)(i.xv,{type:["body-xs-regular","body-sm-regular"],as:"p","data-test-id":p,pseudo:{"& a":{color:"alias.interactive.foreground.default",fontWeight:m?"body-bold":"body-regular",textDecoration:"underline"},"& a:hover":{textDecoration:"none"}},children:[(0,n.tZ)(l.Z,{copy:y?g:O,hasMarkdown:!0}),!y&&(0,n.tZ)(i.xu,{as:"button",cursor:"pointer",textDecoration:"underline",onClick:function(){return h(!0)},borderWidth:0,backgroundColor:"transparent",p:"zero",display:"inline",children:(0,n.tZ)(i.xv,{type:["body-xs-regular","body-sm-regular"],children:" ".concat(_)})})]})})}},449301:function(e,t,r){"use strict";r.d(t,{f:function(){return I},n:function(){return A}});var n=r(687800),o=r(827378),i=r(581340),a=r(285087),u=r(204534),c=r(497249),l=r(863626),s=r(504243),d=r(662018),f=r(783244);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var v=function(){var e,t=(function(e){if(Array.isArray(e))return e}(e=(0,f.Z)("hf_meal_selection_cart"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return p(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];if(!t)return!1;try{var r=JSON.parse(t);return"meals"in(null==r?void 0:r.value)}catch(e){return!1}},y=r(361193),h=r(645135),b=function(){var e=(0,y.x)().isExpressCheckoutEnabled,t=(0,l.W)().isMobile,r=(0,a.l)(),n=(0,h.I)().applePayError,i=r.getItem("hf_express_checkout_use_normal_flow"),c=v(),s=(0,o.useMemo)(function(){return t?c?[u.T3.address,u.T3.payment]:[u.T3.address,u.T3.delivery,u.T3.payment]:[u.T3.address,u.T3.payment]},[t,c]),d=n||"true"===i||!e||t&&c;return(0,o.useMemo)(function(){return d?s:[u.T3.address,u.T3.expressCheckout]},[d,s])};function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var O=(0,o.createContext)(null),_=function(e){try{var t=e.startsWith("/")?"".concat(window.location.origin).concat(e):e,r=new URL(t).searchParams.get("step");if(!r)return u.T3.address;return r in u.T3?r:u.T3.address}catch(e){return u.T3.address}},S=function(e){var t=Array.isArray(e.step)?e.step[0]:e.step;return t&&t in u.T3?t:u.T3.address},w=function(){return _(window.location.href)},P=function(e){var t=e.split("?")[1];return t?Object.fromEntries(new URLSearchParams(t)):{}},k=function(e,t,r,n,o,i,a){var c=P(window.location.href);t===u.T3.address?(delete c.step,delete c.method,r.setItem("address_form_step_completed","true")):t===u.T3.delivery?(c.step=t,r.setItem("address_delivery_window_step_completed","true")):t===u.T3.payment?(c.step=t,r.setItem("payment_page_visited","true")):t===u.T3.expressCheckout&&(c.step=t,r.setItem("express_checkout_visited","true"));var l=g({},c);(null==c?void 0:c.step)&&(delete l.step,l=g({step:c.step},l));var s=n.startSpan("lego-checkout-step-change",{attributes:{step:t}});return i({legoCheckoutTransition:"".concat(o," to ").concat(t)}),((null==a?void 0:a.replace)?e.replace:e.push).call(e,{pathname:"/checkout",query:l},void 0,{shallow:!0}).catch(function(){return s.recordException(Error("Failed to push new route")),s.setAttribute("error",!0),window.location.reload(),!1}).finally(function(){s.end()})},I=function(e){var t,r=e.children,f=(0,i.t)(),p=(0,a.l)(),y=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(function(){return S(f.query)}))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return m(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(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.")}(),h=y[0],g=y[1],P=(0,c.T)(),I=(0,s.C)().startPageTransition,A=(0,d.Z)().recordStep;(0,o.useEffect)(function(){g(w())},[]),(0,o.useEffect)(function(){var e=function(e){g(_(e))},t=function(){window.scrollTo({top:0,behavior:"smooth"})};return f.events.on("routeChangeComplete",e),f.events.on("beforeHistoryChange",t),function(){f.events.off("routeChangeComplete",e),f.events.off("beforeHistoryChange",t)}},[f.events]),(0,o.useEffect)(function(){var e=S(f.query);e!==h&&g(e)},[f.query,h]);var j=b(),Z=j.indexOf(h);(0,o.useEffect)(function(){A({path:"/checkout",name:h,index:Z+1})},[h]);var E=(0,l.W)().isMobile,x=v(),C=(0,o.useRef)(!1);(0,o.useEffect)(function(){if(!C.current&&E&&x){var e=w();(e===u.T3.delivery||e===u.T3.expressCheckout)&&(C.current=!0,k(f,u.T3.payment,p,P,e,I,{replace:!0}))}},[]);var D=(0,o.useCallback)(function(){var e=p.getItem("hf_express_checkout_use_normal_flow");if(h===u.T3.address&&"true"===e)return k(f,E&&x?u.T3.payment:E?u.T3.delivery:u.T3.payment,p,P,h,I);var t=Z+1;return t>=j.length?Promise.resolve(!1):k(f,j[t],p,P,h,I)},[f,Z,j,p,P,h,E,x,I]),T=(0,o.useCallback)(function(e){return k(f,e,p,P,h,I)},[f,p,P,h,I]),R=(0,o.useMemo)(function(){return{step:h,isLastStep:Z===j.length-1,isInitialStep:0===Z,checkoutPages:j,goToNextPage:D,goToStep:T}},[h,Z,j,D,T]);return(0,n.tZ)(O.Provider,{value:R,children:r})},A=function(){var e=(0,o.useContext)(O);if(!e)throw Error("useCheckoutRouteContext must be used within a CheckoutRouteProvider");return e}}},function(e){e.O(0,[47057,38579,12737,8139,14206,44355,61403,40889,85698,50134,18629,17827,3243,83030,32857,69190,64901,94924,40412,16289,87519,64376,57252,36060,24400,14005,81989,95851,77007,39793,62762,30947,254,69869,40690,64949,14197,63850,92888,49774,40179],function(){return e(e.s=211876)}),_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.