"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2182],{55065:function(e,t,r){r.d(t,{G:function(){return a}});var n,a=((n={}).HOME_PAGE="HOMEPAGE",n.LANDING="LANDING",n.SEARCH="SEARCH",n.PRODUCT="PRODUCT",n.ACCOUNT="ACCOUNT",n.BASKET="BASKET",n.PRODUCT_LIST="PRODUCT_LIST",n.STORE_LOCATOR="STORE_LOCATOR",n.PERSONALISE="PERSONALISE_YOUR_BOX",n)},22182:function(e,t,r){r.d(t,{F:function(){return G}});var n,a,i,o=r(82269),u=r(8529),s=r(7328),c=r(95235),l=r(2784),p=r(5632),m=r(1761),d=r(11006),g=r(48840),f=r(81292),v=r(57209),_=r(67971),h=r(93421),w=r(55065),y=r(73153),b=r(63601),C=r(96412),O=r(13089),P=r(80304),E=r(29017),T=r(48200),k=r(70314),S=r.n(k),N=r(96965),R=r(52322),L=(0,N.Z)().captureExceptionComponentLevel,D=function(e){(0,P.Z)(n,e);var t,r=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,T.Z)(n);return e=t?Reflect.construct(r,arguments,(0,T.Z)(this).constructor):r.apply(this,arguments),(0,E.Z)(this,e)});function n(e){var t;return(0,C.Z)(this,n),(t=r.call(this,e)).state={error:null},t}return(0,O.Z)(n,[{key:"componentDidCatch",value:function(e,t){var r=S()().publicRuntimeConfig,n=this.context,a=n.logger,i=n.brand,o=n.subsite;r.IS_PRODUCTION&&L(e,i,o),a.error(e.message,{stack:t.componentStack}),this.setState({error:e})}},{key:"render",value:function(){return this.state.error?(0,R.jsx)("h1",{"data-testid":"error-message",children:"An error occured"}):this.props.children}}]),n}(l.Component);(0,c.Z)(D,"contextType",h.L);var x=["responsiveMargin","enableMaxWidth","children"];function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A(e){for(var t=1;t0&&(null===(e=window.performance.getEntriesByType("navigation")[0])||void 0===e?void 0:e.loadEventStart)!==0?d(!0):window.addEventListener("load",t),function(){window.removeEventListener("load",t)}},[]),l.useEffect(function(){var i=r.requestConfig.enableBrowserPageVisits&&e.sendPageVisit;!(window.performance.getEntriesByName("pageChangeStart").length>0)&&c&&!g.current&&i&&null!==f&&(r.updateHistory(),t({type:"page_visit",payload:n({basket:a,requestData:{start_timestamp:window.performance.timeOrigin,url:window.location.href,duration_ms:window.performance.getEntriesByType("navigation")[0].duration},eventData:{type:r.pageType&&Z[r.pageType]?Z[r.pageType]:"page_visit"}})}),g.current=!0)},[c,e.sendPageVisit,r.requestConfig.enableBrowserPageVisits,f]);var C=e.responsiveMargin,O=e.enableMaxWidth,P=e.children,E=(0,o.Z)(e,x);return(0,R.jsx)(D,{children:(0,R.jsx)(B,A(A({},E),{},{responsiveMargin:void 0!==C&&C,className:e.className,enableMaxWidth:void 0===O||O,children:P}))})}},1761:function(e,t,r){r.d(t,{V:function(){return h}});var n=r(8529),a=r(2784),i=r(88767),o=r(41857),u=r(28160),s=r(93421),c=r(73716),l=r(63601),p=r(11669),m=function(e,t){for(var r="".concat(e,"="),n=decodeURIComponent(t).split(";"),a=0;a=2?y.current[y.current.length-2]:document.referrer,D=C(),x={cart:r.basket?(n=r.basket,a=S.currency,{id:null,items:n.items.map(function(e){var t,r;return{quantity:e.quantity,product_group:{id:Number(null===(t=e.product.product)||void 0===t?void 0:t.sku),selected_variant:{price:{currency:a,value:Number(e.standardPricePerUnit.amount)},sku:Number(e.product.sku)},total_variants:Number(null===(r=e.product.product)||void 0===r?void 0:r.variants.length)}}}),total_price:{currency:a,value:Number(n.standardPrice.amount)},total_size:n.totalQuantity}):null,insert_id:(0,i.Z)(),nonce:h,event:{type:(o=r.eventData).type,subtype:o.subtype||null,items:o.items||null},request:{start_timestamp:(u=r.requestData).start_timestamp,url:u.url,duration_ms:Math.round(u.duration_ms)},property:_({defaultLocale:P,subsite:E,siteId:T,channel:k,customerLocation:"unknown"===m.customerLocation?null:m.customerLocation}),device:{cookies_consent_shown:d(e,m.customerLocation)},origin:v({urlParams:R,referrer:L}),experiments:(0,f.p)(r.experiments||(null==D?void 0:D.experiments)),ray_ids:null!==(l=r.rays)&&void 0!==l?l:[],customer:{login_state:(s=null!==(w=null==D?void 0:D.flags)&&void 0!==w?w:[]).includes("LOGGED_IN")?p.pC.LOGGED_IN:s.includes("RECOGNISED")?p.pC.RECOGNISED:p.pC.NOT_RECOGRNISED,receive_newsletter:(null===(O=r.customerData)||void 0===O?void 0:O.receive_newsletter)!==void 0?null===(N=r.customerData)||void 0===N?void 0:N.receive_newsletter:(null==b?void 0:b.emailMarketingPreference)||!1}};return"number"!=typeof x.request.duration_ms&&t.debug("Invalid device object - duration_ms should be of type number.",{url:x.request.url}),"page_visit"===r.eventData.type||(x.errors=g(r.errors,r.eventData)),x}}}}]);