PageSourceSearch

https://www.hellofresh.de/_next/static/chunks/pages/good-chop/checkout-df3a7d7acc074d6b.js

js hellofresh.de collected 2026-09-25 23:39:09 UTC 211,577 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51184,45818,59737,67610,78949,74050,64291,86282],{872657:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/good-chop/checkout",function(){return r(700166)}])},10198:function(e,t,r){"use strict";r.d(t,{vr:function(){return Z},SV:function(){return j}});var n,o,i=r(456552),l=r(827378),a=r(534243),u=r(671718),c=r(26124),s=r(140224),d=r(841723),f=r(64294),p=r(808215),y=r(783244),h=function(e){var t,r,n,o,i,l,a,u,c,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!==(a=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!==a?a:[],voucherCode:null!==(u=e.couponCode)&&void 0!==u?u:"",shippingAddress:e.shippingAddress?{address1:null!==(c=null==e?void 0:null===(n=e.shippingAddress)||void 0===n?void 0:n.address1Street)&&void 0!==c?c:"",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===(l=e.shippingAddress)||void 0===l?void 0:l.postcode)&&void 0!==f?f:""}:void 0,checkoutType:e.checkoutType}},v=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}},m=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}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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,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);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(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],l=g({handle:null==i?void 0:i.deliveryOption,date:"string"==typeof(t=null==i?void 0:i.deliveryDate)?t.split("T")[0]:t}),a=(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[m.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:l,products:a,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 w(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,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}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}))),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 x(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(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 w(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A="hf_prefill_zipcode",C=(n=function(e,t){var r,n,o,i,l,c,s,d,p,y,m=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(b){switch(b.label){case 0:if(r=m.length>2&&void 0!==m[2]?m[2]:u.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,a.Z)("".concat(d,":").concat(i.hfPublicIDSuffix),a.Z.URL):d))throw Error("Missing required parameter: hfPublicID");return y=h(x(k({},i),{businessDivision:o,hfPublicID:p})),[4,r("/activations/checkout/price",t,{method:"POST",headers:k({"Content-Type":"application/json"},i.headers),data:x(k({},y),{country:n.toUpperCase()}),parentSpan:i.parentSpan,fetchSpanAttributes:{"request.backend_service":"price-service","request.backend_action":"activations-checkout-price","sales.channel":(null===(l=i.headers)||void 0===l?void 0:l["Checkout-Context-Sales-Channel"])||"none","sales.conversion_funnel":(null===(c=i.headers)||void 0===c?void 0:c["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,b.sent().json()];case 2:return[2,v.apply(void 0,[b.sent()])]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){S(i,r,o,l,a,"next",e)}function a(e){S(i,r,o,l,a,"throw",e)}l(void 0)})},function(e,t){return o.apply(this,arguments)}),Z=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,l=o.region_code,a=P((0,y.Z)(A)||[""],1)[0],u=(null===(t=e.shippingAddress)||void 0===t?void 0:t.postcode)||a||"",d=x(k({},e),{businessDivision:{brand:i,regionCode:l},shippingAddress:x(k({},e.shippingAddress),{postcode:u})}),f=O(d);return(0,c.Z)(f,function(e){return C(k({},d,n),f,e)},k({enabled:!!u,staleTime:3e4},r))},j=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=P((0,y.Z)(A)||[""],1)[0],o=(0,i.useQueryClient)(),a=(0,s.O)(),u=(null===(t=e.shippingAddress)||void 0===t?void 0:t.postcode)||n||"",f=(0,p.Z)(),h=f.brand,v=f.region_code,m=P((0,l.useState)(""),2),b=m[0],g=m[1],w=!!u&&(0,d.v)(u,a.systemCountry);(0,l.useEffect)(function(){w&&u&&g(u)},[u,w]);var S=x(k({},e),{businessDivision:{brand:h,regionCode:v},shippingAddress:x(k({},e.shippingAddress),{postcode:u})}),Z=w?u:b,j=O(x(k({},S),{shippingAddress:x(k({},S.shippingAddress),{postcode:Z})}));return(0,c.Z)(j,function(e){return C(k({},S,a),j,e)},k({enabled:!!Z,staleTime:3e4,initialData:!w&&b?o.getQueryData(j):void 0},r))}},665003:function(e,t,r){"use strict";r.d(t,{u:function(){return f}});var n,o,i=r(671718),l=r(407108),a=r(140224),u=r(699219);function c(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).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}
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}var d=(n=function(e,t){var r,n,o,l,a,u,c=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(d){switch(d.label){case 0:return r=e.id,n=e.systemCountry,o=e.locale,l=e.payload,u=void 0===(a=e.productParams)?{}:a,[4,(c.length>2&&void 0!==c[2]?c[2]:i.Z)("/api/addresses/".concat(r),t,{method:"PATCH",data:{address:l},query:s({country:n,locale:o},u),headers:{"Content-Type":"application/json"},fetchSpanAttributes:{"request.backend_service":"customer-address-service","request.backend_action":"patch-address"}})];case 1:return[2,d.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){c(i,r,o,l,a,"next",e)}function a(e){c(i,r,o,l,a,"throw",e)}l(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,a.O)(),r=[u.Z["customer.patch.address"]];return(0,l.Z)(r,function(e,n){return d(s({},n,t),r,e)},s({},e))}},711554:function(e,t,r){"use strict";r.d(t,{h:function(){return f}});var n,o,i=r(671718),l=r(407108),a=r(140224),u=r(699219);function c(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).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}var d=(n=function(e,t){var r,n,o,l=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(a){switch(a.label){case 0:return r=l.length>2&&void 0!==l[2]?l[2]:i.Z,n=e.systemCountry,o=e.locale,[4,r("/api/customers/me/addresses",t,{method:"POST",data:{address:s({},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","locale"]))},query:{country:n,locale:o},headers:{"Content-Type":"application/json"},fetchSpanAttributes:{"request.backend_service":"customer-address-service","request.backend_action":"post-addresses"}})];case 1:return[2,a.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){c(i,r,o,l,a,"next",e)}function a(e){c(i,r,o,l,a,"throw",e)}l(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,a.O)(),r=[u.Z["customer.save.address"]];return(0,l.Z)(r,function(e,n){return d(s({},n,t),r,e)},s({},e))}},174150:function(e,t,r){"use strict";r.d(t,{f:function(){return d}});var n,o,i=r(671718),l=r(26124),a=r(140224),u=r(699219);function c(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var s=(n=function(e,t){var r,n,o,l,a,u,c,s,d,f,p=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(y){switch(y.label){case 0:return r=e.include,n=e.locale,o=e.systemCountry,l=e.parentSpan,u=void 0!==(a=e.giftCard)&&a,s=void 0!==(c=e.isFreebie)&&c,f=void 0!==(d=e.fetchPrices)&&d,[4,(p.length>2&&void 0!==p[2]?p[2]:i.Z)("/plans-config/v2/2",t,{query:{country:o,locale:n,include:r,is
1Freebie:s,giftCard:u,fetchPrices:f},parentSpan:l},{usePublicAuth:!0})];case 1:return[2,y.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){c(i,r,o,l,a,"next",e)}function a(e){c(i,r,o,l,a,"throw",e)}l(void 0)})},function(e,t){return o.apply(this,arguments)}),d=function(e,t){var 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}))),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}({fetchPrices:!1},e,(0,a.O)()),n=[u.Z["plans-config.v2"],r];return(0,l.Z)(n,function(e){return s(r,n,e)},t)}},917780:function(e,t,r){"use strict";r.d(t,{Y:function(){return f}});var n,o,i=r(456552),l=r(671718),a=r(447178),u=r(699219),c=r(140224);function s(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var d=(n=function(e,t){var r,n,o,i,a=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(u){switch(u.label){case 0:return r=e.parentSpan,n=e.customer_id,o=e.cartId,i=e.data,[4,(a.length>2&&void 0!==a[2]?a[2]:l.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 u.sent(),[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){s(i,r,o,l,a,"next",e)}function a(e){s(i,r,o,l,a,"throw",e)}l(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,c.O)(),r=(0,a.Z)().fetch,n=[u.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}))),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)}},870771:function(e,t,r){"use strict";r.d(t,{Fv:function(){return o},ck:function(){return l},gi:function(){return n},m4:function(){return i}});var n="hf_prefill_zipcode",o="enable_rp_web",i="hf_public_id",l=["/pages/cook-this-big-idea","/pages/inspiration-delivered","/pages/simplydelicious","/pages/resolution","/pages/value-messaging","/pages/cucinare-smart","/pages/meal-kit-delivery","/pages/deliciosamente-simple-1","/
1pages/discountcode","/pages/b2bdiscount"]},786282:function(e,t,r){"use strict";r.d(t,{m:function(){return P}});var n,o,i=r(827378),l=r(567921),a=r.n(l),u=r(581340),c=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,u.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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),1!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)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=a().get("hf_ssr_stored_sku"),l=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(l&&r.length>0)return r;if(e&&"string"==typeof e&&r.length>0){var i=e.split("-").slice(0,2).join("-"),a=r.filter(function(e){return e.split("-").slice(0,2).join("-")===i});if(a.length>0){var u=new Set(a);return u.add(e),Array.from(u)}}return e&&"string"==typeof e?[e]:r.length>0?r:[]},[o,n,t,l])},y=r(140224),h=r(699219),v=function(e){var t=e.voucherCode,r=e.productSkus,n=e.locale,o=e.systemCountry,i=e.discountCommunicationId,l=e.zipcode,a=e.hf_public_id,u=e.checkoutType;return[h.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:a},i&&{discountCommunicationId:i},l&&{zipcode:l},u&&{checkoutType:u})]},m=r(870771),b=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 w(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).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 k(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 x=(n=function(e,t){var r,n,o,i,l,a,u,s,d,f=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(p){switch(p.label){case 0:return r=e.voucherCode,n=e.productSkus,o=e.systemCountry,i=e.locale,l=e.parentSpan,a=e.discountCommunicationId,u=e.zipcode,s=e.hf_public_id,d=e.checkoutType,[4,(f.length>2&&void 0!==f[2]?f[2]:c.Z)("/price-presentation/v2/discount_communication/voucher/".concat(r),t,{query:S({country:o,locale:i,skus:n.join(","),dc_id:a||"",zipcode:u||"",hf_public_id:s||""},void 0!==d&&{checkout_type:d}),parentSpan:l,fetchSpanAttributes:{"request.backend_service":"price-presentation-service","request.backend_action":"get-voucher-discount-communication",discountCommunicationId:a,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 l(e){w(i,r,o,l,a,"next",e)}function a(e){w(i,r,o,l,a,"throw",e)}l(void 0)})},function(e,t){return o.apply(this,arguments)}),P=function(e,t){var r,n,o,l=p(e.productSkus),c=(0,u.t)().asPath,f=(function(e){if(Array.isArray(e))return e}(r=(0,d.Z)(m.gi)||[""])||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),1!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)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],h=(0,i.useMemo)(function(){var e;return(null===(e=a().get("hf_discount_comm_id"))||void 0===e?void 0:e.trim())||""},[]),w=new URLSearchParams((null==c?void 0:c.split("?")[1])||""),P=w&&(null===(n=w.get("discount_comm_id"))||void 0===n?void 0:n.trim())||h||e.discountCommunicationId,A=e.zipcode||f,C=(0,b.Z)().isEnabled,Z=(0,i.useMemo)(function(){return a().get(m.m4)},[]),j=(0,i.useMemo)(function(){return Z||(0,g.ZP)()},[Z]),D=S(k(S(k(S({},e),{productSkus:l}),(0,y.O)()),{discountCommunicationId:e.ignoreDiscountCommId?void 0:P}),A&&{zipcode:A},j&&{hf_public_id:j}),I=v(D),E="string"==typeof e.voucherCode&&e.voucherCode.length>0,_=(null===(o=null==t?void 0:t.enabled)||void 0===o||o)&&E&&l.length>0&&(!C||!!A);return(0,s.Z)(I,function(e){if(C&&!A)throw Error("Zipcode is required for price presentation with regional pricing enabled");return x(D,I,e)},k(S({},t),{enabled:_}))}},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}}},57179:function(e,t,r){"use strict";r.d(t,{C:function(){return h}});var n,o,i=r(456552),l=r(671718),a=r(447178),u=r(140224),c=r(699219);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}function d(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}function f(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){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 y=(n=function(e,t){var r,n,o,i,a,u,c,s,d,y,h=arguments;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(v){switch(v.label){case 0:return r=h.length>2&&void 0!==h[2]?h[2]:l.Z,n=e.systemCountry,o=e.locale,i=e.parentSpan,a=e.headers,u=p(e,["systemCountry","locale","parentSpan","headers"]),[4,r("/order/legacy/process",t,{method:"POST",headers:f({"Content-Type":"application/json"},Object.fromEntries((null==a?void 0:a.entries())||[])),data:f({},u),query:{country:n,locale:o},parentSpan:i,fetchSpanAttributes:{"request.backend_service":"orders-processing-service","request.backend_action":"process-checkout",sku:null===(c=Object.values(u.deliveryMoments)[0])||void 0===c?void 0:c.sku,"cart.id":u.cartID,"customer.id":u.customerId,"address_shipping.id":u.shippingAddressId,"address_billing.id":u.billingAddressId,"coupon.code":u.couponCode,"hf.publicId":u.hfPublicId,"payment.method":u.payment.method,"delivery.date":null===(s=Object.values(u.deliveryMoments)[0])||void 0===s?void 0:s.firstDelivery,"delivery.time":null===(d=Object.values(u.deliveryMoments)[0])||void 0===d?void 0:d.deliveryTime,"payment.prepaid":null===(y=u.payment)||void 0===y?void 0:y.prepaid,"payment.performCharge":u.payment.performCharge}})];case 1:return[2,v.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){d(i,r,o,l,a,"next",e)}function a(e){d(i,r,o,l,a,"throw",e)}l(void 0)})},function(e,t){return o.apply(this,arguments)}),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,a.Z)().fetch,r=(0,u.O)(),n=[c.Z["checkout.order"]];return(0,i.useMutation)(function(e){var o,i,l=e.headers,a=p(e,["headers"]);return y((o=f({},a,r),i=i={headers:l}
1,Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o),((function(e){if(Array.isArray(e))return s(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 s(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 s(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.")}()).concat([a.cartID]),t)},f({retry:!1},e))}},536136:function(e,t,r){"use strict";r.d(t,{M:function(){return a}});var n=r(827378),o=r(60074),i=r(873241),l=r(52130),a=function(){var e=(0,l.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 a}});var n=r(827378),o=r(60074),i=r(778051),l=r(52130),a=function(){var e=(0,l.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])}}},31748:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var n=r(687800),o=r(910043);r(827378);var i=r(188038),l=r.n(i),a=r(581340),u=r(396887),c=r(74144),s=r(958042),d=r(894326),f=r(741541),p=r(527157),y=r(449551),h=r(200770),v=r(543790),m=r(783045),b=r(799969),g=r(793891),O=["[sku]","[week]"],w=function(e,t){if(!t||!e)return"";var r=t||e;return O.forEach(function(t){e.endsWith(t)&&(r=e)}),r},S={"/factorform":"https://www.factorform.com","/factorform/products":"https://www.factorform.com/collections/shop-all","/factorform/products/greens":"https://www.factorform.com/products/greens","/factorform/products/protein":"https://www.factorform.com/products/protein","/factorform/products/hydration":"https://www.factorform.com/products/hydration"},k=function(e){var t;return null!==(t=S[e])&&void 0!==t?t:null},x=r(76683),P=r(208074),A=r(190341),C=function(e){var t,r=(0,P.n)(),n=(0,A.G)().userAgent,o=null==n?void 0:n.getResult(),i=((null==n?void 0:n.getBrowser().name)||"").toLowerCase().includes("safari"),l=(null==o?void 0:null===(t=o.os)||void 0===t?void 0:t.name)==="iOS";return e&&l&&i&&!r};function Z(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 j(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 D=function(e,t){return(0,b.xY)()&&t?t:e},I=function(e){var t,r,i,b=e.overrides,O=(0,u.ew)(),S=(0,c.b)(),P=(0,a.t)(),A=P.pathname,I=P.asPath,E=P.query,_=(0,s.Z)(),T=(0,p.Z)(),M=(0,y.Z)(),R=(0,h.Z)(),N=(0,m.Fg)(),L=(0,d.h)(),B=g.Z.useConfig(),U=B.brandName,F=B.subBrandName,V=B.favIcon,X=B.subBrandFavIcon,K=B.subBrandOGImageUrl,q=B.googleSiteVerificationId,W=B.facebookId,G=B.twitter,H=B.metaLinks,Y=B.links,z=B.pages,J=B.appleItunesAppTag,$=B.ogImageUrl,Q=B.thumbnailImageUrl,ee=B.robots,et=(void 0===ee?{}:ee).shouldNoIndexParameterizedUrls,er=null===(t=w(A,I))||void 0===t?void 0:t.split("?")[0],en=D(U,F),eo=D($,K),ei=D(V,X),el=(er?k(er):null)||(0,f.JM)({baseUrl:S.requestUrl,availableLocales:L,query:E}
1),ea=z[er]||{},eu=ea.image,ec=ea.favIcon,es=ea.title,ed=ea.description,ef=ea.keywords,ep=void 0===ef?[]:ef,ey=ea.customMetaTags,eh=void 0===ey?[]:ey,ev=ea.hreflangs,em=null!=ec?ec:ei,eb=null!==(r=null!=eu?eu:eo)&&void 0!==r?r:em,eg=(0,x.xp)(I,R,et),eO=T===v.Z.hellofresh?"#FAF8F3":N.colors.primary[600],ew=(null==b?void 0:b.hreflangs)&&(null==b?void 0:b.hreflangs.length)>0?b.hreflangs:void 0===ev?[]:ev,eS=(null==b?void 0:b.title)||(void 0===es?en:es)||"HelloFresh",ek=null!==(i=null==b?void 0:b.description)&&void 0!==i?i:void 0===ed?"":ed,ex=J.isEnabled,eP=J.appId,eA=C(ex);return(0,n.BX)(l(),{children:[(0,n.tZ)("title",{children:eS},"title"),(0,n.tZ)("meta",{property:"og:title",content:eS},"og:title"),(0,n.tZ)("meta",{name:"twitter:title",content:eS},"twitter:title"),(0,n.tZ)("meta",{content:eS,name:"apple-mobile-web-app-title"},"apple-mobile-web-app-title"),(0,n.tZ)("meta",{content:ek,name:"description"},"description"),(0,n.tZ)("meta",{content:ek,property:"og:description"},"og:description"),(0,n.tZ)("meta",{name:"twitter:description",content:ek},"twitter:description"),(0,n.tZ)("meta",{name:"author",content:en},"author"),(null==ep?void 0:ep.length)>0?(0,n.tZ)("meta",{content:"cooking, ".concat(en,", ").concat(null==ep?void 0:ep.join(", ")),name:"keywords"},"keywords"):(0,n.tZ)("meta",{content:"cooking, ".concat(en),name:"keywords"},"keywords"),(0,n.tZ)("link",{rel:"icon",type:"image/x-icon",href:em}),(0,n.tZ)("link",{rel:"shortcut icon",href:em}),(0,n.tZ)("link",{rel:"apple-touch-icon",href:em}),eb?(0,n.BX)(n.HY,{children:[(0,n.tZ)("meta",{name:"thumbnail",content:Q||eb},"thumbnail"),(0,n.tZ)("meta",{property:"og:image",content:eb},"og:image"),(0,n.tZ)("meta",{property:"og:image:alt",content:en},"og:image:alt"),(0,n.tZ)("meta",{property:"og:image:width",content:"1140"},"og:image:width"),(0,n.tZ)("meta",{property:"og:image:height",content:"600"},"og:image:height"),(0,n.tZ)("meta",{name:"twitter:image",content:eb},"twitter:image")]}):null,(0,n.tZ)("meta",{content:en,property:"site:name"},"site:name"),(0,n.tZ)("meta",{content:S.requestUrl,property:"url"},"url"),(0,n.tZ)("meta",{content:S.requestUrl,property:"og:url"},"og:url"),(0,n.tZ)("meta",{content:M,name:"country"},"country"),(0,n.tZ)("meta",{content:_,property:"og:locale"},"og:locale"),(0,n.tZ)("link",{href:el,rel:"canonical"},"canonical"),(0,n.tZ)("meta",{content:"product",property:"og:type"},"type"),(0,n.tZ)("meta",{content:O.NEXT_PUBLIC_RELEASE_VERSION,property:"version"},"version"),(0,n.tZ)("meta",{content:eO,name:"theme-color"},"theme-color"),(0,n.tZ)("meta",{content:eO,name:"msapplication-TileColor"},"msapplication-TileColor"),(0,n.tZ)("meta",{content:"width=device-width, initial-scale=1.0, user-scalable=yes",name:"viewport"},"viewport"),(0,n.tZ)("meta",{httpEquiv:"Accept-CH",content:"Width, Viewport-Width, DPR"}),(null==eh?void 0:eh.length)>0?eh.map(function(e){return(0,n.tZ)("meta",{content:e.content,name:e.name},"".concat(e.name,"-").concat(e.content))}):(0,n.tZ)("meta",{content:eg,name:"robots"},"robots"),(null==H?void 0:H.length)>0?H.map(function(e){return(0,o.az)("meta",j(Z({},e),{key:"meta-".concat(e.name)}))}):null,(null==Y?void 0:Y.length)>0?Y.map(function(e,t){return(0,o.az)("link",j(Z({},e),{key:t}))}):null,(null==ew?void 0:ew.length)>0?ew.map(function(e,t){return(0,o.az)("link",j(Z({rel:"alternate"},e),{key:t}))}):null,q.map(function(e,t){return(0,n.tZ)("meta",{content:e,name:"google-site-verification"},"google-site-verification-".concat(t))}),W?(0,n.tZ)("meta",{content:W,property:"fb:app_id"},"facebook"):null,G?(0,n.tZ)("meta",{content:G,property:"twitter:site"},"twitter"):null,(0,n.tZ)("meta",{name:"twitter:card",content:"summary_large_image"},"twitter:card"),(0,n.tZ)("meta",{property:"twitter:domain",content:S.requestUrl},"twitter:domain"),(0,n.tZ)("meta",{property:"twitter:url",content:S.requestUrl},"twitter:url"),eA&&(0,n.tZ)("meta",{name:"apple-itunes-app",content:"app-id=".concat(eP)},"apple-itunes-app")]})},E=function(e){var t;return(0,n.BX)(n.HY,{children:[(0,n.tZ)(l(),{children:(0,n.tZ)("title",{children:(null===(t=e.overrides)||void 0===t?void 0:t.t
1itle)||"HelloFresh"},"title")}),(0,n.tZ)(g.Z.ProjectConfigProvider,{children:(0,n.tZ)(I,Z({},e))})]})}},793891:function(e,t,r){"use strict";function n(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var o,i=(0,r(575085).Z)("head-meta-tags-feature-config",(o=function(){return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(e){switch(e.label){case 0:return[4,r.e(85689).then(r.bind(r,85689))];case 1:return[2,e.sent()]}})},function(){var e=this,t=arguments;return new Promise(function(r,i){var l=o.apply(e,t);function a(e){n(l,r,i,a,u,"next",e)}function u(e){n(l,r,i,a,u,"throw",e)}a(void 0)})}));t.Z=i},76683:function(e,t,r){"use strict";r.d(t,{xp:function(){return s}});var n=r(741541),o=r(46864),i=r(608139);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}var a=["/gift/redeem","/settings","/account-settings","/forgotpassword","/logout","/accessibility","/cancellation","/error/404","/factorform/my-deliveries","/factorform/checkout","/factorform/checkout-success","/factorform/faq","/factorform/login","/factorform/signup","/factorform/privacy-policy","/factorform/accessibility","/factorform/contact","/factorform/settings/subscription"],u=["/recipes","/factorform","/recipe-developers","/creators"],c=["/recipes/search"],s=function(e,t){var r,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(a.some(function(t){return e.includes(t)}))return"noindex,nofollow";var d=(function(e){if(Array.isArray(e))return e}(r=e.split("?"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(r,2)||function(e,t){if(e){if("string"==typeof e)return l(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 l(e,2)}}(r,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],f=(0,i.parse)(void 0===d?"":d),p=Object.keys(f).filter(function(e){return"locale"!==e}).length>0||Array.isArray(f.locale),y=(0,o.G)()[t],h=f.locale&&"string"==typeof f.locale&&!(0,n.AM)(f.locale,y),v=c.some(function(t){return e.includes(t)}),m=u.some(function(t){return e.includes(t)});return("/"===e||e.includes("/?locale=")||m)&&!(v||s&&(p||h))?"index,follow":"noindex,follow"}},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"}},973151:function(e,t,r){"use strict";r.d(t,{Hm:function(){return c},KT:function(){return f},XV:function(){return o},eJ:function(){return i},gW:function(){return l},hY:function(){return d},lQ:function(){return u},ob:function(){return n},qB:function(){return s},qb:function(){return a}});var n="number",o="cvv",i="expirationDate",l="card-number",a="card-cvv",u="card-expiration-date",c="adyen-credit-card",s="processout-credit-card",d={ADYEN:"Adyen",BRAINTREE:"Braintree",PROCESSOUT:"ProcessOut"}
1,f={paypal:"Braintree_Paypal",venmo:"Braintree_Venmo",Adyen_Bancontact:"Adyen_Bancontact",Braintree_CreditCard:"Braintree_CreditCard",Adyen_CreditCard:"Adyen_CreditCard",applePay:"Braintree_ApplePay",sepa:"Adyen_Sepa",Adyen_iDeal:"Adyen_IDeal",ratepay:"Adyen_RatePay",Adyen_Klarna:"Adyen_Klarna",Adyen_Directebanking:"Adyen_Directebanking",Adyen_BcmcMobile:"Adyen_BcmcMobile",Adyen_Twint:"Adyen_Twint",ProcessOut_CreditCard:"ProcessOut_CreditCard",ProcessOut_ApplePay:"ProcessOut_ApplePay",ProcessOut_Vipps:"ProcessOut_Vipps",ProcessOut_MobilePay:"ProcessOut_Mobilepay"}},776115:function(e,t,r){"use strict";function n(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}r.d(t,{M7:function(){return u},Ro:function(){return a},wH:function(){return l}});var o,i=(0,r(575085).Z)("registration-steps-feature-config",(o=function(){return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(e){switch(e.label){case 0:return[4,r.e(45307).then(r.bind(r,45307))];case 1:return[2,e.sent()]}})},function(){var e=this,t=arguments;return new Promise(function(r,i){var l=o.apply(e,t);function a(e){n(l,r,i,a,u,"next",e)}function u(e){n(l,r,i,a,u,"throw",e)}a(void 0)})})),l=i.ProjectConfigProvider,a=i.configMiddleware,u=i.useConfig},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}}},208924:function(e,t,r){"use strict";r.d(t,{k:function(){return u}});var n,o,i=r(346629),l=r(128143);function a(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var u=(n=function(){return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(e){return(0,i.Vf)(),(0,l.VT)(),[2,(0,i.v0)()]})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){a(i,r,o,l,u,"next",e)}function u(e){a(i,r,o,l,u,"throw",e)}l(void 0)})},function(){return o.apply(this,arguments)})},238044:function(e,t,r){"use strict";r.d(t,{_:function(){return p},p:function(){return y}});var n=r(792229);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(e){return"number"==typeof e&&Number.isFinite(e)},l=function(e,t,r){i(r)&&(e[t]=r)},a=function(e,t,r){"string"==typeof r&&r.length>0&&(e[t]=r)},u=function(e,t,r){"boolean"==typeof r&&(e[t]=r)},c=function(e,t,r){i(r)?e[t]=r:"string"==typeof r&&r.length>0&&(e[t]=r)},s=function(e,t,r){l(e,"".concat(r,"_total"),t.total),l(e,"".concat(r,"_subtotal"),t.subtotal),l(e,"".concat(r,"_shipping"),t.shipping),l(e,"".concat(r,"_discount"),t.discount)},d=function(e,t){if(i(e)&&i(t))return Math.abs(e-t)>=.01},f=function(e){return"".concat(n.$3,".").concat(e)},p=function(e){var t,r=(o(t={},f("variant"),e.variant),o(t,f("trace_version"),n.y4),t);return a(r,f("variant_cookie"),e.variantCookie),a(r,f("brand"),e.brand),a(r,f("country"),e.country),a(r,f("market_code"),e.marketCode),a(r,f("locale"),e.locale),a(r,f("currency"),e.currency),s(r,e.ui,f("ui")),s(r,e.calculated,f("calculated")),s(r,e.payload,f("payload")),l(r,f("calculated_age_ms"),e.calculatedAgeMs),l(r,f("calculated_await_ms"),e.calculatedAwaitMs),a(r,f("calculated_await_status"),e.calculatedAwaitStatus),a(r,f("checkout_type"),e.checkoutType),u(r,f("hf_public_id_suffix_set"),e.hfPublicIdSuffixSet),a(r,f("voucher_code"),e.voucher.code),a(r,f("voucher_calculated_code"),e.voucher.calculatedCode),a(r,f("voucher_payload_code"),e.voucher.payloadCode),u(r,f("voucher_applied"),e.voucher.applied),u(r,f("voucher_valid"),e.voucher.valid),a(r,f("voucher_error"),e.voucher.error),a(r,f("voucher_validated_by"),e.voucher.validatedBy),u(r,f("voucher_manually_removed"),e.voucher.manuallyRemoved),u(r,f("voucher_journey_lost"),e.voucher.journeyLost),a(r,f("voucher_journey_lost_reason"),e.voucher.journeyLostReason),a(r,"funnel.journey_id",e.journeyId),a(r,f("cart_id"),e.cartId),c(r,f("subscription_id"),e.subscriptionId),a(r,f("plans_config_id"),e.plansConfigId),a(r,f("email_hash"),e.emailHash),u(r,f("app_webview"),e.appWebview
1),a(r,f("app_webview_device"),e.appWebviewDevice),r},y=function(e,t){var r=o({},f("ops_status"),t.status);s(r,t.response,f("ops_response")),c(r,f("ops_order_id"),t.orderId),a(r,f("ops_error_code"),t.errorCode),a(r,f("ops_error_message"),t.errorMessage),l(r,f("ops_error_http_status"),t.errorHttpStatus);var n=d(e.ui.total,e.calculated.total),p=d(e.ui.total,t.response.total),y=d(e.calculated.total,t.response.total),h=d(e.ui.discount,t.response.discount);u(r,f("total_mismatch_ui_vs_calculated"),n),u(r,f("total_mismatch_ui_vs_ops"),p),u(r,f("total_mismatch_calculated_vs_ops"),y),u(r,f("discount_mismatch"),h);var v=i(e.calculated.subtotal)&&i(e.calculated.shipping)?e.calculated.subtotal+e.calculated.shipping:null;l(r,f("calculated_full_price"),v),null!==v&&i(t.response.total)&&i(e.calculated.discount)&&e.calculated.discount>.01&&(r[f("full_price_charged")]=.01>Math.abs(t.response.total-v));var m=!0===n||!0===p||!0===y||!0===h;return r.error=m||"error"===t.status,r}},792229:function(e,t,r){"use strict";r.d(t,{$3:function(){return o},Zz:function(){return n},y4:function(){return i}});var n="checkout.place-order-price-audit",o="checkout.summary",i=3},230379:function(e,t,r){"use strict";function n(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).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,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(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 l=e.apply(t,r);function a(e){n(l,o,i,a,u,"next",e)}function u(e){n(l,o,i,a,u,"throw",e)}a(void 0)})}).apply(this,arguments)}r.d(t,{k:function(){return o}})},973524:function(e,t,r){"use strict";var n=r(262978);t.Z=function(e){var t,r=e.voucherCode,o=(0,n.Z)({voucherCode:null!=r?r:""}),i=o.isFreeAddonVoucher,l=o.freeAddonVoucherDetails;if(!i)return{lifetimeVoucherInfo:{isEligible:!1},multiWeekVoucherInfo:{isEligible:!1,numberOfWeeks:0}};var a=!!i&&!!(null==l?void 0:l.isLifetime),u=i&&!a&&!!(null==l?void 0:l.numOfFreeWeeks);return{lifetimeVoucherInfo:{isEligible:!u&&a},multiWeekVoucherInfo:{isEligible:u,numberOfWeeks:null!==(t=null==l?void 0:l.numOfFreeWeeks)&&void 0!==t?t:0}}}},46864:function(e,t,r){"use strict";r.d(t,{G:function(){return l}});var n=r(26730),o=r(839444);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l=function(){var e;return i(e={},n.Z.AO,[{locale:o.Z.enAU,name:"English",default:!0}]),i(e,n.Z.AT,[{locale:o.Z.deAT,name:"Deutsch",default:!0}]),i(e,n.Z.AU,[{locale:o.Z.enAU,name:"English",default:!0}]),i(e,n.Z.BE,[{locale:o.Z.nlBE,name:"Nederlands",default:!0},{locale:o.Z.frBE,name:"Fran\xe7ais",default:!1}]),i(e,n.Z.CA,[{locale:o.Z.enCA,name:"English",default:!0},{locale:o.Z.frCA,name:"Fran\xe7ais",default:!1}]),i(e,n.Z.CF,[{locale:o.Z.enCA,name:"English",default:!0},{locale:o.Z.frCA,name:"Fran\xe7ais",default:!1}]),i(e,n.Z.CG,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.CH,[{locale:o.Z.deCH,name:"Deutsch",default:!0}]),i(e,n.Z.CK,[{locale:o.Z.enCA,name:"English",default:!0},{locale:o.Z.frCA,name:"Fran\xe7ais",default:!1}]),i(e,n.Z.DE,[{locale:o.Z.deDE,name:"Deutsch",default:!0}
1]),i(e,n.Z.DK,[{locale:o.Z.daDK,name:"Danish",default:!0}]),i(e,n.Z.ER,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.ES,[{locale:o.Z.esES,name:"Spanish",default:!0}]),i(e,n.Z.FJ,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.FR,[{locale:o.Z.frFR,name:"Fran\xe7ais",default:!0}]),i(e,n.Z.GB,[{locale:o.Z.enGB,name:"English",default:!0}]),i(e,n.Z.GN,[{locale:o.Z.enGB,name:"English",default:!0}]),i(e,n.Z.GQ,[{locale:o.Z.nlNL,name:"Nederlands",default:!0}]),i(e,n.Z.IE,[{locale:o.Z.enIE,name:"English",default:!0}]),i(e,n.Z.IT,[{locale:o.Z.itIT,name:"Italian",default:!0}]),i(e,n.Z.JP,[{locale:o.Z.jaJP,name:"Japanese",default:!0}]),i(e,n.Z.KN,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.LU,[{locale:o.Z.frLU,name:"Luxembourg",default:!0}]),i(e,n.Z.MR,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.NL,[{locale:o.Z.nlNL,name:"Nederlands",default:!0},{locale:o.Z.enNL,name:"English",default:!1}]),i(e,n.Z.NO,[{locale:o.Z.nbNO,name:"Norwegian Bokmal",default:!0}]),i(e,n.Z.NZ,[{locale:o.Z.enNZ,name:"English",default:!0}]),i(e,n.Z.SE,[{locale:o.Z.svSE,name:"Svenska",default:!0}]),i(e,n.Z.US,[{locale:o.Z.enUS,name:"English",default:!0}]),i(e,n.Z.YE,[{locale:o.Z.enAU,name:"English",default:!0}]),i(e,n.Z.TK,[{locale:o.Z.daDK,name:"Dansk",default:!0},{locale:o.Z.enDK,name:"English",default:!1}]),i(e,n.Z.TO,[{locale:o.Z.nlBE,name:"Nederlands",default:!0},{locale:o.Z.frBE,name:"Fran\xe7ais",default:!1},{locale:o.Z.enBE,name:"English",default:!1}]),i(e,n.Z.TT,[{locale:o.Z.nlNL,name:"Nederlands",default:!0},{locale:o.Z.enNL,name:"English",default:!1}]),i(e,n.Z.TV,[{locale:o.Z.svSE,name:"Svenska",default:!0},{locale:o.Z.enSE,name:"English",default:!1}]),i(e,n.Z.TZ,[{locale:o.Z.deDE,name:"Deutsch",default:!0},{locale:o.Z.enDE,name:"English",default:!1}]),e}},894326:function(e,t,r){"use strict";r.d(t,{h:function(){return i}});var n=r(200770),o=r(46864),i=function(){var e=(0,n.Z)();return(0,o.G)()[e]}},741541:function(e,t,r){"use strict";r.d(t,{AM:function(){return o},JM:function(){return i},ki:function(){return n}});var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find(function(e){return e.default})||e[0]},o=function(e,t){return!!t.find(function(t){return t.locale===e})},i=function(e){var t=e.baseUrl,r=e.availableLocales,n=e.query,i=null==n?void 0:n.locale;return i&&o(i,r)?"".concat(t,"?locale=").concat(i):t}},870199:function(e,t,r){"use strict";r.d(t,{f:function(){return v},Z:function(){return m}});var n,o=r(687800),i=r(827378),l=r(761403),a=r(189452),u=r(165218),c=r.n(u),s=r(169821),d=r(158256);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=(f(n={},d.nK.bounceModal,function(){return Promise.all([r.e(12737),r.e(78526),r.e(30816),r.e(20264),r.e(20828),r.e(52291)]).then(r.bind(r,594803))}),f(n,d.nK.genericModal,function(){return r.e(10783).then(r.bind(r,110783))}),f(n,d.nK.communityDiscountModal,function(){return Promise.all([r.e(47057),r.e(5441),r.e(61785)]).then(r.bind(r,561785))}),f(n,d.nK.communityPerksModal,function(){return Promise.all([r.e(47057),r.e(38579),r.e(12737),r.e(78526),r.e(30816),r.e(20264),r.e(20828),r.e(99184),r.e(5441),r.e(15263)]).then(r.bind(r,151949))}),f(n,d.nK.subscriptionSettingsModal,function(){return Promise.all([r.e(12737),r.e(78526),r.e(30816),r.e(20264),r.e(20828),r.e(28004),r.e(7965),r.e(33040)]).then(r.bind(r,508402))}),f(n,d.nK.paymentMethodModal,function(){return Promise.all([r.e(38579),r.e(12737),r.e(78526),r.e(30816),r.e(20264),r.e(20828),r.e(90730),r.e(56370)]).then(r.bind(r,169881))}),f(n,d.nK.deliveryAddressModal,function(){return Promise.all([r.e(47057),r.e(14206),r.e(9432),r.e(37384),r.e(63581),r.e(50182)]).then(r.bind(r,859149))}),f(n,d.nK.mealSelectionCompletionModal,function(){return Promise.all([r.e(47057),r.e(38579),r.e(17827),r.e(52463),r.e(34330),r.e(16709),r.e(15540),r.e(10681)]).then(r.bind(r,519003))}),f(n,d.nK.snapDialogPaidOrderModal,function(){return Promise.all([r.e(38579),r.e(87365)]).then(r.bind(r,687365))}),f(n,d.nK.xsellOrderSuccessModal,function(){return Promise.all([r.e(47057),r.e(35730)]).then(r.bind(r,435730))}),f(n,d.nK.standaloneHighRiskModal,function(){return r.e(49506).then(r.bind(r,649506))}),f(n,d.nK.loyaltyOptInModal,function(){return Promise.all([r.e(38579),r.e(2715),r.e(83394),r.e(87918),r.e(96715),r.e(47953),r.e(48248),r.e(81298)]).then(r.bind(r,185395))}),f(n,d.nK.loyaltyMissionIntroModal,function(){return Promise.all([r.e(47057),r.e(38579),r.e(73020),r.e(97077),r.e(59546)]).then(r.bind(r,59546))}),f(n,d.nK.loyaltyOnboardingModal,function(){return Promise.all([r.e(38579),r.e(26116),r.e(18451)]).then(r.bind(r,718451))}),f(n,d.nK.doubleProteinOnboardingModal,function(){return r.e(56828).then(r.bind(r,256828))}),f(n,d.nK.referralNudgeModal,function(){return Promise.all([r.e(38579),r.e(3657)]).then(r.bind(r,903657))}),n),y=function(e){var t=e.modalKey,r=e.isActive,n=c()(p[t]);return r?(0,o.tZ)(s.Z,{suspense:!0,children:(0,o.tZ)(n,{},t)}):null};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}"test"!==(0,a.Z)().NODE_ENV&&(0,l.setAppElement)("#__next");var v=(0,i.createContext)({activeModal:null,setActiveModal:function(){},closeModal:function(){}}),m=function(e){var t,r=e.registerModals,n=e.initialModal,l=e.children,a=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null!=n?n:null))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return h(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 h(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.")}(),u=a[0],c=a[1];return(0,o.BX)(v.Provider,{value:{activeModal:u,setActiveModal:c,closeModal:function(e){c(function(t){return t===e?null:t})}},children:[l,r.map(function(e){return(0,o.tZ)(y,{modalKey:e,isActive:u===e},"".concat(e,"+").concat(Date.now()))})]})}},158256:function(e,t,r){"use strict";var n,o;r.d(t,{nK:function(){return n}}),(o=n||(n={})).bounceModal="bounce-modal",o.genericModal="generic-modal",o.communityDiscountModal="community-discount-modal",o.communityPerksModal="community-perks-modal",o.subscriptionSettingsModal="subscription-settings-modal",o.paymentMethodModal="payment-method-modal",o.deliveryAddressModal="delivery-address-modal",o.mealSelectionCompletionModal="meal-selection-completion-modal",o.snapDialogPaidOrderModal="snap-dialog-paid-order-modal",o.xsellOrderSuccessModal="xsell-order-success-modal",o.standaloneHighRiskModal="standalone-high-risk-modal",o.loyaltyOptInModal="loyalty-opt-in-modal",o.loyaltyMissionIntroModal="loyalty-mission-intro-modal",o.loyaltyOnboardingModal="loyalty-onboarding-modal",o.doubleProteinOnboardingModal="double-protein-onboarding-modal",o.referralNudgeModal="referral-nudge-modal"},764291:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(929651),o=r(233477),i=r(966622),l=r(64294),a=r(913940);function u(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 c=function(e,t,r,n,o,i,l,c,s,d,f,p){var y,h=t.decide,v=t.isReady;if(null===(y=n.experiment)||void 0===y?void 0:y.experimentKey){var m=o.mainProductSelectionPages.some(function(t){return e.asPath.startsWith(t)});if(null==l||l.setAttributes({isMainProductSelectionPage:m}),m&&v){var b,g,O,w=(function(e){if(Array.isArray(e))return e}(b=e.asPath.split("?"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),1!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(b,1)||function(e,t){if(e){if("string"==typeof e)return u(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 u(e,1)}}(b,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],S={experimentKey:n.experiment.experimentKey,experimentationUserId:i,experimentationUserAttributes:(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}({},r),O=O={public_id:i,utm_source:e.query.utm_source||"",allocation_pathname:w,is_freebie_or_helloshare:d,is_active_customer:f},Object.getOwnPropertyDescriptors?Object.defineProperties(g,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(g,e,Object.getOwnPropertyDescriptor(O,e))}),g)},k=(s?h(S):h(a.mj.ABTEST,S)).variationKey;null==l||l.setAttributes({allocatedVariation:k||"__null__"});var x=!!k&&!!n[k];if(c&&x&&(null==n?void 0:n.amazon))return null==n?void 0:n.amazon[k];if(x)return n[k];null==l||l.setAttributes({allocatedWithoutPlansConfigData:!x})}if(!m&&p)return n[p]}}
1,s=r(497249),d=r(581340),f=r(827378),p=r(567921),y=r.n(p),h=r(174150),v=r(200770),m=r(26730),b=function(e,t){var r=(0,v.Z)(),n=(0,d.t)(),o=n.asPath,i=n.query,l="1"===y().get("hf_ssr_e_gift_card_checkout"),a=r===m.Z.US,u=r===m.Z.FR,c=r===m.Z.ES,s=(a||u||c)&&("1"===y().get("hf_ssr_e_plans_config_is_freebie")||o.startsWith("/pages/raf_lp11")),f=null==o?void 0:o.startsWith("/pages/value-messaging-raf"),p=(null==i?void 0:i.utm_source)==="raf-freebie"||(null==i?void 0:i.utm_source)==="raf-share"||(null==i?void 0:i.utm_source)==="freebies"||(null==i?void 0:i.utm_source)==="Offline_Freebies"||(null==i?void 0:i.utm_campaign)==="freebieofflineprintinglink",b=(u||c)&&(f||p);null==e||e.setAttributes({isGiftCard:l,isFreebie:s||b});var g=(0,h.f)({giftCard:l,isFreebie:s||b,include:"plans,preferences"},{suspense:!1,enabled:t});return{isFreebie:s,isGiftCard:l,useQueryResult:g}},g={freebie:"freebie",share:"share",rafShareHpt:"raf-share-hpt",rafShare:"raf-share",b2b:"b2b",directSalesExclusion:"direct_sales_exclusion"},O="wl_is_freebie_or_hello_share",w=r(527157),S=r(543790),k=function(){var e=(0,f.useMemo)(function(){return y().get(O)},[]);if(!((0,w.Z)()!==S.Z.hellofresh))return!1;if(e)return!0;var t=new URLSearchParams(window.location.search),r=t.get("utm_source"),n=t.get("dm"),o=Object.values(g).includes(String(r))||"free-box"===n;return o&&!e&&y().set(O,"true"),o},x=r(743267),P=r(24165);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}function C(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 Z=function(e){var t,r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=(0,o.F)(),u=(0,l.ZP)(),p=(0,s.T)(),y=(0,n.S9)(),h=y.useStatsig,v=(0,i.py)({runUsingStatsig:h}),m=(0,d.t)(),g=(0,f.useRef)(!1),O=(0,f.useRef)(p.startSpan("plans-config-vanilla-allocation").setAttributes({publicId:u})),w=function(e){var t;null===(t=O.current)||void 0===t||t.setAttributes(e).end(),O.current=null},S="",Z="";(0,f.useEffect)(function(){S&&Z&&w({outcome:S,"product-family":Z})},[S,Z,u]);var j=k(),D=(0,x.fB)((0,P.Z)()),I=b(O.current,r&&y.useV2),E=I.isGiftCard,_=I.useQueryResult,T=_.data;if(!y.useV2)return C(A({},_),{data:void 0});if(!T||!1===_.isFetched||(null==T?void 0:null===(t=T.experiment)||void 0===t?void 0:t.experimentKey)&&!v.isReady)return C(A({},_),{isSuccess:!1,isFetched:!1,isFetching:!0,data:void 0});var M=T.control;if(E)return v.track({eventName:"plans-config-gift-product",experimentationUserAttributes:a,experimentationUserId:u,eventTags:{familyName:T.control.config.familyName,pagePath:m.asPath}}),S="gift-card-checkout",Z=M.config.familyName,C(A({},_),{data:M});var R=c(m,v,a,T,y.vanillaExperiment,u,O.current,!1,h,j,D,e);if(R)return S="allocated",Z=R.config.familyName,C(A({},_),{data:R});var N=y.vanillaExperiment.mainProductSelectionPages.some(function(e){return m.asPath.startsWith(e)});return!g.current&&N&&(v.track({eventName:"plans-config-BAU-product",experimentationUserAttributes:a,experimentationUserId:u,eventTags:{familyName:T.control.config.familyName,pagePath:m.asPath}}),S="BAU-fallback",Z=T.control.config.familyName,g.current=!0),C(A({},_),{data:M})}},759623:function(e,t,r){"use strict";r.d(t,{Oq:function(){return u}});var n=r(827378),o=r(241636),i=r(230379),l=r(52130);function a(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var u=function(){var e=(0,l.L3)().trackJanusEvent;return{trackLoginButtonClick:(0,n.useCallback)(function(t){var r,n;(r=function(){var r,n,l,a,u,c;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=t.loginMethod===o.pL.Email?o.uC.Email:o.uC.Social,[4,(0,i.k)((null!==(n=t.email)&&void 0!==n?n:"").toLowerCase().trim())];case 1:return l=s.sent(),a=o._M.contact({contactType:r,hashedDetails:l}),u=o._M.login({loginMethod:t.loginMethod,loginType:t.loginType}),c=o._M.uiComponent({uiComponentName:t.uiComponentName,uiComponentLabel:t.uiComponentLabel}),e(o._M.janusEvent({contact:a,login:u,uiComponentEntities:[c]})),[3,3];case 2:return s.sent(),[3,3];case 3:return[2]}})},n=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function l(e){a(i,n,o,l,u,"next",e)}function u(e){a(i,n,o,l,u,"throw",e)}l(void 0)})},function(){return n.apply(this,arguments)})()},[e])}}},711031:function(e,t,r){"use strict";r.d(t,{M:function(){return l}});var n=r(827378),o=r(36584),i=r(52130),l=function(){var e=(0,i.L3)().trackJanusEvent;return{trackSnowplowLoginError:(0,n.useCallback)(function(t){try{var r=o.Q.event({systemMessage:t});e(o.Q.janusEvent({event:r}))}catch(e){}},[e])}}},859516:function(e,t,r){"use strict";r.d(t,{v:function(){return a}});var n=r(827378),o=r(60074),i=r(659568),l=r(52130),a=function(){var e=(0,l.L3)().trackJanusEvent;return{trackRegistrationLoginSuccess:(0,n.useCallback)(function(t){try{var r,n=i.CN.event({systemMessage:null!==(r=t.systemMessage)&&void 0!==r?r:"successfulLogin"}),l=i.CN.login({loginMethod:t.loginMethod,loginType:t.loginType});e(i.CN.janusEvent({event:n,login:l}))}catch(e){(0,o.Tb)(e,{tags:{event:"Registration_LoginSuccess_SystemAction",component:"useRegistrationLoginSuccessSnowplowEvent"}})}},[e])}}},304638:function(e,t,r){"use strict";r.d(t,{Y:function(){return o}});var n=r(723073),o=function(e){e.interceptors.request.use(function(e){return e.headers=(0,n.s)((0,n.Z)(),e.headers),e})}},496329:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(581340),o=r(827378),i=r(953137),l=r(43011),a=r(718583),u=r(748966),c=function(e){var t,r=null==e?void 0:null===(t=e.split("?"))||void 0===t?void 0:t[1];if(!r)return{};try{var n=decodeURIComponent(r);return(0,u.parse)(n)}catch(e){return{}}},s=function(e){var t,r,u=(0,l.Z)(),s=(0,n.t)(),d=s.query,f=c(s.asPath),p=(0,o.useMemo)(function(){var e,t=a.ZP.getItem("hf_subscription_id");try{return t&&(null===(e=JSON.parse(t))||void 0===e?void 0:e.value)}catch(e){}},[]),y=(null==d?void 0:d.subscriptionId)||(null==f?void 0:f.subscriptionId)||p,h=(0,i.u)({},{suspense:!1,enabled:!!u}).data,v=null==h?void 0:h.items;if(!v)return!1;var m=void 0;y&&(m=v.find(function(e){return e.id===y})),m||(m=v.find(function(e){return!e.canceledAt})||v[0]);var b=!!(null==m?void 0:m.canceledAt);return e&&(b=(null===(r=m.productType)||void 0===r?void 0:null===(t=r.specs)||void 0===t?void 0:t.recurrency)===0&&!!(null==m?void 0:m.canceledAt)),b}},700166:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return oa},default:function(){return ou}});var n=r(687800),o=r(827378),i=r(231140),l=r(184883),a=r(333758),u=r(481989),c=r(31748),s=r(647220),d=r(164528),f=r(431394),p=r(90295),y=r(877520),h="goodc
1hop-error-notification",v=function(){return{showError:(0,o.useCallback)(function(e,t){var r,n;(0,p.wN)(y.ZP.create(e,h,(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}))),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}({type:y.k$.error,overrideId:h},(null==t?void 0:t.duration)&&{delayedDismiss:!0,delayedDismissDuration:t.duration}),n=n={meta:{isGoodChopError:!0,message:e}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r)))},[]),clearError:(0,o.useCallback)(function(){(0,p.iX)(function(e){return e.id===h})},[])}},m=(0,r(66077).Z)("good-chop-checkout-variant",{variant:"all-on-one"}).useConfig,b={navigationMode:"cursor",steps:[{id:"signup",route:"/checkout"},{id:"address",route:"/checkout"},{id:"delivery",route:"/checkout"},{id:"payment",route:"/checkout"}]},g={"all-on-one":b,"grouped-query-param":{navigationMode:"query-param",steps:[{id:"address",route:"/checkout",queryParam:"address"},{id:"delivery",route:"/checkout",queryParam:"address"},{id:"payment",route:"/checkout",queryParam:"payment"}]}},O=function(e){var t;return null!==(t=g[e])&&void 0!==t?t:b},w=r(768587),S=r(235487),k=r(268481),x=function(){var e=(0,S.D)(),t=e.isMobile,r=e.isTablet,n=(0,k.Sj)(),o=t||"mobile"===n,i=r||"tablet"===n;return{isMobile:o,isTablet:i,isDesktop:!o&&!i}},P=function(e){var t=e.height;return(0,n.tZ)(w.xu,{height:t,width:"100%",backgroundColor:"global.gray.300"})},A=function(){return(0,n.BX)(n.HY,{children:[(0,n.BX)(w.xu,{display:["flex","flex","none"],flexDirection:"column",gap:"global.md-1",children:[(0,n.tZ)(P,{height:"48px"}),(0,n.tZ)(P,{height:"732px"})]}),(0,n.BX)(w.xu,{display:["none","none","grid"],gridTemplateColumns:"1.5fr 1fr",gap:"global.md-2",children:[(0,n.tZ)(P,{height:"724px"}),(0,n.tZ)(P,{height:"432px"})]})]})},C=function(e){var t=e.children;return(0,n.tZ)(w.xu,{backgroundColor:"global.brown.100",minHeight:"100vh",px:["global.none","global.md-2","global.xxl"],py:["global.sm-2","global.md-2","global.md-2"],children:(0,n.tZ)(w.xu,{maxWidth:["100%","100%",1200],mx:"auto",children:t})})},Z=function(e){var t=e.steps,r=e.orderSummary,o=e.isLoading,i=x().isDesktop;return(0,n.tZ)(C,{children:o?(0,n.tZ)(A,{}):(0,n.BX)(w.xu,{display:"grid",gridTemplateColumns:i?"1.5fr 1fr":"1fr",gap:"global.md-2",mx:"auto",children:[(0,n.tZ)(w.xu,{order:i?1:2,children:t}),(0,n.tZ)(w.xu,{order:i?2:1,position:i?"sticky":"static",top:"0",alignSelf:"start",children:r})]})})},j=r(37017),D=r(859737),I=r(194924),E=r(529553),_={address:{firstName:"",lastName:"",address1:"",address2:"",city:"",postcode:"",region:"",phone:""},billing:null,shippingId:null,billingId:null,isSubmitted:!1},T="hf_goc_checkout_signup",M="hf_goc_checkout_address",R=(0,I.O4)(T,null),N=(0,I.O4)(M,_),L={deliveryTime:"",firstDelivery:"",firstDeliveryDay:0,cutoffDate:null,deliveryInstruction:"",deliveryInstructionCustom:null,isSubmitted:!1},B=(0,I.O4)("hf_goc_checkout_delivery",L,{getItem:function(e){var t=E.o.getItem(e);if(null===t)return D.o5;try{return JSON.parse(t)}catch(e){return D.o5}},setItem:function(e,t){E.o.setItem(e,JSON.stringify(t))},removeItem:function(e){E.o.removeItem(e)},subscribe:function(e,t){return function(){}}}),U=(0,j.cn)(!1),F=(0,j.cn)(void 0),V=r(64294),X=r(225925),K='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',q=function(e,t,r){(0,o.useEffect)(function(){if(t){if(null==r?void 0:r.current){r.current.scrollIntoView({block:"center"});return}if(e.current){var n=Array.from(e.current.querySelectorAll(K)).find(function(e){return null!==e.offsetParent});n&&n.focus()}}},[e,t,r])},W=function(e,t){(0,o.useEffect)(function(){if(e.current){var r=Array.from(e.current.querySelectorAll(K));t?r.forEach(function(e){return e.setAttribute("tabindex","-1")}):r.forEach(function(e){return e.removeAttribute("tabindex")})}},[e,t])},G=function(e){var t=e.title,r=e.isActive,i=e.isComplete,l=e.isLocked,a=e.summary,u=e.children,c=e.sectionId,s=e.shouldFocusSection,d=(0,o.useRef)(null),f=(0,o.useRef)(null);return q(f,r,s?d:void 0),W(f,l),(0,n.BX)(w.xu,{"aria-disabled":l?"true":void 0,"data-section-id":c,op
1acity:l?.5:void 0,pointerEvents:l?"none":void 0,ref:d,children:[(0,n.tZ)(w.xu,{marginBottom:"global.sm-1",children:(0,n.tZ)(w.xv,{type:"body-xl-bold",children:t})}),(0,n.tZ)(w.xu,{ref:f,children:i&&!r&&void 0!==a?a:u})]})},H=r(208924),Y=r(887824),z=r(966622),J=r(943701),$=r(407792);function Q(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 ee="goodchop",et="new-ventures",er="/good-chop/checkout",en=function(){var e=(0,Y.Z)().push,t=(0,z.py)({runUsingStatsig:!0}).track,r=(0,J.R)({runUsingStatsig:!0}),n=r.id,i=r.attributes,l=(0,$.O)(),a=l.id,u=l.attributes,c=(0,o.useCallback)(function(e,r){n&&t({eventName:e,experimentationUserId:n,experimentationUserAttributes:i,eventTags:Q({brand:ee,tribe:et,screen:er},r)})},[t,n,i]),s=(0,o.useCallback)(function(e,r){t({eventName:e,experimentationUserId:a,experimentationUserAttributes:u,eventTags:Q({brand:ee,tribe:et,screen:er},r)})},[t,a,u]);return{trackSignupSuccess:(0,o.useCallback)(function(){s("Goodchop_Checkout_Signup_Success",{gaEventCategory:"funnel",gaEventAction:"signup_success",gaEventLabel:"checkout"})},[s]),trackLoginSuccess:(0,o.useCallback)(function(){s("Goodchop_Checkout_Login_Success",{gaEventCategory:"funnel",gaEventAction:"login_success",gaEventLabel:"checkout"})},[s]),trackAuthError:(0,o.useCallback)(function(e,t){s("Goodchop_Checkout_Auth_Error",Q({gaEventCategory:"funnel",gaEventAction:"auth_error",gaEventLabel:"checkout",isRegistration:String(e)},t?{errorMessage:t}:{}))},[s]),trackAddressContinue:(0,o.useCallback)(function(){e({event:"gaEventTrigger",event_name:"add_shipping_info",gaEventCategory:"funnel",gaEventAction:"add_shipping_info",gaEventLabel:"checkout"}),c("add_shipping_info",{gaEventCategory:"funnel",gaEventAction:"add_shipping_info",gaEventLabel:"checkout"})},[e,c]),trackDeliveryContinue:(0,o.useCallback)(function(){e({event:"gaEventTrigger",event_name:"Checkout_DeliveryDatePageContinue",gaEventCategory:"deliveryInstructionsFunnel",gaEventAction:"continueFromDeliveryDetails",gaEventLabel:"clicked"}),c("Checkout_DeliveryDatePageContinue",{gaEventCategory:"deliveryInstructionsFunnel",gaEventAction:"continueFromDeliveryDetails",gaEventLabel:"clicked"})},[e,c]),trackPaymentContinue:(0,o.useCallback)(function(){e({event:"gaEventTrigger",event_name:"add_payment_info",gaEventCategory:"funnel",gaEventAction:"add_payment_info",gaEventLabel:"checkout"}),c("add_payment_info",{gaEventCategory:"funnel",gaEventAction:"add_payment_info",gaEventLabel:"checkout"})},[e,c]),trackSummaryEdit:(0,o.useCallback)(function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";e({event:"gaEventTrigger",event_name:"Checkout_SummaryEdit",gaEventCategory:"SummaryEdit",gaEventAction:t,gaEventLabel:r}),c("Checkout_SummaryEdit",{gaEventCategory:"SummaryEdit",gaEventAction:t,gaEventLabel:r})},[e,c])}};function eo(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var ei=function(){var e,t,r=(0,j.b9)(U),n=en().trackSummaryEdit;return{handleChangeEmail:(e=function(){return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(e){switch(e.label){case 0:return n("email"),r(!0),[4,(0,H.k)()];case 1:return e.sent(),[2]}})},t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function l(e){eo(i,n,o,l,a,"next",e)}function a(e){eo(i,n,o,l,a,"throw",e)}l(void 0)})},function(){return t.apply(this,arguments)})}},el=function(){var e=(0,j.Dv)(R),t=(0,d.ZP)("good-chop-checkout").translateRaw,r=ei().handleChangeEmail;return(0,n.BX)(w.xu,{display:"flex",alignItems:"flex-start",children:[(0,n.tZ)(w.xu,{flex:1,children:(0,n.tZ)(w.xv,{type:"body-md-regular",color:"global.gray.600",children:null==e?void 0:e.email})}),(0,n.tZ)(w.xu,{as:"button",onClick:r,"aria-label":t("good-chop-checkout.account.change-email"),display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",cursor:"pointer",children:(0,n.tZ)(w.xv,{textDecoration:"underline",color:"global.goodchop-navy.600",type:"body-sm-bold",children:t("good-chop-checkout.account.change-email")})})]})},ea=r(456552),eu=r(200770),ec=r(958042),es=r(907567),ed=r(681335),ef=r(520578),ep=r(699219),ey=r(497249),eh=r(344884),ev="/my-deliveries",em="/settings/plan/reactivate";function eb(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var eg=function(e){var t,r,n=(0,j.b9)(R),i=(0,ea.useQueryClient)(),l=(0,o.useRef)(""),a=(0,eu.Z)(),u=(0,ec.Z)(),c=(0,ey.T)(),s=en(),d=s.trackSignupSuccess,f=s.trackLoginSuccess,p=s.trackAuthError;return{handleEmailChange:function(e){l.current=e},handleLoginSuccess:(t=function(t){var r,o,s,y,h,v,m,b;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(g){switch(g.label){case 0:r=c.startSpan("good-chop-checkout.signup-submit",{attributes:{"checkout.isRegistration":null!=t&&t}}),g.label=1;case 1:if(g.trys.push([1,5,,6]),t)return[3,3];return o=[ep.Z["checkout.status"]],[4,(0,ed.VK)({systemCountry:a,locale:u},o)];case 2:if(s=g.sent(),"home"===(y=(0,ef.n)(s)))return window.location.replace(ev),[2];if("reactivation"===y)return window.location.replace(em),[2];g.label=3;case 3:return h=[ep.Z["customer.basicInfo"],{systemCountry:a,locale:u}],[4,(0,es.H)({systemCountry:a,locale:u},h)];case 4:if(!(v=g.sent()).id)return[2];return i.setQueryData(h,v),n({customerId:String(v.id),email:l.current}),t?d():f(),r.setStatus({code:eh.Z.OK}).end(),e(),[3,6];case 5:var O,w;return p(!!t,(O=m=g.sent(),b=(null!=(w=Error)&&"undefined"!=typeof Symbol&&w[Symbol.hasInstance]?!!w[Symbol.hasInstance](O):O instanceof w)?m.message:"")),r.setAttributes({"error.message":b}).setStatus({code:eh.Z.ERROR}).end(),[3,6];case 6:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function l(e){eb(i,n,o,l,a,"next",e)}function a(e){eb(i,n,o,l,a,"throw",e)}l(void 0)})},function(e){return r.apply(this,arguments)}),registerOptions:{onSuccess:function(){},onError:function(){}},passwordlessRegisterOptions:{onSuccess:function(){},onError:function(){}}}},eO=r(567921),ew=r.n(eO),eS=r(779977),ek=function(){try{return ew().get(eS.fZ)||""}catch(e){return""}},ex=r(857222),eP=r(137384),eA=r(711554),eC=r(193921);function eZ(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}function ej(e){var t=e.fields,r=e.customerId,n=e.isBilling,o=e.regions,i=function(e,t){if(t){var r=t.find(function(t){return t.code===e});if(r)return{code:r.code,id:Number(r.id),name:r.name}}}(t.region,o);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){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}({firstName:t.firstName||null,lastName:t.lastName||null,address1:t.address1||null,address1No:null,address1Street:null,address2:t.address2||null,address2Comment:null,address2Comment2:null,address2CommentCustom:null,city:t.city||null,postcode:t.postcode||null,phone:t.phone||null,company:null,country:"US",customerId:r,isBilling:n,isDefaultShipping:!0,isDefaultBilling:!0,billToSameAddress:!0,isOffice:!1,isBillingForced:!1},i?{region:i}:{})}var eD=r(747012),eI=r(435172),eE=r(722911),e_=function(e){var t=!!e,r=(0,eI.P)({id:e||""},{enabled:t,suspense:!1}).data;if(r&&t)return(0,eE.B)(r)},eT=function(){try{return ew().get("hf_cart_id")}catch(e){return}},eM=function(){return e_(eT())},eR=r(553911),eN=function(e){var t=e.isChecked,r=e.onChange,o=(0,d.ZP)("good-chop-checkout").translateRaw;return(0,n.BX)(w.xu,{my:"global.sm-2",display:"flex",flexDirection:"column",gap:"global.sm-1",children:[(0,n.tZ)(w.XZ,{checked:t,onChange:function(e){return r(e.currentTarget.checked)},label:o("good-chop-checkout.delivery-address.marketing-consent")}),(0,n.tZ)(w.xv,{type:"body-xs-regular",children:(0,n.tZ)(eR.Z,{copy:o("good-chop-checkout.delivery-address.marketing-consent-disclaimer"),hasMarkdown:!0})})]})},eL=r(978949),eB=function(){var e=(0,d.ZP)("good-chop-checkout").translateRaw;return(0,n.BX)(w.xu,{display:"flex",flexDirection:"row",alignItems:"center",gap:"global.sm-1",backgroundColor:"global.gray.200",px:"global.sm-2",py:"global.xs",my:"global.sm-1",children:[(0,n.tZ)(w.JO,{icon:(0,n.tZ)(eL.default,{})}),(0,n.tZ)(w.xv,{type:"body-sm-regular",children:e("good-chop-checkout.delivery-address.freshness-message")})]})},eU=function(e){var t=e.onEdit,r=(0,j.Dv)(N).address,o=(0,d.ZP)("good-chop-checkout").translateRaw,i=en().trackSummaryEdit;return(0,n.BX)(w.xu,{display:"flex",alignItems:"flex-start",children:[(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",flex:1,children:[(0,n.BX)(w.xv,{type:"body-md-regular",color:"global.gray.600",children:[r.firstName," ",r.lastName]}),(0,n.tZ)(w.xv,{type:"body-md-regular",color:"global.gray.600",children:r.phone}),(0,n.BX)(w.xv,{type:"body-md-regular",color:"global.gray.600",children:[r.address1,", ",r.city,", ",r.region," ",r.postcode]})]}),(0,n.tZ)(w.xu,{as:"button",onClick:function(){i("address"),t()},"aria-label":o("good-chop-checkout.edit-cta"),display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",cursor:"pointer",borderWidth:"global.none",children:(0,n.tZ)(w.xv,{textDecoration:"underline",color:"global.goodchop-navy.600",type:"body-sm-bold",children:o("good-chop-checkout.edit-cta")})})]})},eF=r(783244);function eV(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){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 eK(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 eq(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eV(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 eV(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 eW=function(){var e=eq((0,eF.Z)("hf_prefill_zipcode"),1)[0],t=eq((0,j.KO)(N),2)[1];(0,o.useEffect)(function(){e&&t(function(t){return t.address.postcode?t:eK(eX({},t),{address:eK(eX({},t.address),{postcode:e})})})},[e,t])};function eG(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 eH(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}function eY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ez(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){eY(e,t,r[t])})}return e}function eJ(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 e$(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eG(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 eG(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 eQ(){var e,t,r=(e=["\n  svg[aria-labelledby$='-icon'][aria-hidden='false'] {\n    display: none;\n  }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return eQ=function(){return r},r}var e0=ex.ZP.div.withConfig({componentId:"sc-fd0b6ebc-0"})(eQ()),e1=r(926742);function e2(){var e,t,r=(e=["\n  [data-test-id='delivery-summary-cancellation-notice'],\n  div:has(> [data-test-id='delivery-summary-cancellation-notice']),\n  [data-test-id='delivery-summary-disclaimer'],\n  [data-test-id='delivery-instructions-subtitle'],\n  div:has(> [data-test-id='delivery-instructions-subtitle']) {\n    display: none;\n  }\n\n  div:has([data-test-id='edit-first-delivery-summary']) {\n    margin-bottom: 0;\n  }\n\n  @media (min-width: 768px) {\n    dialog[data-test-id='delivery-summary-edit-first-delivery-modal'] {\n      margin: 0 !important;\n    }\n  }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return e2=function(){return r},r}var e7=ex.ZP.div.withConfig({componentId:"sc-71e79883-0"})(e2()),e8=function(e){var t=e.isLoading,r=e.postcode,o=e.selectedDeliveryHandle,i=e.selectedDeliveryDate,l=e.deliveryOptionsByDate,a=e.isDeliverable,u=e.dosId,c=e.defaultDeliveryDate,s=e.defaultDeliveryTime,d=e.deliveryInstructionsRef,f=e.onChooseDeliveryOption,p=e.onChooseDeliveryInstructions,y=e.onChooseCustomDeliveryInstructions;return t?(0,n.tZ)(w.xu,{display:"flex",justifyContent:"center",children:(0,n.tZ)(w.$j,{variant:"currentColor",size:"md"})}):(0,n.tZ)(e7,{children:(0,n.tZ)(e1.Z,{ref:d,postcode:r,selectedDeliveryHandle:o,selectedDeliveryDate:i,deliveryOptionsByDate:l,isDeliverable:a,dosId:u,defaultDeliveryDate:c,defaultDeliveryTime:s,chooseDeliveryOption:f,chooseDeliveryInstructions:p,chooseCustomDeliveryInstructions:y})})},e6=r(680199),e4=r.n(e6),e3=r(244502),e5=r.n(e3),e9="Other",te=function(e){var t=e.onEdit,r=(0,j.Dv)(B),o=(0,d.ZP)("good-chop-checkout").translateRaw,i=en().trackSummaryEdit;if(!r.firstDelivery)return null;var l=r.deliveryInstruction===e9?r.deliveryInstructionCustom:r.deliveryInstruction,a=e4()(e5()(r.firstDelivery),"ddd, MMMM D"),u="".concat(a," - ").concat(l);return(0,n.BX)(w.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,n.tZ)(w.xv,{type:"body-md-regular",color:"global.gray.600",children:u}),(0,n.tZ)(w.xu,{as:"button",onClick:function(){i("deliveryDate"),t()},"aria-label":o("good-chop-checkout.edit-cta"),display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",curs
1or:"pointer",borderWidth:"global.none",children:(0,n.tZ)(w.xv,{textDecoration:"underline",color:"global.goodchop-navy.600",type:"body-sm-bold",children:o("good-chop-checkout.edit-cta")})})]})},tt=function(e,t,r){var n=(0,o.useRef)(!1);(0,o.useEffect)(function(){t.deliveryTime||(n.current=!1)},[t.deliveryTime]),(0,o.useEffect)(function(){if(!n.current&&0!==e.length){if(t.deliveryTime&&t.firstDelivery){var o,i;if(e.some(function(e){var r,n;return(null===(r=e.deliveryDate)||void 0===r?void 0:r.deliveryDate)===t.firstDelivery&&(null===(n=e.deliveryOptions)||void 0===n?void 0:n.some(function(e){return e.handle===t.deliveryTime}))})){n.current=!0;return}}var l=null===(i=e[0])||void 0===i?void 0:null===(o=i.deliveryOptions)||void 0===o?void 0:o[0];l&&(n.current=!0,r(function(e){var t,r,n;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}))),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),n=n={deliveryTime:l.handle,firstDelivery:l.deliveryDate,firstDeliveryDay:l.deliveryDay,cutoffDate:null!==(t=l.cutoffDate)&&void 0!==t?t:null},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r}))}},[e,t.deliveryTime,t.firstDelivery,r])},tr=r(665003),tn=r(225053),to=r(466136),ti=r(917780),tl=r(718583),ta=r(447054),tu=r(90104),tc=r.n(tu),ts=function(e,t,r){null==e||e.startSpan("free-cuts.build-addon-group-failed").setAttributes({source:"good-chop-checkout","error.type":t,"selected-addon-index":r}).setStatus({code:eh.Z.ERROR}).end()},td=function(e,t,r,n){if(isNaN(r))return[];if(tc()(e))return ts(n,"empty-selected-addon",r),[];var o=e.sections;if(!o||0===o.length)return ts(n,"missing-sections",r),[];var i=e.isPreselectable?1:0;return[{groupType:o[0],sku:null!=t?t:"",selection:[{index:r,oneOffQuantity:1,preselectedQuantity:i,courses:[]}]}]};function tf(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 tp=function(e){if(!e||0===e.length)return[];var t=new Map,r=!0,n=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var a,u=i.value;t.set(u,(null!==(a=t.get(u))&&void 0!==a?a:0)+1)}}catch(e){n=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw o}}return Array.from(t.entries()).map(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return tf(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 tf(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.")}();return{index:t[0],quantity:t[1]}})},ty=function(e,t,r,n,o){var i=!!t&&0===e.length&&!r;return i&&(null==o||o.startSpan("mr.pcs-v2-request-skipped").setAttributes({source:"good-chop-checkout","cart-id":n,"ls-add-on-index":null!=t?t:void 0,"is-add-on-fetched":r,reason:"addon-data-not-ready"}).end()),i};function th(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}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}
1))),n.forEach(function(t){th(e,t,r[t])})}return e}function tm(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 tb=function(e){try{var t;return null!==(t=ew().get(e))&&void 0!==t?t:""}catch(e){return""}},tg=function(){var e=(0,j.Dv)(R),t=(0,j.Dv)(B),r=(0,ey.T)(),n=(0,tn.k)(),o=(0,to.l)({voucherCode:n.code}),i="ready"===o.status?o.addons:[],l="ready"===o.status?o.productSKU:void 0,a="loading"!==o.status,u=tb("hf_cart_id"),c=(0,ti.Y)().mutate,s=function(t,r){var n,o,i,l=JSON.parse(null!==(n=tl.ZP.getItem("hf_pcs-selected-sku"))&&void 0!==n?n:""),a=null!==(o=tl.ZP.getItem("persist-selection-order"))&&void 0!==o?o:"[]",c=tp(function(){try{return JSON.parse(a)}catch(e){return[]}}());return{params:{customer_id:null!==(i=null==e?void 0:e.customerId)&&void 0!==i?i:"",cartId:u,data:th({},(0,ta.Z)(new Date(t)),{productSku:l,meals:c,extras:r})},productSku:l,meals:c}};return{savePCS:function(e){var t,n,o,d,f,p,y=tl.ZP.getItem("persist-addon-selection-order"),h=parseInt(null!=y?y:"",10),v=td(isNaN(h)?{}:null!==(p=i.find(function(e){return e.index===h}))&&void 0!==p?p:{},l,h,a?r:void 0);if(!ty(v,y,a,u,r)){var m=s(e,v),b=m.params,g=m.productSku,O=m.meals,w=r.startSpan("mr.pcs-v2-request").setAttributes({source:"good-chop-checkout","cart-id":u,"product-sku":g,"selected-meals":JSON.stringify(O),"ls-add-on-index":null!=y?y:void 0,"add-on-index":null===(n=v[0])||void 0===n?void 0:null===(t=n.selection[0])||void 0===t?void 0:t.index,"preselected-quantity":null===(d=v[0])||void 0===d?void 0:null===(o=d.selection[0])||void 0===o?void 0:o.preselectedQuantity,"group-type":null===(f=v[0])||void 0===f?void 0:f.groupType});c(tm(tv({},b),{parentSpan:w}),{onSettled:function(){return w.end()}})}},savePCSWithAddon:function(e,n){var o,i,a,d,f,p,y,h=td(null!==(p=n.find(function(t){return t.index===e}))&&void 0!==p?p:{},l,e,r),v=s(null!==(y=null==t?void 0:t.firstDelivery)&&void 0!==y?y:"",h).params,m=r.startSpan("mr.pcs-v2-request-popup").setAttributes({source:"good-chop-checkout","cart-id":u,"direct-addon-index":e,"add-on-index":null===(i=h[0])||void 0===i?void 0:null===(o=i.selection[0])||void 0===o?void 0:o.index,"preselected-quantity":null===(d=h[0])||void 0===d?void 0:null===(a=d.selection[0])||void 0===a?void 0:a.preselectedQuantity,"group-type":null===(f=h[0])||void 0===f?void 0:f.groupType});c(tm(tv({},v),{parentSpan:m}),{onSettled:function(){return m.end()}})}}};function tO(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,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var tS=function(e,t,r,n,i){var l,a,u,c=(0,d.ZP)("good-chop-checkout").translateRaw,s=v().showError,f=(0,tr.u)().mutateAsync,p=tg().savePCS,y=function(e){if(Array.isArray(e))return e}(l=(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(l,2)||function(e,t){if(e){if("string"==typeof e)return tO(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 tO(e,2)}}(l,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],m=y[1],b=(0,o.useRef)(null);return{handleContinue:(a=function(){var o;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(l){switch(l.label){case 0:if(null==i||i(),p(e.firstDelivery),e.isSubmitted)return n(),[2];if(e.deliveryInstruction===e9&&!(null===(o=b.current)||void 0===o?void 0:o.validateAndFocus()))return[2];m(!0),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,f({id:r,payload:{address2Comment:e.deliveryInstruction,address2CommentCustom:e.deliveryInstruction===e9?e.deliveryInstructionCustom:null}})];case 2:return l.sent(),[3,4];case 3:return l.sent(),s(c("good-chop-checkout.delivery-address.save-error"),{duration:1e4}),m(!1),[2];case 4:return t(function(e){var t,r;return 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}
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),r=r={isSubmitted:!0},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}),m(!1),n(),[2]}})},u=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=a.apply(e,t);function i(e){tw(o,r,n,i,l,"next",e)}function l(e){tw(o,r,n,i,l,"throw",e)}i(void 0)})},function(){return u.apply(this,arguments)}),isSaving:h,deliveryInstructionsRef:b}};function tk(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 tx(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 tP(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 tA(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tk(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 tk(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 tC=r(788130),tZ=r(845818),tj=function(e){return/MR-TB/.test(e)},tD=r(435940),tI=r.n(tD),tE=function(){var e=(0,j.Dv)(B),t=e.firstDelivery,r
1=e.cutoffDate;return t&&r?tI()(t,r)+1:null};function t_(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 tT=function(){var e,t=(0,d.ZP)("good-chop-checkout").translateRaw,r=(function(e){if(Array.isArray(e))return e}(e=(0,eF.Z)("hf_selected-sku"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),1!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return t_(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 t_(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=tE();return tj(r)&&null!==o?(0,n.tZ)(w.xu,{mb:"global.sm-1","data-test-id":"charge-timing-banner",children:(0,n.tZ)(w.gb,{icon:(0,n.tZ)(tZ.default,{title:"Card"}),children:(0,n.tZ)(w.xv,{as:"p",type:"body-sm-regular",children:t("good-chop-checkout.payment.charge-timing-banner",{cutoffDays:null==o?void 0:o.toString()})})})}):null},tM=r(890762),tR=r(340332),tN=r(10198),tL=function(e){var t=e.sku,r=e.voucherCode,n=e.customerID,o=e.customerUUID,i=e.enabled,l=(0,tN.vr)({products:t?[{handle:t}]:[],couponCode:r,customerID:n||0,customerUUID:o||""},{enabled:i,suspense:!1}),a=l.data,u=l.isLoading;return{data:a,isLoading:null!=u&&u}},tB=r(183148),tU=function(e){var t=Math.trunc(e);return{units:t,nanos:Math.round((e-t)*1e9)}},tF=function(e){var t=e.result,r=e.sku,n=e.format,o=t.products.find(function(e){return e.handle===r});if(o){var i=Math.round(100*o.paidPrice)%100>0?2:0;return{boxPrice:(0,tB.A)({baseAmountDetail:tU(o.unitPrice),finalAmountDetail:tU(o.paidPrice),discountAmountDetail:tU(o.couponMoneyValue),format:n,discountedPriceDecimals:i}),shippingFee:(0,tB.A)({baseAmountDetail:tU(o.shippingAmount),discountAmountDetail:tU(o.shippingDiscountAmount),format:n,decimals:2}),fullPriceWithShipping:n(Math.round(100*o.unitPrice)+Math.round(100*o.shippingAmount),{decimals:2})}}},tV=function(e){var t=e.sku,r=e.voucherCode,n=e.customerID,o=e.customerUUID,i=(0,tR.nB)(),l=tL({sku:t,voucherCode:r,customerID:n,customerUUID:o,enabled:!!t}),a=l.data,u=l.isLoading;return!u&&a&&t?{checkoutPrice:tF({result:a,sku:t,format:i}),isLoading:!1}:{checkoutPrice:void 0,isLoading:u}},tX=r(890799);function tK(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 tq(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tK(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 tK(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 tW=function(){var e=tq((0,eF.Z)("hf_selected-sku"),1)[0],t=e?JSON.parse(e):null,r=tq((0,eF.Z)("hf_pcs-selected-sku"),1)[0],n=r?JSON.parse(r):void 0,o=(0,tX.hp)(),i=o.withSeamlessCutSelection,l=o.isReady;return{planSku:t,checkoutSku:i&&l&&n?n:t}},tG=function(){var e,t=tW(),r=t.planSku,n=t.checkoutSku,o=(0,tn.k)(),i=tV({sku:(tj(null!=r?r:"")?"MR-CBT1-6-1-0":n)||void 0,voucherCode:o.code}).checkoutPrice;return{price:null!==(e=null==i?void 0:i.fullPriceWithShipping)&&void 0!==e?e:""}},tH=function(e){var t=e.isChecked,r=e.showError,o=e.onChange,i=(0,d.ZP)("good-chop-checkout").translateRaw,l=tE(),a=i("good-chop-checkout.payment.consent-checkbox",{termsLink:'<a href="https://www.goodchop.com/terms-and-conditions" target="_blank" rel="noopener noreferrer" style="text-decoration: underline; font-weight: bold;">Terms and Conditions</a>',PrivacyPolicyLink:'<a href="https://www.goodchop.com/privacy-policy" target="_blank" rel="noopener noreferrer" style="text-decoration: underline; font-weight: bold;">Privacy Policy</a>',totalPrice:tG().price,cutoffDays:l});return(0,n.BX)(w.xu,{my:"global.sm-1",children:[(0,n.BX)(w.xu,{display:"flex",alignItems:"flex-start",ga
1p:"global.xs",children:[(0,n.tZ)(w.xu,{width:"20px",flexShrink:"0",children:(0,n.tZ)(w.XZ,{checked:t,onChange:o,"aria-labelledby":"consent-checkbox-text",label:"","data-test-id":"payment-consent-checkbox"})}),(0,n.tZ)(w.xv,{as:"p",type:"body-xs-regular",id:"consent-checkbox-text",children:(0,n.tZ)(eR.Z,{copy:a,hasMarkdown:!0})})]}),r&&(0,n.BX)(w.xu,{display:"flex",alignItems:"center",color:"error.600",mt:"global.xs",gap:"global.xxs",children:[(0,n.tZ)(tM.default,{title:"error"}),(0,n.tZ)(w.xv,{type:"body-xs-regular",color:"error.600",children:i("good-chop-checkout.payment.consent-checkbox-reminder")})]})]})},tY=r(285087),tz="persist-addon-selection-order",tJ="hf_free-cuts-popup-session-rejected",t$=function(){var e=(0,tY.l)(),t=(0,j.b9)(F),r=tl.ZP.getItem(tz),n=r?parseInt(r,10):NaN,i=isNaN(n)?null:n,l=(0,o.useCallback)(function(){try{tl.ZP.removeItem(tz)}catch(e){}},[]),a=(0,o.useCallback)(function(e){if(null===e)l(),t(void 0);else{try{tl.ZP.setItem(tz,String(e))}catch(e){}t(e)}},[l,t]),u=(0,o.useCallback)(function(){l(),t(void 0)},[l,t]),c=(0,o.useCallback)(function(){e.setItem(tJ,"true")},[e]);return{selectedAddOnIndex:i,setSelectedAddOnIndex:a,clearFreeCutsData:u,hasRejectedInSession:"true"===e.getItem(tJ),markRejected:c}};function tQ(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 t0(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tQ(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 tQ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t1=function(){var e=t0((0,o.useState)(!1),2),t=e[0],r=e[1],n=t0((0,o.useState)(null),2),i=n[0],l=n[1],a=(0,tn.k)(),u=(0,to.l)({voucherCode:a.code}),c=(0,o.useMemo)(function(){return"ready"===u.status?u.addons:[]},[u]),s=t$(),d=s.selectedAddOnIndex,f=s.setSelectedAddOnIndex,p=s.clearFreeCutsData,y=s.hasRejectedInSession,h=s.markRejected,v=tg().savePCSWithAddon,m=(0,ey.T)(),b=c.length>1&&null===d&&!y,g=(0,o.useCallback)(function(){r(!1),null==i||i(!1),l(null)},[i]),O=(0,o.useCallback)(function(){return new Promise(function(e){l(function(){return e}),r(!0)})},[]),w=(0,o.useCallback)(function(e){if(!c.find(function(t){return t.index===e})){m.startSpan("free-cuts.popup.addon-not-found").setAttributes({source:"good-chop-checkout","selected-course-index":e}).setStatus({code:eh.Z.ERROR}).end(),r(!1),null==i||i(!0),l(null);return}f(e),v(e,c),r(!1),null==i||i(!0),l(null)},[c,f,v,i,m]);return{isPopupOpen:t,shouldTriggerPopup:b,addons:c,selectedAddOnIndex:d,handlePopupConfirm:w,rejectSelection:(0,o.useCallback)(function(){h(),p(),r(!1),null==i||i(!0),l(null)},[h,p,i]),closePopup:g,triggerPopup:O,setSelectedAddOnIndex:f}};function t2(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 t7(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t2(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 t2(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t8=function(){var e=t7((0,o.useState)(!1),2),t=e[0],r=e[1],n=t7((0,o.useState)(!1),2),i=n[0],l=n[1],a=(0,o.useCallback)(function(){r(function(e){return e||l(!1),!e})},[]),u=(0,o.useCallback)(function(){return!!t||(l(!0),!1)},[t]);return{isConsentChecked:t,showConsentError:i,handleConsentChange:a,validateConsent:u}},t6=function(){var e=(0,d.ZP)("good-chop-checkout").translateRaw;return(0,o.useCallback)(function(t){switch(t){case"prepaid_card_blocked":case"CC_NO_PREPAID_ERR":return e("good-chop-checkout.payment.error.prepaid-card-blocked");case"HOSTED_FIELDS_FIELDS_EMPTY":return e("good-chop-checkout.payment.error.empty-fields");case"HOSTED_FIELDS_FIELDS_INVALID":case"HOSTED_FIELDS_FAILED_TOKENIZATION":return e("good-chop-checkout.payment.error.invalid-details");case"CLIENT_AUTHORIZATION_INSUFFICIENT":case"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR":case"METHOD_CALLED_AFTER_TEARDOWN":case"PAYPAL_FLOW_FAILED":default:return e("good-chop-checkout.payment.error.other-failures");case"PAYPAL_INVALID_PAYMENT_OPTION":return e("good-chop-checkout.payment.error.issuer-failure");case"PAYPAL_POPUP_CLOSED":return e("good-chop-checkout.payment.error.abandonment")}},[e])},t4=function(){var e=(0,z.py)({runUsingStatsig:!0}).track,t=(0,J.R)({runUsingStatsig:!0}),r=t.id,n=t.attributes;return(0,o.useCallback)(function(t){if(r){var o,i,l,a,u,c=(null==t?void 0:t.errCode)||(null===(o=t.paymentData)||void 0===o?void 0:o.errCode)||(null==t?void 0:t.code)||(null===(i=t.errDetails)||void 0===i?void 0:i.code)||"";e({experimentationUserId:r,experimentationUserAttributes:n,eventName:"Goodchop_Checkout_Payment_Error",eventTags:{screen:"Good Chop checkout payment form",ResponseCode:c,ErrorInfo:(null===(l=t.errDetails)||void 0===l?void 0:l.message)||(null===(u=t.paymentData)||void 0===u?void 0:null===(a=u.errDetails)||void 0===a?void 0:a.message)||(null==t?void 0:t.message)||c,PaymentMethod:t.paymentMethodValue,EventAction:"checkout failed | ".concat(t.paymentMethodValue)}})}},[e,r,n])},t3=function(e){var t=v().showError,r=t6(),n=t4();return(0,o.useCallback)(function(o){var i;return(null===(i=o.errDetails)||void 0===i?void 0:i.message)?(t(o.errDetails.message,{duration:5e3}),e(o),n(o),!0):!!o.errCode&&(t(r(o.errCode),{duration:5e3}),e(o),n(o),!0)},[t,r,e,n])},t5=r(495500),t9={9908:"PAYMENT_FAILURE",9915:"CART_ITEM_NOT_FOUND",9917:"INCOMPLETE_DELIVERY_OPTION",9902:"PASSED_CUTOFF",9909:"PAYMENT_FRAUD",9923:"PRICE_CALCULATION_FAILURE",9910:"VOUCHER_FRAUD",9903:"VALIDATION_FAILED",9907:"PAYMENT_BLOCKED_PREPAID",9913:"INVALID_CUSTOMER_ID",9914:"CART_FAILURE",9916:"DELIVERY_OPTION_DETAILS",9919:"SUBSCRIPTION_PRODUCT_NOT_FOUND",9400:"DUPLICATE_REQUEST",9901:"INVALID_ARGUMENT",9904:"ADDRESS_VALIDATION_FAILED",9905:"BILLING_ADDRESS_VALIDATION_FAILED",9906:"SHIPPING_ADDRESS_VALIDATION_FAILED",9911:"INVALID_PAYMENT_METHOD",9912:"INVALID_BUSINESS_DIVISION",9918:"PRODUCT_FAMILY_NOT_FOUND",9920:"IP_NOT_FOUND",9921:"CUSTOMER_NOT_FOUND",9922:"ADDRESS_NOT_FOUND",9924:"PLAN_CREATION_FAILURE",9925:"VOUCHER_VALIDATION_FAILURE",9900:"UNKNOWN"};function re(e){try{var t,r,n=parseInt(null!==(t=null==e?void 0:e.status)&&void 0!==t?t:"0",10);if(!(null==e?void 0:e.response))return null;var o=JSON.parse(e.response),i=null!==(r=null==o?void 0:o.code)&&void 0!==r?r:0,l=null==o?void 0:o.message;return{statusCode:n,errorCode:i,errorMessage:l}}catch(e){return null}}var rt=function(e){var t,r=re(e);return r&&null!==(t=t9[r.errorCode])&&void 0!==t?t:"UNKNOWN"},rr=function(e,t){return Array.isArray(e)&&e.includes(t)},rn=function(e){var t=re(e);if(!t)return!1;var r=t.statusCode,n=t.errorCode,o=t.errorMessage,i=t9[n];return 400===r&&"PAYMENT_FRAUD"===i&&rr(o,"payment_fraud")},ro=function(e){var t=re(e);if(!t)return!1;var r=t.statusCode,n=t.errorCode,o=t.errorMessage,i=t9[n];return 400===r&&"VOUCHER_FRAUD"===i&&rr(o,"voucher_abuse")},ri=function(e){var t=e.orderId,r=e.orderTotal,n=e.voucherCode,o=e.voucherCategory,i=e.discountValue,l=e.paymentMethod,a=e.sku,u=e.email,c=e.firstName,s=e.lastName,d="".concat(t," | ").concat(l);return n&&(d+=" | ".concat(n)),{gaEventNonInteraction:!1,event:"gaEventTrigger_EE",gaEventCategory:"funnel",gaEventAction:"sale",gaEventLabel:d,email:u,fname:c,lname:s,ecommerce:{purchase:{actionField:{transaction_id:t,affiliation:o,revenue:r,tax:0,coupon:n,"coupon-value":i},products:[{id:a,name:a}]}}}},rl=function(e){var t=e.paymentMethod,r=e.error;return{gaEventCategory:"checkout accordeon",gaEventAction:"checkout failed | ".concat(t),gaEventLabel:r,payment_method:t,error_info:r,event_name:"Checkout_Error",tribe:"New Brands Growth",gaEventNonInteraction:!1,event:"gaEventTrigger"}},ra=r(80108);function ru(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 rc=function(e,t){var r={},n=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done);
1n=!0){var u,c=l.value;r[c]=(null!==(u=r[c])&&void 0!==u?u:0)+1}}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}var s=Object.fromEntries(Object.entries(r).map(function(t){var r,n,o=function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ru(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 ru(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.")}(),i=o[0],l=o[1],a=e.find(function(e){return e.index===Number(i)});return[Number(i),(null!==(n=null==a?void 0:null===(r=a.chargeSetting)||void 0===r?void 0:r.amount)&&void 0!==n?n:0)*l]}));return{pricesByIndex:s,totalPrice:Object.values(s).reduce(function(e,t){return e+t},0)}};function rs(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 rd=function(e){var t,r,n,o=e.sku,i=e.voucherCode,l=e.menuData,a=e.selectedIndexes,u=(0,tR.nB)(),c=tL({sku:o,voucherCode:i,enabled:!!o}),s=c.data,d=c.isLoading;if(d||!s)return{pricing:void 0,isLoading:d};var f=s.products.find(function(e){return e.handle===o});if(!f)return{pricing:void 0,isLoading:!1};var p=Math.round(100*f.unitPrice),y=Math.round(100*f.paidPrice),h=Math.round(100*f.couponMoneyValue),v=Math.round(100*f.shippingAmount),m=v-Math.round(100*f.shippingDiscountAmount),b=rc(null!==(n=null==l?void 0:null===(r=l.items)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.courses)&&void 0!==n?n:[],void 0===a?[]:a),g=b.pricesByIndex,O=b.totalPrice,w=Object.fromEntries(Object.entries(g).map(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return rs(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 rs(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.")}(),r=t[0],n=t[1];return[Number(r),n>0?u(n,{decimals:2}):""]})),S=p+v+O,k=y+m+O,x=(0,ra.MJ)(o||"");return{pricing: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}({boxFullPrice:u(p,{decimals:2}),boxDiscountedPrice:u(y,{decimals:2}),boxDiscountPrice:u(h,{decimals:2}),shippingPrice:u(x?v-500:v,{decimals:2}),totalFullPrice:u(S,{decimals:2}),totalDiscountedPrice:u(k,{decimals:2}),hasDiscount:k<S,isShippingFree:m<100,isBoxFree:y<100,serviceFee:x?u(x?500:0,{decimals:2}):null},O>0&&{premiumTotalPrice:u(O,{decimals:2}),premiumPricesByIndex:w}),isLoading:!1}},rf=r(273656),rp=r(976555),ry=function(){try{var e=tl.ZP.getItem("persist-selection-order");if(!e)return[];var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},rh=function(){var e,t,r,n,o,i,l,a=eM(),u=null!==(i=null==a?void 0:null===(r=a.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.productFamily)&&void 0!==i?i:"",c=(0,rf.rS)({weeks:(0,rp.Z)(),product:u,exclude:["recipes.nutrition","recipes.cuisines"]},{enabled:!!u,suspense:!1}).data,s=ry();return rc(null!==(l=null==c?void 0:null===(o=c.items)||void 0===o?void 0:null===(n=o[0])||void 0===n?void 0:n.courses)&&void 0!==l?l:[],s).totalPrice/100},rv=function(){var e=tW().checkoutSku,t=(0,tn.k)().code,r=rh(),n=rd({sku:null!=e?e:void 0,voucherCode:t}).pricing;if(n)return Math.round((Number(n.totalDiscountedPrice.replace(/[^0-9.]/g,""))+r)*100)/100};function rm(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 rb(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var rg=function(){var e,t=(0,ey.T)(),r=(0,o.useRef)(null),n=(0,o.useRef)(""),i=(0,Y.Z)().push,l=(0,z.py)({runUsingStatsig:!0}).track,a=(0,J.R)({runUsingStatsig:!0}),u=a.id,c=a.attributes,s=(function(e){if(Array.isArray(e))return e}(e=(0,eF.Z)("hf_selected-sku"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),1!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return rm(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 rm(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],d=s?JSON.parse(s):"",f=rv();return{traceOrderSubmit:(0,o.useCallback)(function(e){n.current=e,r.current=t.startSpan("wl-checkout-submit",{attributes:{"payment.method":e,"checkout.source":"good-chop","checkout.sku":d,"checkout.isTrialBox":tj(d),"price.uiGrandTotal":f}}),u&&l({experimentationUserId:u,experimentationUserAttributes:c,eventName:"Checkout_Attempt",eventTags:{screen:"Checkout payment form",EventCategory:"checkout accordeon",PaymentMethod:e,EventAction:"checkout attempt",checkout_source:"good-chop"}})},[d,t,l,u,c,f]),traceClientError:(0,o.useCallback)(function(e){var t,n;r.current&&(r.current.setAttributes({"payment.outcome":"client_error","payment.errCode":e.errCode||"","payment.errMessage":(null===(t=e.errDetails)||void 0===t?void 0:t.message)||e.errCode||"","error.message":(null===(n=e.errDetails)||void 0===n?void 0:n.message)||e.errCode||"","payment.method":e.paymentMethodValue}).setStatus({code:eh.Z.ERROR}).end(),r.current=null)},[]),tracePlaceOrderSuccess:(0,o.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.current&&(r.current.setAttributes({"payment.outcome":"success","order.id":e.orderNr||"","order.total":e.orderTotal||""}).setStatus({code:eh.Z.OK}).end(),r.current=null)},[]),tracePlaceOrderError:(0,o.useCallback)(function(e){var t,o,a,s,d,f,p=rb(e,t5.Z)&&e.response?rt(e.errorMessage):"network",y=rb(e,t5.Z)?e:null,h=null!==(o=null==y?void 0:null===(t=y.errorMessage)||void 0===t?void 0:t.status)&&void 0!==o?o:"",v=re(null==y?void 0:y.errorMessage),m=null!==(a=null==v?void 0:v.errorCode)&&void 0!==a?a:"",b=Array.isArray(null==v?void 0:v.errorMessage)?v.errorMessage.join(", "):null!==(s=null==v?void 0:v.errorMessage)&&void 0!==s?s:"",g=rt(null==y?void 0:y.errorMessage),O=n.current;r.current&&(r.current.setAttributes({"payment.outcome":"place_order_error","payment.errorType":p,"error.message":(null==y?void 0:y.message)||"","error.code":m?String(m):"","error.httpStatus":h,"error.component":g}).setStatus({code:eh.Z.ERROR,message:(null==y?void 0:y.message)||"place order failed"}).end(),r.current=null),i(rl({paymentMethod:O,error:"".concat(b," ").concat(null!==(d=null==y?void 0:y.message)&&void 0!==d?d:"").trim()})),u&&l({experimentationUserId:u,experimentationUserAttributes:c,eventName:"Goodchop_Checkout_Error",eventTags:{screen:"Good Chop checkout payment form",ResponseCode:m,ErrorInfo:"".concat(b," ").concat(null!==(f=null==y?void 0:y.message)&&void 0!==f?f:"").trim(),ErrorComponent:g,ErrorCategory:"",PaymentMethod:O,EventAction:"checkout failed | ".concat(O),errorType:p}})},[i,l,u,c])}},rO=function(){var e=tW(),t=e.planSku,r=e.checkoutSku,n=(0,tn.k)().code,o=rh(),i=tj(null!=t?t:""),l=rd({sku:i?void 0:null!=r?r:void 0,voucherCode:n}).pricing;return i||!l?"1.00":(Number(l.totalDiscountedPrice.replace(/[^0-9.]/g,""))+o).toFixed(2)},rw=function(e,t){var r=new URLSearchParams;return r.set("nextDeliveryDate",e.split("T")[0]),t&&r.set("cutoffDate",t),"/subscription-loading?".concat(r.toString())};function rS(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}var rk=function(e){var t;return(null!=(t=t5.Z)&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t)&&e.response?rn(e.errorMessage)?"good-chop-checkout.payment.error.payment-fraud":ro(e.errorMessage)?"good-chop-checkout.payment.error.voucher-fraud":"good-chop-checkout.payment.error.place-order":"good-chop-checkout.payment.error.place-order-network"},rx=function(e,t){var r=(0,j.Dv)(B),n=r.firstDelivery,i=r.cutoffDate,l=(0,ey.T)();(0,o.useEffect)(function(){e&&(t(),Promise.race([l.flush(),new Promise(function(e){return setTimeout(e,3e3)})]).then(function(){window.location.replace(rw(n,i))}))},[e,t,n,i,l])},rP=function(e,t){var r=v().showError,n=(0,d.ZP)("good-chop-checkout").translateRaw,i=(0,o.useRef)(null);(0,o.useEffect)(function(){if(!e){i.current=null;return}e!==i.current&&(i.current=e,r(n(rk(e)),{duration:5e3}),t(e))},[e,r,n,t])},rA=function(e,t,r,n){var i;return(0,o.useCallback)((i=function(){var o,i;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(l){switch(l.label){case 0:if(!e())return[2];if(!t)return[3,2];return[4,r()];case 1:if(!l.sent())return[2];l.label=2;case 2:return(null==(o=n.current)?void 0:o.requestSubmit)?o.requestSubmit():((i=document.createElement("input")).type="submit",null==o||o.append(i),i.click(),i.remove()),[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,n){var o=i.apply(e,t);function l(e){rS(o,r,n,l,a,"next",e)}function a(e){rS(o,r,n,l,a,"throw",e)}l(void 0)})}),[e,t,r,n])},rC=function(e){var t=e.title,r=e.subtitle;return(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",rowGap:["global.xs","global.sm-1"],children:[(0,n.tZ)(w.xu,{width:"100%",textAlign:"center",children:(0,n.tZ)(w.xv,{as:"p",type:["body-lg-bold","body-xl-bold"],color:"global.gray.800",children:t})}),(0,n.tZ)(w.xu,{width:"100%",textAlign:"center",children:(0,n.tZ)(w.xv,{as:"p",type:"body-md-regular",color:"global.hellofresh.action-black.900",children:r})})]})},rZ=r(277425),rj=r(822897),rD=r(318066),rI=function(e){var t=e.tags.filter(function(e){return!0===e.displayLabel}).slice(0,2);return 0===t.length?null:(0,n.tZ)(w.xu,{display:"flex",gap:"global.xxs",flexWrap:"wrap",children:t.map(function(e){return(0,n.tZ)(w.Vp.Static,{radius:"rectangular",color:"global.gray.700",backgroundColor:"global.cream.200",content:e.name,"aria-label":e.name},e.slug)})})},rE=function(e){var t=e.addons,r=e.selectedAddOnIndex,o=e.onSelect;return(0,n.tZ)(w.xu,{width:"100%",display:"flex",flexDirection:"column",gap:["global.sm-1","global.md-1"],children:t.map(function(e){var t,i,l,a,u,c,s=r===e.index,d=(0,rZ.Z)(null===(t=e.recipe)||void 0===t?void 0:t.imageLink,rj.b.website);return(0,n.BX)(w.xu,{position:"relative",width:"100%",children:[(0,n.tZ)(w.xu,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",borderWidth:"2px",borderStyle:"solid",borderColor:s?"global.goodchop-navy.600":"transparent",pointerEvents:"none"}),(0,n.tZ)(w.xu,{borderWidth:"1px",borderStyle:"solid",borderColor:s?"global.goodchop-navy.600":"global.gray.400",p:"global.sm-2",children:(0,n.BX)(w.xu,{display:"flex",alignItems:"center",gap:"global.sm-2",paddingY:"global.xs",children:[(0,n.tZ)(w.Y8,{id:"addon-".concat(e.index),name:"free-cut-selection",checked:s,onChange:function(){return o(e.index)}}),(0,n.BX)("label",{htmlFor:"addon-".concat(e.index),style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",cursor:"pointer"},children:[(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",justifyContent:"center",flex:"1",pr:"global.md-2",children:[(0,n.tZ)(w.xv,{as:"p",type:"body-md-bold",color:"global.black",wordBreak:"break-word",children:null===(i=e.recipe)||void 0===i?void 0:i.name}),(null===(l=e.recipe)||void 0===l?void 0:l.headline)&&(0,n.tZ)(w.xv,{as:"p",type:"body-md-regular",color:"global.black",children:e.recipe.headline}),(null===(a=e.recipe)||void 0===a?void 0:a.tags)&&e.recipe.tags.length>0&&(0,n.tZ)(w.xu,{mt:"global.xs",children:(0,n.tZ)(rI,{tags:e.recipe.tags})})]}),(null===(u=e.recipe)||void 0===u?void 0:u.imageLink)&&(0,n.tZ)(w.xu,{width:"80px",height:"80px",position:"relative",overflow:"hidden",flexShrink:"0",children:(0,n.tZ)(rD.ZP,{fill:!0,src:d,alt:(null===(c=e.recipe)||void 0===c?void 0:c.name)||"",sizes:"160px",quality:90,style:{objectFit:"cover"}})})]})]})})]},e.index)})})},r_=function(e){var t=e.isOpen,r=e.onClose,o=e.addons,i=e.selectedAddOnIndex,l=e.setSelectedAddOnIndex,a=e.onConfirm,u=e.onReject,c=e.title,s=e.subt
1itle,d=e.confirmButtonText,f=e.cancelButtonText,p=e.hasCloseButton,y=e.returnFocusRef;return(0,n.tZ)(w.Vq,{isOpen:t,onDismiss:r,width:["95%","556px"],confirmButtonText:d,cancelButtonText:f,onClose:r,onClickSecondaryButton:u,onConfirm:function(){return a(i)},headless:!0,hasCloseButton:void 0===p||p,returnFocusRef:y,padding:"global.md-1",children:(0,n.tZ)(w.xu,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",children:(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",children:[(0,n.tZ)(w.xu,{width:"100%",pb:"global.md-1",children:(0,n.tZ)(rC,{title:c,subtitle:s})}),(0,n.tZ)(rE,{addons:o,selectedAddOnIndex:i,onSelect:l})]})})})},rT=function(e){var t=e.isOpen,r=e.onClose,o=e.addons,i=e.selectedAddOnIndex,l=e.setSelectedAddOnIndex,a=e.onConfirm,u=e.onReject,c=e.title,s=e.subtitle,d=e.confirmButtonText,f=e.cancelButtonText,p=e.returnFocusRef;return(0,n.tZ)(w.dy.Container,{placement:"bottom",isOpen:t,onDismiss:r,onClose:r,isModal:!0,isTouchMoveEnabled:!0,width:"100%",returnFocusRef:p,positionAbsoluteCloseButton:!0,children:(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",width:"100%",height:"auto",maxHeight:"82vh",children:[(0,n.tZ)(w.xu,{width:"100%",textAlign:"center",children:(0,n.tZ)(rC,{title:c,subtitle:s})}),(0,n.tZ)(w.xu,{width:"100%",overflowY:"auto",py:"global.sm-2",flex:"1",children:(0,n.tZ)(rE,{addons:o,selectedAddOnIndex:i,onSelect:l})}),(0,n.BX)(w.xu,{width:"100%",display:"flex",flexDirection:"column",gap:"global.sm-2",children:[(0,n.tZ)(w.zx.Primary,{onClick:function(){return a(i)},children:d}),(0,n.tZ)(w.zx.Secondary,{onClick:u,children:f})]})]})})};function rM(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 rR=function(e){var t,r,i,l=e.isOpen,a=e.addons,u=e.selectedAddOnIndex,c=e.onConfirm,s=e.onReject,f=e.onClose,p=(0,k.Sj)(),y=(0,o.useRef)(null),h=(0,d.ZP)("good-chop-checkout").translateRaw,v=null!==u&&a.length>0?null!==(i=null===(r=a.find(function(e){return e.index===u}))||void 0===r?void 0:r.index)&&void 0!==i?i:a[0].index:a.length>0?a[0].index:-1,m=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(v))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return rM(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 rM(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.")}(),b=m[0],g=m[1],O=h("good-chop-checkout.payment.free-cuts-popup.title"),w=h("good-chop-checkout.payment.free-cuts-popup.subtitle"),S=h("good-chop-checkout.payment.free-cuts-popup.confirm-cta"),x=h("good-chop-checkout.payment.free-cuts-popup.reject-cta");return l?"mobile"===p?(0,n.tZ)(rT,{isOpen:l,onClose:f,addons:a,selectedAddOnIndex:b,setSelectedAddOnIndex:g,onConfirm:c,onReject:s,title:O,subtitle:w,confirmButtonText:S,cancelButtonText:x,returnFocusRef:y}):(0,n.tZ)(r_,{isOpen:l,onClose:f,addons:a,selectedAddOnIndex:b,setSelectedAddOnIndex:g,onConfirm:c,onReject:s,title:O,subtitle:w,confirmButtonText:S,cancelButtonText:x,returnFocusRef:y}):null},rN=r(410690),rL=r.n(rN),rB=r(57179),rU=r(953137),rF=r(792229),rV=r(238044),rX=r(581340),rK=r(190341),rq=r(497305),rW=r(511194),rG=function(e){try{var t;return null!==(t=ew().get(e))&&void 0!==t?t:""}catch(e){return""}},rH=function(e){try{return tl.ZP.getItem(e)}catch(e){return null}},rY=function(e,t){try{tl.ZP.setItem(e,t)}catch(e){}},rz=function(e){try{tl.ZP.removeItem(e)}catch(e){}},rJ=function(e){try{ew().remove(e)}catch(e){}},r$=function(e){var t=e.sku,r=e.isTrialBox,n=e.targetTrialBoxSku,o=e.isSeamlessCutSelectionActive;return r?n:o?t:void 0},rQ=r(538049);function r0(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 r1(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}function r2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r7(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r0(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 r0(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 r8=function(){var e,t,r=(0,Y.Z)().push,n=(0,rX.t)(),i=(0,eu.Z)(),l=(0,rK.G)(),a=(0,j.Dv)(R),u=(0,j.Dv)(N),c=(0,j.Dv)(B),s=(0,ey.T)(),d=r7((0,eF.Z)("hf_selected-sku"),1)[0],f=r7((0,eF.Z)("hf_pcs-selected-sku"),1)[0],p=f?JSON.parse(f):"",y=d?JSON.parse(d):"",h=r7((0,eF.Z)("hf_funnel_cadence"),1)[0],v=rG("STORED_COUPON_CODE")||"",m=tL({sku:y,voucherCode:v,enabled:!!y}).data,b=rh(),g=rv(),O=(0,rq.Z)(),w=(0,rq.Z)({runUsingStatsig:!0}),S=(0,es.W)({},{suspense:!1}).data,k=(0,rU.u)({},{suspense:!1}).data,x=(0,rB.C)(),P=x.mutate,A=x.isLoading,C=x.error,Z=x.isSuccess,D=(0,tX.hp)(),I=D.withSeamlessCutSelection,E=D.isReady,_=I&&E,T=(0,rW.mR)().targetTrialBoxSKU,M=(0,rQ.S)(),L=M.patchCart,U=M.isLoading,F=_&&!!p&&p!==y;return{placeOrder:(0,o.useCallback)((e=function(e){var t,o,d,f,x,A,C,Z,j,D,I,E,M,R,N,B,U,V,X,K,q,W,G,H,Y,z,J,$,Q,ee,et,er,en;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(eo){switch(eo.label){case 0:if(x=null!==(f=null==a?void 0:a.customerId)&&void 0!==f?f:"",C=null!==(A=null==a?void 0:a.email)&&void 0!==A?A:"",Z="".concat(x,"-placed-order"),j=rG("hf_cart_id"),D=rG("hf_public_id")||"",I=null!==rH(Z),M=null!==(E=null==c?void 0:c.firstDelivery)&&void 0!==E?E:"",N=(R=tj(null!=y?y:""))?2:0,I&&k&&k.items.length>0)return n.push(rw(null!==(B=null==c?void 0:c.firstDelivery)&&void 0!==B?B:"",null!==(U=null==c?void 0:c.cutoffDate)&&void 0!==U?U:null)),[2];if(I||rY(Z,"true"),X=(null!==(V=null==k?void 0:null===(t=k.items)||void 0===t?void 0:t.length)&&void 0!==V?V:0)>0,K=!R,q=r$({sku:y,isTrialBox:R,targetTrialBoxSku:T,isSeamlessCutSelectionActive:_}),W=F?p:y,G=null==m?void 0:m.products.find(function(e){return e.handle===y}),Y=s.startSpan("good-chop-checkout.place-order").setAttributes({source:"good-chop-checkout",isCustomerRetrying:I,hasSubscription:X,localeStorageCadence:h,"product.sku":y,"product.freeAddOn":!1,"payment.performCharge":K,"delivery.firstDelivery":M,"delivery.deliveryOption":null!==(H=null==c?void 0:c.deliveryTime)&&void 0!==H?H:"","customer.id":x,"cart.id":j,"price.uiGrandTotal":g}),$={variant:"good-chop",variantCookie:null,brand:"good-chop",country:i||null,marketCode:i||null,locale:null,currency:null,ui:{total:null,subtotal:null,shipping:null,discount:null},calculated:{total:null,subtotal:null,shipping:null,discount:null},payload:{total:null,subtotal:null,shipping:null,discount:null},calculatedAgeMs:null,calculatedAwaitMs:null,calculatedAwaitStatus:"skipped",voucher:{code:v||null,applied:!!v,valid:null,error:null,validatedBy:null,manuallyRemoved:null,calculatedCode:null,payloadCode:v||null},cartId:j||null,subscriptionId:null,plansConfigId:y||null,emailHash:null,appWebview:null!==(z=null===(o=l.mobileWebView)||void 0===o?void 0:o.active)&&void 0!==z?z:null,appWebviewDevice:null!==(J=null===(d=l.mobileWebView)||void 0===d?void 0:d.device)&&void 0!==J?J:null},Q=s.startSpan(rF.Zz,{attributes:(0,rV._)($)}),er={country:i,cartID:j,couponCode:v,customerId:x,customerEmail:C,personal:{firstName:u.address.firstName,lastName:u.address.lastName},shippingAddressId:Number(u.shippingId),billingAddressId:Number(u.billingId),payment: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){r2(e,t,r[t])})}return e}({method:e.paymentMethodValue,redirect_urls:{success:"".concat(window.location.origin,"/checkout?paymentSuccess=true&method=").concat(e.paymentMethodValue),failure:"".concat(window.location.origin,"/checkout?paymentError=true&method=").concat(e.paymentMethodValue)}},e.paymentData,K&&{performCharge:!0}),deliveryMoments:r2({},Date.now(),{deliveryTime:null!==(ee=null==c?void 0:c.deliveryTime)&&void 0!==ee?ee:"",firstDelivery:M,firstDeliveryDay:null!==(et=null==c?void 0:c.firstDeliveryDay)&&void 0!==et?et:0,sku:W}),cadenceInterval:parseInt(h||"4",10),cadenceStartWeek:(0,ta.Z)(rL()(new Date(M),N)),forwardURL:"".concat(window.location.protocol,"//").concat(window.location.host).concat("/checkout-api/finish/placeorder/"),subscription:q?{sku:q}:{},freeAddOn:!1,hfPublicId:D},en=function(){P(er,{onSuccess:function(t){var n,o,i,l,s,d,f,p,h,v,m,g=null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.order,k=(null==g?void 0:g.orderTotal)?Number.parseFloat(g.orderTotal):null,x=null!==(l=null==G?void 0:G.couponMoneyValue)&&void 0!==l?l:0;r(ri({orderId:null!==(s=null==g?void 0:g.orderNr)&&void 0!==s?s:"",orderTotal:null!==(d=null==g?void 0:g.orderTotal)&&void 0!==d?d:"",voucherCode:null!==(f=null==g?void 0:g.voucherCode)&&void 0!==f?f:"",voucherCategory:null!==(p=null==g?void 0:g.voucherCategory)&&void 0!==p?p:"",discountValue:x,paymentMethod:e.paymentMethodValue,sku:null!=y?y:"",email:null!==(h=null==a?void 0:a.email)&&void 0!==h?h:"",firstName:u.address.firstName,lastName:u.address.lastName})),rY("wl_first_delivery_prices",JSON.stringify({orderTotal:null==g?void 0:g.orderTotal,cartDiscountValue:x,sku:y,isCheckoutFlow:!0,premiumTotalPrice:b}));var P=null==S?void 0:S.uuid;P&&(w(P,!1,"checkout_success"),w(P,!1,"post_checkout_mapping"));var A=null==t?void 0:null===(i=t.payload)||void 0===i?void 0:null===(o=i.customer)||void 0===o?void 0:o.id;A&&O("".concat(A),!1,"checkout_success"),rJ("hf_cart_id");var C=Object.values(er.deliveryMoments)[0];Y.setAttributes({"delivery.firstDeliveryDay":null!==(v=null==c?void 0:c.firstDeliveryDay)&&void 0!==v?v:0,localStorageSku:y,"delivery.skuMatch":null!=y&&(null==C?void 0:C.sku)===y,"cadence.cadenceInterval":er.cadenceInterval,"cadence.cadenceStartWeek":er.cadenceStartWeek}),Y.setAttributes({"order.id":null!==(m=null==g?void 0:g.orderNr)&&void 0!==m?m:""}).setStatus({code:eh.Z.OK}).end(),Q.setAttributes((0,rV.p)($,{status:"success",response:{total:Number.isFinite(k)?k:null,subtotal:null,shipping:null,discount:null},orderId:(null==g?void 0:g.orderNr)||null,errorCode:null,errorMessage:null,errorHttpStatus:null})).end()},onError:function(e){var t,r,n,o,i,l;(null==e?void 0:e.response)&&rz(Z),Y.setAttributes({"error.message":null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"","error.httpStatus":null!==(o=null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)&&void 0!==o?o:"","error.code":null!==(i=null==e?void 0:e.code)&&void 0!==i?i:""}).setStatus({code:eh.Z.ERROR,message:null!==(l=null==e?void 0:e.message)&&void 0!==l?l:"place order failed"}).end(),Q.setAttributes((0,rV.p)($,{status:"error",response:{total:null,subtotal:null,shipping:null,discount:null},orderId:null,errorCode:(null==e?void 0:e.code)||null,errorMessage:(null==e?void 0:e.message)||null,errorHttpStatus:(null==e?void 0:null===(r=e.response)||void 0===r?void 0:r.status)||null})).end()}})},!(F&&j))return[3,4];eo.label=1;case 1:return eo.trys.push([1,3,,4]),[4,L({cartId:j,voucher:v||null,items:[{sku:p,quantity:1,metadata:{mealsPreset:"",timestamp:Date.now()}}]})];case 2:return eo.sent(),[3,4];case 3:return eo.sent(),Y.setStatus({code:eh.Z.ERROR,message:"patch cart failed before place order"}).end(),Q.end(),[2];case 4:return en(),[2]}})},t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function l(e){r1(i,n,o,l,a,"next",e)}function a(e){r1(i,n,o,l,a,"throw",e)}l(void 0)})},function(e){return t.apply(this,arguments)}),[a,u,c,y,p,h,v,m,b,g,k,P,L,_,i,l,s,n,F,T,r,O,w,S]),isLoading:A||U,isSuccess:Z,error:C}},r6=function(e){(0,o.useEffect)(function(){if(!e){var t=window.scrollY,r=!1,n=!1,o=function(){r=!0},i=function(){r||n||(n=!0,window.scrollTo(0,t),requestAnimationFrame(function(){n=!1}))};return window.addEventListener("scroll",i),window.addEventListener("wheel",o,{passive:!0,once:!0}),window.addEventListener("touchstart",o,{passive:!0,once:!0}),function(){window.removeEventListener("scroll",i),window.removeEventListener("wheel",o),window.removeEventListener("touchstart",o)}}},[e])};function r4(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 r3={signup:function(e){var t=e.isActive,r=e.isComplete,o=e.isLocked,i=e.onComplete,l=(0,d.ZP)("good-chop-checkout").translateRaw,a=ek(),u=(0,V.ZP)(),c=eg(i),s=c.handleEmailChange,f=c.handleLoginSuccess,p=c.registerOptions;return(0,n.tZ)(G,{title:l("good-chop-checkout.account.title"),isActive:t,isComplete:r,isLocked:o,sectionId:"signup",summary:(0,n.tZ)(el,{}),children:(0,n.tZ)(X.default,{maxWidth:"100%",removeFormTitle:!0,publicId:u,appliedVoucherCode:a,onEmailChange:s,handleLoginSuccess:f,registerOptions:p})})},address:function(e){var t,r,i,l,a,u,c,s,f,p,y,h,m,b,g,O,S,k,x,P,A,C,Z,D,I,E,_,T,M,L,B=e.isActive,U=e.isComplete,F=e.isLocked,V=e.onComplete,X=e.onEdit,K=(0,d.ZP)("good-chop-checkout").translateRaw,q=v().showError,W=e$((0,j.KO)(N),2),H=W[0],Y=W[1],z=(r=(0,j.Dv)(R),i=(0,j.Dv)(N),l=(0,eC.J)({},{suspense:!1}).data,a=(0,ey.T)(),u=null!==(t=null==r?void 0:r.customerId)&&void 0!==t?t:null,c=(0,eA.h)().mutateAsync,s=(0,eA.h)().mutateAsync,{saveAddresses:(f=function(){var e,t,r,n,o,d;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(f){switch(f.label){case 0:if(!u)return a.startSpan("good-chop.checkout.save-addresses-skipped").setAttributes({reason:"missing-customer-id"}).setStatus({code:eh.Z.ERROR}).end(),[2,null];e=a.startSpan("good-chop-checkout.save-addresses",{attributes:{"checkout.customerId":u}}),t=null==l?void 0:l.items,r=i.address,f.label=1;case 1:return f.trys.push([1,4,,5]),[4,c(ej({fields:r,customerId:u,isBilling:!1,regions:t}))];case 2:return n=f.sent().id,[4,s(ej({fields:r,customerId:u,isBilling:!0,regions:t}))];case 3:return o=f.sent().id,e.setAttributes({"checkout.shippingId":n,"checkout.billingId":o}).setStatus({code:eh.Z.OK}).end(),[2,{shippingId:n,billingId:o}];case 4:var p;throw d=f.sent(),e.setAttributes({"error.message":(null!=(p=Error)&&"undefined"!=typeof Symbol&&p[Symbol.hasInstance]?!!p[Symbol.hasInstance](d):d instanceof p)?d.message:""}).setStatus({code:eh.Z.ERROR}).end(),d;case 5:return[2]}})},p=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=f.apply(e,t);
1function i(e){eZ(o,r,n,i,l,"next",e)}function l(e){eZ(o,r,n,i,l,"throw",e)}i(void 0)})},function(){return p.apply(this,arguments)})}).saveAddresses;eW();var J=!H.address.address1,$=e$((0,o.useState)(!1),2),Q=$[0],ee=$[1],et=e$((0,o.useState)(!1),2),er=et[0],eo=et[1],ei=e$((0,o.useState)(!1),2),el=ei[0],ea=ei[1],eu=en().trackAddressContinue,ec=(y=H.address.postcode,h=K("good-chop-checkout.delivery-address.undeliverable-postcode"),k=eM(),x=(0,ey.T)(),P=(0,o.useRef)(""),A=(null==k?void 0:null===(g=k.items)||void 0===g?void 0:null===(b=g[0])||void 0===b?void 0:null===(m=b.metadata)||void 0===m?void 0:m.productFamily)||"",C=(null==k?void 0:k.getSku())||"",Z=5===y.length&&!!(A||C),I=(D=(0,eD.Sj)({postcode:y,family:A,product:C,customerJourney:"checkout"},{enabled:Z,suspense:!1})).data,E=D.isFetching,_=D.isError,T=Z&&!E&&!_&&!!(null==I?void 0:null===(O=I.items)||void 0===O?void 0:O.length),((0,o.useEffect)(function(){Z&&!E&&P.current!==y&&(P.current=y,x.startSpan("good-chop-checkout.address-deliverability-check",{attributes:{"checkout.postcode":y,"checkout.isDeliverable":T,"checkout.hasError":_}}).setStatus({code:_?eh.Z.ERROR:eh.Z.OK}).end())},[Z,E,y,T,_,x]),Z)?E?{postcodeStatus:"progress",postcodeMessage:void 0,isDeliverable:!1}:!_&&(null==I?void 0:null===(S=I.items)||void 0===S?void 0:S.length)?{postcodeStatus:"valid",postcodeMessage:void 0,isDeliverable:!0}:{postcodeStatus:"error",postcodeMessage:h,isDeliverable:!1}:{postcodeStatus:5===y.length?"progress":"neutral",postcodeMessage:void 0,isDeliverable:!1}),es=ec.postcodeStatus,ed=ec.postcodeMessage,ef=ec.isDeliverable,ep=H.address.postcode.length<5||"progress"===es||!ef,ev=(M=function(){var e,t,r;return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(n){switch(n.label){case 0:if(eu(),ee(!0),H.isSubmitted)return V(),[2];eo(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,z()];case 2:if(!(e=n.sent()))return[2];return t=e.shippingId,r=e.billingId,Y(function(e){return eJ(ez({},e),{shippingId:t,billingId:r,isSubmitted:!0})}),V(),[3,5];case 3:return n.sent(),q(K("good-chop-checkout.delivery-address.save-error"),{duration:1e4}),[3,5];case 4:return eo(!1),ee(!1),[7];case 5:return[2]}})},L=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=M.apply(e,t);function i(e){eH(o,r,n,i,l,"next",e)}function l(e){eH(o,r,n,i,l,"throw",e)}i(void 0)})},function(){return L.apply(this,arguments)});return(0,n.BX)(G,{title:K("good-chop-checkout.delivery-address.title"),isActive:B,isComplete:U,isLocked:F,sectionId:"address",summary:(0,n.tZ)(eU,{onEdit:X}),children:[(0,n.tZ)(eB,{}),(0,n.tZ)(e0,{children:(0,n.tZ)(eP.Z,{formId:"goc-address-form",initialValues:new Map(Object.entries(H.address).filter(function(e){return e$(e,2)[1]})),onValueChanged:function(e,t){Y(function(r){var n=t!==r.address[e];return ez(eJ(ez({},r),{address:eJ(ez({},r.address),eY({},e,t))}),r.isSubmitted&&n?{isSubmitted:!1}:{})})},onSubmit:function(e){return e.preventDefault()},postcodeStatus:[es,ed],triggerFormValidation:Q,hideDeliveryInstructions:!0,isOneLineAddress:J,isPhoneOnTop:!0})}),(0,n.tZ)(eN,{isChecked:el,onChange:ea}),B&&(0,n.tZ)(w.xu,{marginTop:"global.sm-2",children:(0,n.tZ)(w.zx.Primary,{onClick:ev,disabled:ep,loading:er,width:"100%","data-test-id":"address-step-continue-button",children:K("good-chop-checkout.continue-cta")})})]})},delivery:function(e){var t,r,i,l,a,u,c,s,f,p,y,h,v,m,b,g,O,S,k=e.isActive,x=e.isComplete,P=e.isLocked,A=e.onComplete,C=e.onEdit,Z=(0,d.ZP)("good-chop-checkout").translateRaw,D=(0,ey.T)(),I=(0,o.useRef)(!1),E=tA((0,j.KO)(N),1)[0],_=tA((0,j.KO)(B),2),T=_[0],M=_[1],R=eM(),L=null!==(y=null==R?void 0:null===(i=R.items)||void 0===i?void 0:null===(r=i[0])||void 0===r?void 0:null===(t=r.metadata)||void 0===t?void 0:t.productFamily)&&void 0!==y?y:"",U=null!==(h=null==R?void 0:R.getSku())&&void 0!==h?h:"",F=(0,eD.Sj)({postcode:E.address.postcode,family:L,product:U,customerJourney:"checkout"},{enabled:!!E.address.postcode&&!!(L||U),suspense:!1}),V=F.isLoading,X=F.data,K=null!==(v=null==X?void 0:X.items)&&void 0!==v?v:[],q=(null!==(m=null==X?void 0:null===(l=X.items)||void 0===l?void 0:l.length)&&void 0!==m?m:0)>0,W=null!==(b=null==X?void 0:X.dos_id)&&void 0!==b?b:"";(0,o.useEffect)(function(){V||I.current||(I.current=!0,D.startSpan("good-chop-checkout.delivery-init",{attributes:{"checkout.postcode":E.address.postcode,"checkout.isDeliverable":q,"checkout.deliveryOptionsCount":K.length}}).setStatus({code:q?eh.Z.OK:eh.Z.ERROR}).end())},[V,q,K.length,E.address.postcode,D]),tt(K,T,M);var H=en().trackDeliveryContinue,Y=tS(T,M,null!==(g=E.shippingId)&&void 0!==g?g:"",A,H),z=Y.handleContinue,J=Y.isSaving,$=Y.deliveryInstructionsRef;return(0,n.BX)(G,{title:Z("good-chop-checkout.delivery-date.title"),isActive:k,isComplete:x,isLocked:P,summary:(0,n.tZ)(te,{onEdit:C}),sectionId:"delivery",shouldFocusSection:!0,children:[(0,n.tZ)(e8,{isLoading:V,postcode:E.address.postcode,selectedDeliveryHandle:T.deliveryTime,selectedDeliveryDate:T.firstDelivery,deliveryOptionsByDate:K,isDeliverable:q,dosId:W,defaultDeliveryDate:null!==(O=null===(c=K[0])||void 0===c?void 0:null===(u=c.deliveryOptions)||void 0===u?void 0:null===(a=u[0])||void 0===a?void 0:a.deliveryDate)&&void 0!==O?O:"",defaultDeliveryTime:null!==(S=null===(p=K[0])||void 0===p?void 0:null===(f=p.deliveryOptions)||void 0===f?void 0:null===(s=f[0])||void 0===s?void 0:s.handle)&&void 0!==S?S:"",deliveryInstructionsRef:$,onChooseDeliveryOption:function(e){var t,r,n=e.dayDate,o=e.deliveryOptionHandle,i=K.find(function(e){var t;return(null===(t=e.deliveryDate)||void 0===t?void 0:t.deliveryDate)===n}),l=null==i?void 0:null===(t=i.deliveryOptions)||void 0===t?void 0:t.find(function(e){return e.handle===o}),a=null!==(r=null==l?void 0:l.deliveryDay)&&void 0!==r?r:T.firstDeliveryDay;M(function(e){var t,r=e.deliveryTime!==o||e.firstDelivery!==n;return tx(tP(tx({},e),{deliveryTime:o,firstDelivery:n,firstDeliveryDay:a,cutoffDate:null!==(t=null==l?void 0:l.cutoffDate)&&void 0!==t?t:null}),e.isSubmitted&&r?{isSubmitted:!1}:{})})},onChooseDeliveryInstructions:function(e){M(function(t){return tx(tP(tx({},t),{deliveryInstruction:e}),t.isSubmitted&&t.deliveryInstruction!==e?{isSubmitted:!1}:{})})},onChooseCustomDeliveryInstructions:function(e){M(function(t){return tx(tP(tx({},t),{deliveryInstructionCustom:e}),t.isSubmitted&&t.deliveryInstructionCustom!==e?{isSubmitted:!1}:{})})}}
1),k&&(0,n.tZ)(w.xu,{marginTop:"global.sm-2",children:(0,n.tZ)(w.zx.Primary,{onClick:z,loading:J,disabled:J,width:"100%","data-test-id":"delivery-step-continue-button",children:Z("good-chop-checkout.continue-cta")})})]})},payment:function(e){var t,r=e.isActive,i=e.isComplete,l=e.isLocked,a=(0,d.ZP)("good-chop-checkout").translateRaw,u=(0,j.Dv)(N).address,c=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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return r4(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 r4(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.")}(),s=c[0],f=c[1],p=(0,o.useRef)(null),y=en().trackPaymentContinue,h=t8(),v=h.isConsentChecked,m=h.showConsentError,b=h.handleConsentChange,g=h.validateConsent,O=t1(),S=O.isPopupOpen,k=O.shouldTriggerPopup,x=O.addons,P=O.handlePopupConfirm,A=O.rejectSelection,C=O.closePopup,Z=O.selectedAddOnIndex,D=O.triggerPopup,I=r8(),E=I.placeOrder,_=I.isLoading,T=I.isSuccess,M=I.error,R=rg(),L=R.traceOrderSubmit,B=R.traceClientError,U=R.tracePlaceOrderSuccess,F=R.tracePlaceOrderError;rx(T,U),rP(M,F);var V=rA(g,k,D,p),X=(0,o.useCallback)(function(){y(),V()},[y,V]),K=t3(B),q=(0,o.useCallback)(function(e){L(e.paymentMethodValue),K(e)||E(e)},[E,K,L]),W=(0,o.useCallback)(function(e){f(e.isValid)},[f]),H=rO();return r6(r),(0,n.BX)(n.HY,{children:[(0,n.BX)(G,{title:a("good-chop-checkout.payment.title"),isActive:r,isComplete:i,isLocked:l,sectionId:"payment",children:[(0,n.tZ)(tT,{}),(0,n.tZ)("div",{"data-test-id":"payment-form-container",children:(0,n.tZ)("div",{"data-test-id":"public-payment-methods",children:(0,n.tZ)(tC.Z,{ref:p,personalData:{firstName:u.firstName,lastName:u.lastName},onSubmit:q,onValidityChange:W,shouldPreSelect:!0,scenario:"checkout",workflow:"checkout",applePayAmount:H,chargeAtCheckout:!0})})}),(0,n.tZ)(tH,{isChecked:v,showError:m,onChange:b}),(0,n.tZ)(w.zx.Primary,{"data-test-id":"payment-step-place-order-button",disabled:!s,loading:_,onClick:X,children:a("good-chop-checkout.payment.place-order-cta")})]}),(0,n.tZ)(rR,{isOpen:S,addons:x,selectedAddOnIndex:Z,onConfirm:P,onReject:A,onClose:C})]})}},r5=function(e){var t=e.steps,r=e.getStepContract;return(0,n.tZ)(w.xu,{backgroundColor:"global.white",boxShadow:"global.sm",padding:["global.sm-2","global.md-2"],display:"flex",flexDirection:"column",gap:"global.md-3",children:t.map(function(e,t){var o=r3[e.id];return(0,n.tZ)(l.Z,{scope:"checkout-step-".concat(e.id),children:(0,n.tZ)(o,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}({},r(t)))},e.id)})})},r9=r(43011);function ne(e,t,r){return e&&t&&r?3:e&&t?2:e?1:0}var nt=r(743267),nr=r(346629);function nn(){return(0,o.useRef)(!!(0,nt.fB)((0,nr.Xx)())).current}function no(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 ni=["signup","address","delivery","payment"];function nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var na=function(){var e=(0,ey.T)(),t=(0,o.useRef)(null);return(0,o.useEffect)(function(){return t.current=e.startSpan("good-chop-checkout.session",{attributes:{"checkout.source":"good-chop"}}),function(){var e;null===(e=t.current)||void 0===e||e.setStatus({code:eh.Z.OK}).end(),t.current=null}},[]),{recordStepComplete:function(e,r){var n,o;null===(n=t.current)||void 0===n||n.setAttributes((nl(o={},"checkout.step.".concat(e,".completed"),!0),nl(o,"checkout.curs
1or",r),o))}}};function nu(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 nc(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nu(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 nu(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 ns=function(e){var t,r,i,l,a,u,c,d,f,p,y,h,v,m,b,g,O,w,S,k,x,P,A,C,Z=e.steps,D=e.setSessionExpired,I=(0,s.e)(),E=nc((0,j.KO)(R),2),F=E[0],V=E[1],X=nc((0,j.KO)(N),2),K=X[0],q=X[1],W=nc((0,j.KO)(B),2),G=W[0],H=W[1],Y=nc((0,j.KO)(U),2),z=Y[0],J=Y[1],$=(t=(0,r9.Z)(),r=nn(),i=(0,es.W)({},{enabled:t&&null===F,suspense:!1}).data,(0,o.useEffect)(function(){var e;(null==i?void 0:i.id)&&null===F&&V({customerId:String(i.id),email:null!==(e=i.email)&&void 0!==e?e:""})},[i,F,V]),{isResolving:r&&null===F&&!(null==i?void 0:i.id),isComplete:null!==F||!!(null==i?void 0:i.id)}),Q=$.isResolving,ee=$.isComplete,et=I&&ee,er=!!I&&!0===K.isSubmitted,en=!!I&&!0===G.isSubmitted,eo=nc((l=I&&!Q,c=(u=function(e){if(Array.isArray(e))return e}(a=(0,o.useState)(0))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(a,2)||function(e,t){if(e){if("string"==typeof e)return no(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 no(e,2)}}(a,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.")}())[0],d=u[1],f=(0,o.useRef)(!1),(0,o.useEffect)(function(){l&&!f.current&&(f.current=!0,d(ne(et,er,en)))},[l]),[c,d]),2),ei=eo[0],el=eo[1];p=(0,r9.Z)(),y=(0,es.W)({},{enabled:p&&null!==F,suspense:!1}).data,(0,o.useEffect)(function(){if((null==y?void 0:y.id)&&null!==F&&String(y.id)!==F.customerId){try{tl.ZP.removeItem(T),tl.ZP.removeItem(M)}catch(e){}V(null),q(_),H(L),el(1)}},[y,F,V,q,H,el]),h=void 0===D?function(){}:D,v=(0,r9.Z)(),m=(0,o.useRef)(null),b=(0,o.useRef)(!0),g=nn(),(O=(0,o.useRef)(h)).current=h,(w=(0,o.useRef)(z)).current=z,(S=(0,o.useRef)(J)).current=J,(k=(0,o.useRef)(q)).current=q,(0,o.useEffect)(function(){if(b.current){b.current=!1,m.current=g,g||(V(null),el(0));return}var e=m.current;m.current=v;var t=!v&&!0===e,r=v&&!1===e,n=function(){V(null),el(0)};t?(n(),w.current?S.current(!1):O.current(!0)):v?r&&(k.current(function(e){var t,r;return 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}({},e),r=r={shippingId:null,billingId:null,isSubmitted:!1},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}
1)(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}),O.current(!1),el(ne(!0,!1,!1))):n()},[v]),x=K.address.postcode,P=(0,o.useRef)(!0),(0,o.useEffect)(function(){if(P.current){P.current=!1;return}en&&H({deliveryTime:"",firstDelivery:"",firstDeliveryDay:0,cutoffDate:null,deliveryInstruction:"",deliveryInstructionCustom:null,isSubmitted:!1})},[x]);var ea=na().recordStepComplete,eu=(A=(0,ey.T)(),C={0:et,1:er,2:en,3:!1},(0,o.useCallback)(function(e){var t;return{isActive:e===ei,isComplete:null!==(t=C[e])&&void 0!==t&&t,isLocked:e>ei,onComplete:function(){var t,r=null!==(t=ni[e])&&void 0!==t?t:"step-".concat(e);A.startSpan("good-chop-checkout.step-complete",{attributes:{"checkout.step":r,"checkout.stepIndex":e}}).setStatus({code:eh.Z.OK}).end(),ea(r,e),el(e+1)},onEdit:function(){el(e)}}},[ei,et,er,en,ea]));return(0,n.tZ)(r5,{steps:Z,getStepContract:eu})},nd=r(340674),nf=r(883579),np=["recipes.nutrition","recipes.cuisines"],ny=function(){var e=eM(),t=null==e?void 0:e.getSku(),r=(0,tn.k)().code,n=(0,tX.hp)(),i=n.withSeamlessCutSelection,l=n.isReady,a=tW(),u=a.planSku,c=a.checkoutSku,s=null!=u?u:t,d=(0,nd.L)(),f=d.products,p=d.trialBoxProduct,y=d.isLoading,h=p&&s===p.handle?p:f.find(function(e){return e.handle===s}),v=(0,rp.Z)(),m=(0,rf.rS)({weeks:v,product:(null==h?void 0:h.family)||"",exclude:np},{enabled:!!(null==h?void 0:h.family)}),b=m.data,g=m.isLoading,O=ry(),w=rd({sku:null!=c?c:void 0,voucherCode:r,menuData:b,selectedIndexes:O}),S=w.pricing,k=w.isLoading,x=(0,o.useMemo)(function(){if(0===O.length||!(null==b?void 0:null===(l=b.items)||void 0===l?void 0:null===(i=l[0])||void 0===i?void 0:i.courses))return[];var e=b.items[0].courses,t=new Map,r=!0,n=!1,o=void 0;try{for(var i,l,a,u=O[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value;t.set(c,(t.get(c)||0)+1)}}catch(e){n=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(n)throw o}}var s=[];return t.forEach(function(t,r){var n,o,i,l=e.find(function(e){return e.index===r});(null==l?void 0:null===(n=l.recipe)||void 0===n?void 0:n.name)&&s.push({index:r,name:l.recipe.name,quantity:t,premiumPrice:null!==(i=null==S?void 0:null===(o=S.premiumPricesByIndex)||void 0===o?void 0:o[r])&&void 0!==i?i:""})}),s},[b,S,O]),P=(0,nf.V)(),A=P.items,C=P.isLoading;return{pricing:S,product:h,sku:s,cutSelections:x,welcomeGifts:A,hasWelcomeKit:P.hasWelcomeKit,voucherCode:r,isLoading:!s||!h||y||k||g||C,withSeamlessCutSelection:i&&l}};function nh(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 nv=function(e){var t,r=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(e))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return nh(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 nh(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.")}(),n=r[0],i=r[1];return{isOpen:n,toggle:(0,o.useCallback)(function(){i(function(e){return!e})},[])}},nm=function(){var e=(0,j.Dv)(B),t=(0,tn.k)(),r=(0,to.l)({voucherCode:t.code}),n=tg().savePCSWithAddon,i=t$().setSelectedAddOnIndex,l=(0,o.useRef)("");(0,o.useEffect)(function(){if("ready"===r.status&&1===r.addons.length&&e.firstDelivery){var o,a=r.addons[0],u="".concat(null!==(o=t.code)&&void 0!==o?o:"",":").concat(a.index);l.current!==u&&(l.current=u,i(a.index),n(a.index,r.addons))}},[r,e.firstDelivery,t.code,i,n])};function nb(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){r(e);return}a.done?t(u):Promise.resolve(u).then(n,o)}
1var ng=(0,w.q)(w.xu),nO=function(e){var t,r,o=e.width,i=e.height,l=(0,w.q_)({from:{opacity:.33},to:(t=function(e){return function(e,t){var r,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw TypeError("Generator is already executing.");for(;l;)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 l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}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,a])}}}(this,function(t){switch(t.label){case 0:return[4,e({opacity:.8})];case 1:return t.sent(),[4,e({opacity:.33})];case 2:return t.sent(),[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function l(e){nb(i,n,o,l,a,"next",e)}function a(e){nb(i,n,o,l,a,"throw",e)}l(void 0)})},function(e){return r.apply(this,arguments)}),config:{duration:1e3,easing:w.Gk.linear},loop:!0});return(0,n.tZ)(ng,{height:void 0===i?"20px":i,width:void 0===o?"100%":o,backgroundColor:"global.gray.300",borderRadius:"global.sm",style:l})},nw=function(){return x().isDesktop?(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",gap:"global.sm-1",p:"global.md-1","data-test-id":"order-summary-skeleton","aria-label":"Loading order summary",role:"status",children:[(0,n.tZ)(nO,{height:"16px",width:"30%"}),(0,n.tZ)(nO,{height:"58px"}),(0,n.tZ)(nO,{height:"26px"}),(0,n.tZ)(nO,{height:"26px",width:"40%"})]}):(0,n.tZ)(w.xu,{p:"global.sm-2","data-test-id":"order-summary-skeleton","aria-label":"Loading order summary",role:"status",children:(0,n.tZ)(nO,{height:"16px",width:"40%"})})},nS=r(405065),nk=r(574207);function nx(){var e,t,r=(e=["\n  & [data-test-id='promo-code-form-voucher-textbox'] {\n    border-width: 1px !important;\n    border-color: "," !important;\n  }\n\n  & label {\n    color: "," !important;\n    font-weight: "," !important;\n  }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return nx=function(){return r},r}var nP=(0,ex.ZP)(w.xu).withConfig({componentId:"sc-ebefb2d6-0"})(nx(),function(e){return e.theme.colors.neutral[500]},function(e){return e.theme.colors.neutral[800]},function(e){return e.theme.fontWeights["body-regular"]}),nA=function(e){var t=e.children,r=(0,w.Fg)();return(0,n.tZ)(nP,{"data-test-id":"order-summary-promo-code",theme:r,children:t})};function nC(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 nZ(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nC(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 nC(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 nj=function(){try{return ew().get(eS.fZ)||""}catch(e){return""}},nD=function(){var e=nj(),t=nZ((0,o.useState)(""),2),r=t[0],n=t[1],i=nZ((0,o.useState)(0),2),l=i[0],a=i[1];
1return(0,nk.d)({voucherCode:r,submissionId:l}),{storedCoupon:e,onVoucherSubmit:(0,o.useCallback)(function(e){e&&(n(e),a(function(e){return e+1}))},[])}},nI=function(){},nE=function(e){var t=e.sku,r=e.pricing,o=nD(),i=o.storedCoupon,l=o.onVoucherSubmit;return t&&r?(0,n.tZ)(nA,{children:(0,n.tZ)(nS.ZP,{variant:nS.SU.FIXED,promoCode:i,boxPrice:0,productSku:t,onVoucherInvalid:nI,onVoucherSubmit:l,simpleSuccessMessage:!0})}):null},n_=r(274886),nT=r(523201);function nM(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 nR=function(e){var t,r=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)(e))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return nM(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 nM(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.")}(),n=r[0],i=r[1];return{isOpen:n,handleToggle:function(){i(function(e){return!e})},handleToggleKeyDown:function(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i(function(e){return!e}))}}},nN=function(e){var t=e.title,r=e.summary,o=e.children,i=e.defaultOpen,l=nR(void 0!==i&&i),a=l.isOpen,u=l.handleToggle,c=l.handleToggleKeyDown;return(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",children:[(0,n.BX)(w.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",role:"button",tabIndex:0,"aria-expanded":a,onClick:u,onKeyDown:c,cursor:"pointer",children:[(0,n.tZ)(w.xv,{type:"body-md-bold",children:t}),(0,n.tZ)(w.xu,{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",children:a?(0,n.tZ)(w.JO,{icon:(0,n.tZ)(nT.Z,{}),color:"global.goodchop-navy.600"}):(0,n.tZ)(w.JO,{icon:(0,n.tZ)(n_.Z,{}),color:"global.goodchop-navy.600"})})]}),"function"==typeof r?r(a):r,a&&o]})},nL={3:"trial-box",6:"medium",12:"large",18:"extra-large"},nB=function(e,t){var r=nL[e];return r?t("good-chop-checkout.order-summary.plan-label.".concat(r)):""},nU=function(e,t){var r=(0,d.ZP)("good-chop-checkout").translateRaw,n=(0,rX.t)(),o=x().isDesktop,i="/plans",l="/first-box/".concat(e);return{translateRaw:r,isDesktop:o,plansPath:i,firstBoxPath:l,totalCuts:t.reduce(function(e,t){return e+t.quantity},0),handleKeyDownPlans:function(e){("Enter"===e.key||" "===e.key)&&n.push(i)},handleKeyDownFirstBox:function(e){("Enter"===e.key||" "===e.key)&&n.push(l)}}},nF=function(e){var t=e.children;return(0,n.tZ)(w.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",children:t})},nV=function(e){var t=e.product,r=e.sku,o=e.cutSelections,i=e.pricing,l=e.withSeamlessCutSelection,a=nU(r,o),u=a.translateRaw,c=a.isDesktop,s=a.plansPath,d=a.firstBoxPath,f=a.totalCuts,p=a.handleKeyDownPlans,y=a.handleKeyDownFirstBox;if(!t||!r)return null;var h=(0,n.BX)(w.xu,{display:"flex",alignItems:"center",gap:"global.xs",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",children:nB(t.meals,u)}),(0,n.tZ)(w.rU,{type:"body-sm-regular",color:"global.goodchop-navy.600",textDecoration:"underline",tabIndex:0,href:s,onKeyDown:p,children:u("good-chop-checkout.order-summary.plan.change")})]}),v=i&&(0,n.tZ)(w.xv,{type:"body-sm-regular","data-test-id":"order-summary-your-plan-price",color:i.isBoxFree?"global.cherry.600":"global.gray.800",children:i.isBoxFree?u("good-chop-checkout.order-summary.pricing.free"):i.boxFullPrice});return(0,n.BX)(w.xu,{"data-test-id":"order-summary-your-plan",children:[(0,n.tZ)(w.iz,{mx:"global.none"}),(0,n.tZ)(nN,{title:u("good-chop-checkout.order-summary.plan.title"),defaultOpen:c,summary:(0,n.tZ)(w.xu,{display:"flex",flexDirection:"column",gap:"global.xs",width:"100%","data-test-id":"order-summary-your-plan-summary",children:l?(0,n.BX)(n.HY,{children:[h,f>0&&(0,n.BX)(nF,{children:[(0,n.BX)(w.xv,{type:"body-sm-regular","data-test-id":"order-summary-cuts-count",children:[f," ",u("good-chop-checkout.order-summary.plan.cuts")]}),v]})]}):(0,n.BX)(nF,{children:[h,v]})}),children:(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",gap:"global.xs",paddingLeft:"global.sm-2",marginTop:"global.xs",children:[o.map(function(e){var t=e.index,r=e.name,o=e.quantity,i=e.premiumPrice;return(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",gap:"global.xs",children:[(0,n.BX)(w.xv,{type:"body-sm-regular",children:[o," x ",r]}),i&&(0,n.BX)(w.xv,{type:"body-sm-regular","data-test-id":"order-summary-premium-price",children:["+",i]})]},null!=t?t:r)}),(0,n.tZ)(w.rU,{type:"body-sm-regular",color:"global.goodchop-navy.600",textDecoration:"underline",tabIndex:0,href:d,onKeyDown:y,children:u("good-chop-checkout.order-summary.edit-selection")})]})}),(0,n.tZ)(w.iz,{mx:"global.none"})]})}
1,nX=r(295332),nK=r(384949),nq=function(){var e=(0,j.Dv)(B);if(null==e?void 0:e.firstDelivery)return(0,nX.Z)(e.firstDelivery,nK.He)||void 0},nW=function(e){var t=e.sku,r=(0,d.ZP)("good-chop-checkout").translateRaw,o=nq();if(!t||!(0,ra.MJ)(t))return null;var i=o?r("good-chop-checkout.order-summary.trial-box.delivery-info",{deliveryDate:o}):r("good-chop-checkout.order-summary.trial-box.shipping-info");return(0,n.tZ)(w.xu,{"data-test-id":"order-summary-trial-box-information",children:(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",gap:"global.xxs",paddingTop:"global.sm-2",children:[(0,n.tZ)(w.xv,{type:"body-sm-bold",color:"global.goodchop-navy.600","data-test-id":"order-summary-trial-box-information-title",children:r("good-chop-checkout.order-summary.trial-box.title")}),(0,n.tZ)(w.xu,{fontSize:"body-sm-regular",children:(0,n.tZ)(eR.Z,{hasMarkdown:!0,copy:i})}),(0,n.tZ)(w.xu,{fontSize:"body-sm-regular",children:(0,n.tZ)(eR.Z,{hasMarkdown:!0,copy:r("good-chop-checkout.order-summary.trial-box.after-trial-info")})})]})})},nG=r(944822),nH=r(975519),nY=function(){try{var e=tl.ZP.getItem("persist-addon-selection-order");if(!e)return null;var t=JSON.parse(e);return"number"==typeof t?t:null}catch(e){return null}},nz=function(){var e,t,r,n,o,i=(0,tn.k)().code,l=(0,nH.i)(),a=(0,tR.nB)(),u=(0,j.Dv)(F),c=(0,nG.Z)({voucherCode:i||"",week:l||""});if("success"!==c.status||0===c.addons.length)return null;var s=void 0!==u?u:nY(),d=null;1===c.addons.length?d=c.addons[0]:null!=s&&(d=null!==(n=c.addons.find(function(e){return e.index===s}))&&void 0!==n?n:null);var f=null==d?void 0:null===(e=d.recipe)||void 0===e?void 0:e.name,p=null==d?void 0:null===(t=d.chargeSetting)||void 0===t?void 0:t.amount,y=null!==(o=null==d?void 0:null===(r=d.chargeSetting)||void 0===r?void 0:r.unit)&&void 0!==o?o:1;return f&&null!=p?{name:f,quantity:y,formattedPrice:a(Math.round(p),{decimals:2})}:null},nJ=function(e){var t=e.pricing,r=e.hasWelcomeKit,o=nz(),i=(0,d.ZP)("good-chop-checkout").translateRaw;if(!t)return null;var l=i("good-chop-checkout.order-summary.pricing.free"),a=t.serviceFee&&(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",children:i("good-chop-checkout.order-summary.pricing.service-fee")}),(0,n.tZ)(w.xv,{type:"body-sm-regular",children:t.serviceFee})]}),u=(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",children:i("good-chop-checkout.order-summary.pricing.standard-shipping")}),t.isShippingFree?(0,n.BX)(w.xu,{display:"flex",gap:"global.xs",alignItems:"center",children:[(0,n.tZ)(w.xv,{strikethrough:!0,type:"body-sm-regular",color:"global.gray.600","data-test-id":"order-summary-shipping-price-original",children:t.shippingPrice}),(0,n.tZ)(w.xv,{color:"global.cherry.600",type:"body-sm-regular",children:l})]}):(0,n.tZ)(w.xv,{type:"body-sm-regular",children:t.shippingPrice})]}),c=r&&(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:i("good-chop-checkout.order-summary.pricing.welcome-gift")}),(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:l})]}),s=o&&(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",children:[(0,n.BX)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:[o.quantity," x ",o.name]}),(0,n.BX)(w.xu,{display:"flex",gap:"global.xs",alignItems:"center",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",textDecoration:"line-through",color:"global.gray.600",children:o.formattedPrice}),(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:l})]})]}),f=t.hasDiscount&&(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:i("good-chop-checkout.order-summary.pricing.first-box-discount")}),(0,n.BX)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",children:["-",t.boxDiscountPrice]})]}),p=(0,n.BX)(w.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.tZ)(w.xv,{type:"body-md-bold",color:"global.gray.800",children:i("good-chop-checkout.order-summary.pricing.total")}),(0,n.BX)(w.xu,{display:"flex",gap:"global.xs",alignItems:"center",children:[t.hasDiscount&&(0,n.tZ)(w.xv,{type:"body-md-bold",textDecoration:"line-through",color:"global.gray.600",children:t.totalFullPrice}),(0,n.tZ)(w.xv,{type:"body-md-bold",color:"global.goodchop-navy.600",children:t.hasDiscount?t.totalDiscountedPrice:t.totalFullPrice})]})]});return(0,n.BX)(w.xu,{"data-test-id":"order-summary-pricing-breakdown",display:"flex",flexDirection:"column",gap:"global.xxs",children:[a,u,f,s,c,(0,n.tZ)(w.iz,{mx:"global.none"}),p]})},n$=r(759737),nQ=function(){var e=(0,d.ZP)("good-chop-checkout").translateRaw;return(0,n.BX)(w.xu,{marginTop:"global.sm-1",marginBottom:"global.sm-1",marginLeft:"global.sm-1",marginRight:"global.sm-1",padding:"global.sm-1",backgroundColor:"global.white",borderWidth:"global.sm",borderStyle:"solid",borderColor:"global.gray.400",borderRadius:"global.sm",display:"flex",gap:"global.xs",alignItems:"left",children:[(0,n.tZ)(w.xu,{flexShrink:0,children:(0,n.tZ)(n$.default,{title:"Info",color:"global.gray.600"})}),(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.gray.800",children:e("good-chop-checkout.order-summary.pricing.info-note")})]})}
1,n0=function(e){var t=e.welcomeGifts,r=e.hasWelcomeKit,o={translateRaw:(0,d.ZP)("good-chop-checkout").translateRaw,formatCurrency:(0,tR.nB)(),isDesktop:x().isDesktop},i=o.translateRaw,l=o.formatCurrency,a=o.isDesktop;return r&&t?(0,n.BX)(w.xu,{"data-test-id":"order-summary-welcome-gift",children:[(0,n.tZ)(nN,{title:i("good-chop-checkout.order-summary.welcome-gift.title"),defaultOpen:a,summary:function(e){return e?null:(0,n.BX)(w.xu,{display:"flex",alignItems:"center",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.gray.800",marginTop:"global.xxs",children:i("good-chop-checkout.order-summary.welcome-gift.subtitle")}),(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",marginLeft:"auto",children:i("good-chop-checkout.order-summary.pricing.free")})]})},children:(0,n.tZ)(w.xu,{display:"flex",flexDirection:"column",gap:"global.sm-2",marginTop:"global.xs","data-test-id":"order-summary-welcome-gift-list",children:t.map(function(e){return(0,n.BX)(w.xu,{display:"flex",alignItems:"center",gap:"global.sm-2",children:[(0,n.tZ)(w.xu,{flexShrink:0,children:(0,n.tZ)(rD.ZP,{src:(0,rZ.Z)(e.image),alt:e.title,width:60,height:60})}),(0,n.BX)(w.xu,{display:"flex",flexDirection:"column","data-test-id":"order-summary-welcome-gift-details",children:[(0,n.tZ)(w.xv,{type:"body-sm-bold",children:e.title}),(0,n.tZ)(w.xu,{display:"flex",gap:"global.xs",alignItems:"center",children:(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"neutral.500",children:e.description})})]}),(0,n.BX)(w.xu,{"data-test-id":"order-summary-welcome-gift-price",marginLeft:"auto",display:"flex",alignItems:"center",children:[(0,n.tZ)(w.xv,{type:"body-sm-regular",textDecoration:"line-through",color:"neutral.500",children:l(100*e.price,{decimals:2})}),(0,n.tZ)(w.xv,{type:"body-sm-regular",color:"global.cherry.600",marginLeft:"global.xxs",children:i("good-chop-checkout.order-summary.pricing.free")})]})]},e.title)})})}),(0,n.tZ)(w.iz,{mx:"global.none"})]}):null},n1=function(e){var t=e.data;return(0,n.BX)(w.xu,{display:"flex",flexDirection:"column",py:["global.sm-2","global.sm-2","global.none"],children:[(0,n.tZ)(nE,{sku:t.sku,pricing:t.pricing}),(0,n.tZ)(nW,{sku:t.sku}),(0,n.tZ)(nV,{product:t.product,sku:t.sku,cutSelections:t.cutSelections,pricing:t.pricing,withSeamlessCutSelection:t.withSeamlessCutSelection}),(0,n.tZ)(n0,{welcomeGifts:t.welcomeGifts,hasWelcomeKit:t.hasWelcomeKit}),(0,n.tZ)(nJ,{pricing:t.pricing,hasWelcomeKit:t.hasWelcomeKit}),t.withSeamlessCutSelection&&(0,n.tZ)(nQ,{})]})},n2=function(e){var t=e.fullPrice,r=e.discountedPrice,o=e.hasDiscount;return t?o?(0,n.BX)(w.xu,{display:"flex",gap:"global.xs",alignItems:"center","aria-label":"Original price ".concat(t,", discounted price ").concat(r),children:[(0,n.tZ)(w.xv,{type:"body-md-regular",textDecoration:"line-through",color:"global.gray.600",children:t}),(0,n.tZ)(w.xv,{type:"body-md-regular",color:"global.cherry.600",children:r})]}):(0,n.tZ)(w.xv,{type:"body-md-regular",children:t}):null},n7=function(){var e,t,r,o=x().isDesktop,i=ny(),l=nv(!1),a=l.isOpen,u=l.toggle;nm();var c=(0,d.ZP)("good-chop-checkout").translateRaw,s=en().trackSummaryEdit,f=c("good-chop-checkout.order-summary.title");return(0,n.tZ)(w.xu,{"data-test-id":"order-summary",backgroundColor:"global.white",boxShadow:"global.sm",__dangerouslySetCustomCSS:{'& [data-test-id="AccordionButton"]:hover':{backgroundColor:"transparent !important"}},children:i.isLoading?(0,n.tZ)(nw,{}):o?(0,n.BX)(w.xu,{p:"global.md-2",children:[(0,n.tZ)(w.xu,{marginBottom:"global.md-1",children:(0,n.tZ)(w.xv,{type:"body-lg-bold",children:f})}),(0,n.tZ)(n1,{data:i})]}):(0,n.BX)(w.UQ.Outline,{buttonPosition:"right",buttonStyle:"plain",isOpen:a,onClick:function(){s("orderSummary",a?"close":"open"),u()},children:[(0,n.tZ)(w.UQ.Title,{headlineDescription:a?void 0:(0,n.tZ)(n2,{fullPrice:null===(e=i.pricing)||void 0===e?void 0:e.totalFullPrice,discountedPrice:null===(t=i.pricing)||void 0===t?void 0:t.totalDiscountedPrice,hasDiscount:null===(r=i.pricing)||void 0===r?void 0:r.hasDiscount}),wideHeadlineDescription:!0,children:(0,n.tZ)(w.xv,{type:"body-md-bold",ml:["global.xs","global.sm-1"],children:f})}),(0,n.tZ)(w.UQ.Description,{paddingRight:"global.xs",paddingLeft:["global.sm-2","global.md-1"],paddingY:"global.none",children:(0,n.tZ)(n1,{data:i})})]})})},n8=function(e){var t,r=null==e?void 0:null===(t=e.shippingAddress)||void 0===t?void 0:t.phone;return r?r.slice(-1):""},n6=function(e){var t,r,n,o,i=e.subscriptions,l=String(e.customerBasicInfo.id),a=i.filter(function(e){return!e.canceledAt}),u=a.length>0,c=!u&&i.length>0?1:0,s=null!==(r=a[0])&&void 0!==r?r:i[0],d=u&&null!==(n=null==s?void 0:s.id)&&void 0!==n?n:"",f=a.filter(function(e){return e.isActive&&!e.isBlocked}).map(function(e){return e.product.sku}).join(","),p=u?f:"",y=u?"":i.map(function(e){return e.product.sku}).join(",");return{event:"customerUpdateEvent",id:l,activeSubscriptionId:d,hasActiveSubscriptions:u,hasInactiveSubscriptions:c,boxesReceived:0,plan:p,inactivePlan:y,instaVariant:"",activeSubscriptionSkus:p,freebiesNotSentCount:0,is_preset:!1,subscriptions:s?[{createdAt:s.createdAt||"",firstDeliveryDate:s.firstDeliveryDate||"",deliveryWeekday:String(null!==(o=s.deliveryWeekday)&&void 0!==o?o:""),paymentGateway:s.paymentGateway||"",paymentMethod:s.paymentMethod||"",paymentType:(null===(t=s.paymentToken)||void 0===t?void 0:t.type)||"",nextDeliveryDate:s.nextDelivery||"",nextCutoffDate:s.nextCutoffDate||"",couponCode:s.couponCode||"",voucherInfo:s.voucherInfo?{discount_type:s.voucherInfo.discount_type||"",discount_value:s.voucherInfo.discount_value||0}:""}]:[],subscriptionsCount:i.length,lastDigit:n8(s)}};function n4(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 n3=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return n4(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 n4(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.")}(),r=t[0],n=t[1],i=(0,Y.Z)().push,l=null!==(0,j.Dv)(R),a=(0,o.useRef)(!!(0,nt.fB)((0,nr.Xx)())).current,u=(0,es.W)({},{enabled:l,suspense:!1}).data,c=(0,rU.u)({},{enabled:l,suspense:!1}),s=c.isFetched,d=c.data;(0,o.useEffect)(function(){var e=null==d?void 0:d.items;l&&!a&&u&&s&&e&&!r&&(i(n6({subscriptions:e,customerBasicInfo:u})),n(!0))},[l,a,u,s,d,r,i])},n5=r(479922),n9=function(){var e=(0,n5.Z)();(0,o.useEffect)(function(){e.track("gc-one-page-checkout")},[])},oe=function(){(0,f.I)(),n3(),n9();var e=(0,s.e)(),t=O(m().variant),r=t.steps,i=t.navigationMode,l=(0,d.ZP)("good-chop-checkout").translateRaw,a=v(),u=a.showError,c=a.clearError,p=(0,o.useCallback)(function(e){e?u(l("good-chop-checkout.account.session-expired-banner")):c()},[u,c,l]),y=r.filter(function(e){return"/checkout"===e.route});return(0,n.tZ)(Z,{isLoading:!e,steps:(0,n.tZ)(ns,{steps:y,navigationMode:i,setSessionExpired:p}),orderSummary:(0,n.tZ)(n7,{})})},ot=r(953142);function or(e){var t=e.children,r=(0,ot.y)(),i=r.shouldUseCheckoutStatusEndpoint,l=r.checkoutRedirect,a=r.isCheckoutStatusFetched,u=null;return i&&a&&("reactivation"===l?u=em:"home"===l&&(u=ev)),(0,o.useEffect)(function(){u&&window.location.replace(u)},[u]),(0,n.tZ)(n.HY,{children:t})}function on(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 oo(e){var t,r=e.children,i=(0,rX.t)().replace,l=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=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(i.push(r.value),2!==i.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return on(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 on(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=l[0],u=l[1];return((0,o.useEffect)(function(){if(!function(){try{var e=tl.ZP.getItem("persist-selection-order"),t=e?JSON.parse(e):null;return Array.isArray(t)&&t.length>0}catch(e){return!1}}()){i({pathname:"/plans"});return}u(!0)},[i]),a)?(0,n.tZ)(n.HY,{children:r}):null}var oi=function(){return(0,n.BX)(l.Z,{scope:"goodchop-checkout-page",fallback:(0,n.tZ)(a.default,{}),children:[(0,n.tZ)(c.Z,{}),(0,n.tZ)(i.Z,{children:(0,n.tZ)(oo,{children:(0,n.tZ)(or,{children:(0,n.tZ)(oe,{})})})})]})},ol={name:"good-chop-growth",githubTeam:"hellofresh/good-chop-growth",tribe:"new-ventures",alliance:"consumer",jiraPrefix:"GOC",slackChannel:"#squad-nv-good-chop",slackAlertsChannel:"#good-chop-alerts",skipLabelsOnPR:!1,teamIdentifier:"good-chop-growth"};oi.customLayout=u.A5,oi.provideCustomLayoutProps=function(e){return{ssrPayload:e.ssrPayload,claim:ol,disableFooter:!0}};var oa=!0,ou=oi},845818:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(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 i(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}
1)(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,l=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,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),l),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M6 13h12v2H6v-2ZM17 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5v14h20V5H2Zm18 2H4v10h16V7Z",fill:"currentColor"})]}))}},759737:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(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 i(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}r(827378),t.default=function(e){var t=e.title,r=e.titleId,l=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,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),l),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm0-13.5A1.25 1.25 0 1 0 12 6a1.25 1.25 0 0 0 0 2.5ZM11 10v8h2v-8h-2Z",fill:"currentColor"})]}))}},867610:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(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 i(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}r(827378),t.default=function(e){var t=e.title,r=e.titleId,l=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,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),l),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M13.25 7.25a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM11 18v-8h2v8h-2Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",fill:"currentColor"})]}))}},978949:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(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 i(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}r(827378),t.default=function(e){var t=e.title,r=e.titleId,l=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,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),l),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 19.31V20H3v-.69c0-.73.16-1.452.468-2.114a9.01 9.01 0 0 0 .84-3.8v-2.791a9.01 9.01 0 0 0-.84-3.801A5.01 5.01 0 0 1 3 4.69V4h18v.69c0 .73-.16 1.452-.468 2.114a9.01 9.01 0 0 0-.84 3.8v2.791c0 1.314.286 2.61.84 3.801A5.01 5.01 0 0 1 21 19.31Zm.691-5.915a7.01 7.01 0 0 0 .655 2.958A7.01 7.01 0 0 1 23 19.31V22H1v-2.69c0-1.022.223-2.031.654-2.957a7.01 7.01 0 0 0 .655-2.958v-2.79a7.01 7.01 0 0 0-.655-2.958A7.01 7.01 0 0 1 1 4.69V2h22v2.69a7.01 7.01 0 0 1-.654 2.957 7.01 7.01 0 0 0-.655 2.958v2.79ZM11.25 15.811V18h1.5v-2.19l1.72 1.72 1.06-1.06-2.78-2.78v-.94h.94l2.78 2.78 1.06-1.06-1.72-1.72H18v-1.5h-2.19l1.72-1.72-1.06-1.06-2.78 2.78h-.94v-.94l2.78-2.78-1.06-1.06-1.72 1.72V6h-1.5v2.19L9.53 6.47 8.47 7.53l2.78 2.78v.94h-.94L7.53 8.47 6.47 9.53l1.72 1.72H6v1.5h2.19l-1.72 1.72 1.06 1.06 2.78-2.78h.94v.94l-2.78 2.78 1.06 1.06 1.72-1.72Z",fill:"currentColor"})]}))}},96553:function(){}},function(e){e.O(0,[47057,38579,12737,8139,14206,44355,61403,40889,85698,50134,18629,17827,3243,83030,32857,69190,64901,94924,70788,10196,63463,77498,95067,96334,69845,57252,36060,24400,14005,81989,75182,88130,37384,254,25925,26742,79882,92888,49774,40179],function(){return e(e.s=872657)}),_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.