PageSourceSearch

https://www.theograce.co.uk/_next/static/chunks/pages/[context]/checkout/return/[page]-8ee1d2c72888b697.js

js theograce.co.uk collected 2026-10-08 03:35:20 UTC 9,242 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1554,1995,4591,5931],{1445:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__N_SSP:()=>k,default:()=>M});var r=i(37876),n=i(77328),o=i.n(n),a=i(14232),s=i(46320),p=i(6936),d=i(12632),l=i(619),h=i(88771),c=i(26635),u=i(89345),g=i(63082),S=i(77927),f=i(39529),y=i(16578),m=i(99968),v=i(18923),x=i.n(v);let E=()=>{let{t:e}=(0,h.B)("checkout"),{data:t}=(0,c.Ay)(e=>e),i=(0,u.Ay)(e=>e.paymentSession),n=(0,u.Ay)(e=>e.payPhase),v=(0,u.Ay)(e=>e.payError),E=(0,a.useRef)(!1),k=(0,a.useRef)(!1),[M,F]=(0,a.useState)(!1);(0,S.A)(),(0,a.useEffect)(()=>{E.current||(E.current=!0,(0,m.CC)(),(0,m.uP)("Returned from the payment provider"),Promise.resolve(u.Ay.persist.rehydrate()).then(()=>F(!0)))},[]),(0,a.useEffect)(()=>{if(!k.current&&M){if(k.current=!0,!i)return void(0,y.cK)(t);(0,f.Q4)(i.clientToken).catch(e=>(0,m.uP)("Could not reopen the payment session",e instanceof Error?e.message:void 0,"warn")).then(()=>(0,y.cK)(t))}},[M,i,t]);let I=M&&!i&&"idle"===n,w="failed"===n&&!!v&&u.kc.includes(v),T="takingLong"===n;return(0,r.jsxs)(s.A,{id:"checkoutReturn",children:[(0,r.jsx)(o(),{children:(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,r.jsxs)("div",{className:x().checkoutReturn,children:[(0,r.jsx)(p.A,{variant:"headline4",tag:"h1",children:e(((e,t,i)=>e?"return.sessionLostTitle":"confirmedNoRedirect"===t?"return.confirmedTitle":"failed"===t?i?"return.failedTitle":"return.unconfirmedTitle":"return.title")(I,n,w))}),I?(0,r.jsx)(p.A,{variant:"text1",tag:"p",children:e("return.sessionLost")}):(0,r.jsxs)(r.Fragment,{children:["failed"!==n&&"confirmedNoRedirect"!==n&&!T&&(0,r.jsx)(l.A,{}),(0,r.jsx)(g.A,{outcomeHeadingAbove:!0})]}),T&&(0,r.jsx)(d.A,{variant:"secondary",isLink:!0,href:"/ordertracking.aspx",children:e("return.trackOrder")}),(I||w)&&(0,r.jsx)(d.A,{variant:I?"secondary":"a2c",isLink:!0,href:"/checkout",children:e("return.backToCheckout")})]})]})};var k=!0;let M=()=>(0,r.jsx)(E,{})},10967:(e,t,i)=>{"use strict";i.d(t,{D:()=>r,H:()=>n});let r={weekday:"short",month:"short",day:"2-digit"},n=(e,t)=>{if(!t||0===t.length)return e;let i=new Set(t),r=e.filter(e=>null==e.id||!i.has(e.id));return 0===r.length?e:r}},18923:e=>{e.exports={checkoutReturn:"checkoutReturnPage_checkoutReturn__qGfug"}},20678:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>d,Yq:()=>s,tX:()=>p});var r=i(37876),n=i(14232),o=i(26635);let a={month:"short",day:"numeric"},s=(e,t,i)=>{if(!e)return"";try{let r=new globalThis.Date(e);if(isNaN(r.getTime()))return console.warn("Invalid date string provided: ".concat(e)),e;return new Intl.DateTimeFormat(t,i).format(r)}catch(t){return console.warn("Error formatting date ".concat(e,":"),t),e}},p=(e,t,i,r)=>{let n=s(e,i,r),o=s(t,i,r);if(e&&t&&n&&o){let i=new globalThis.Date(e);new globalThis.Date(t)<i&&console.warn("Date range warning: end (".concat(t,") is before start (").concat(e,")"))}let a=n&&o?" - ":"";return"".concat(n).concat(a).concat(o).trim()},d=e=>{let{date:t,dateStart:i,dateEnd:d,formatOptions:l=a,separator:h=" - ",className:c}=e,{data:u}=(0,o.Ay)(e=>e.locale),g=(0,n.useMemo)(()=>t?s(t,u,l):i||d?i&&d?p(i,d,u,l):s(i||d||"",u,l):"",[t,i,d,u,l,h]);return(0,r.jsx)("span",{className:c,children:g})}},56394:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[context]/checkout/return/[page]",function(){return i(1445)}])},90511:(e,t,i)=>{"use strict";i.d(t,{A:()=>g});var r=i(8106),n=i(4319);let o=e=>{var t;return{externalId:e.externalId,id:e.id,name:e.name,position:e.position,isDefault:e.isDefault,isGuaranteed:e.isGuaranteed,etaDisplayType:e.etaDisplayType,etaStart:e.etaStart,etaEnd:e.etaEnd,cost:null!=(t=e.sellingPrice)?t:e.cost,shippingCost:e.shippingCost,ribbon:e.ribbon,content:e.content.map(e=>{var t;return{externalId:e.externalId,position:e.position,snippetType:e.snippetType,value:e.value,textColor:null!=(t=e.textColor)?t:null,backgroundColor:null}})}},a=e=>({...e,shippingMethods:e.shippingMethods.map(o)});var s=i(75582),p=i(56964),d=i(58799),l=i(10967),h=i(20678),c=i(91298);let u=(0,r.v)()((0,n.eh)((0,n.lt)((e,t)=>({siteData:null,shippingCountry:null,shippingMethodsData:null,shippingMethodsFetchLoading:!1,shippingMethodsFetchError:!1,selectedMethodId:null,
1shippingProvidersLogos:[],isShippingInitialized:!1,experimentConfig:{},currentProductSku:null,initializeShipping:(t,i,r)=>{e({siteData:t,shippingCountry:i,experimentConfig:r,isShippingInitialized:!0},!1,"Initialize Shipping")},selectShippingMethod:async function(i){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{selectedMethodId:n}=t(),{externalId:o}=i;if(r||o!==n)try{e({selectedMethodId:o,shippingMethodsFetchLoading:!0},!1,"Select Shipping Method -> Optimistic Update");let{siteData:r}=t();if(!r)throw Error("Site data and shipping country are required for select shipping method");if((0,c.S)(r))await s.A.getState().postToCartClientAPI("applyShippingMethod",{selectedSdmExternalId:o});else{let{country:e,currency:t}=r,n=(0,d.JK)(e),{cost:a,etaStart:p,etaEnd:c,etaDisplayType:u,content:g}=i,S=(0,d.vv)(a,{locale:n,currency:t}),f=(0,h.tX)(p,c,n,l.D),y=g.sort((e,t)=>e.position-t.position).reduce((e,t)=>(t.value&&e.push(t.value),"ShippingTitle"===t.snippetType&&e.push(S),"EtaLine"===t.snippetType&&e.push(f),e),[]).join(" ");await s.A.getState().postToCartClientLegacyAPI("/shipping/set",{SelectedShippingTypeExternalId:o,ShippingDescription:y,etaStart:p,etaEnd:c,etaDisplayType:u})}}catch(t){e({selectedMethodId:null,shippingMethodsFetchError:!0},!1,"Select Shipping Method -> Error")}finally{e({shippingMethodsFetchLoading:!1},!1,"Select Shipping Method -> End")}},fetchshippingMethodsData:async(i,r)=>{try{let{siteData:n,shippingCountry:o}=t();if(!n||!o)throw Error("Site data and shipping country are required for fetch shipping methods data");e({shippingMethodsFetchLoading:!0,shippingMethodsFetchError:!1},!1,"Fetch Shipping Methods Data -> Start");let s=(0,d.JK)(n.country),h=await (0,p.LO)({siteData:n,pathname:"api/carts/v1/shippings/get",body:{productsSkus:i,orderTotal:r,shippingTo:"uk"===o?"gb":o,locale:s,withExplanation:!0}});if(h.error||200!==h.statusCode)throw Error("Failed to fetch shipping methods");let c=a(h);e({shippingMethodsData:c},!1,"Fetch Shipping Methods Data -> Success");let{selectedMethodId:u,selectShippingMethod:g,experimentConfig:S}=t(),{excludeIds:f,defaultId:y}=S,m=(0,l.H)(c.shippingMethods,f);if(u&&m.some(e=>e.externalId===u)){let e=m.find(e=>e.externalId===u);e&&g(e,!0)}else{let e=(null!=y?m.find(e=>e.id===y):void 0)||m.find(e=>e.isDefault)||m[0];e&&g(e)}}catch(t){e({shippingMethodsFetchError:!0},!1,"Fetch Shipping Methods Data -> Error"),console.error("Error fetching shipping methods",t)}finally{e({shippingMethodsFetchLoading:!1},!1,"Fetch Shipping Methods Data -> End")}},hydrateShippingFromCart:(i,r)=>{var n,o;let{experimentConfig:a}=t(),s=(0,l.H)(i.shippingMethods,a.excludeIds),p=!!r&&s.some(e=>e.externalId===r),d=(null!=a.defaultId?s.find(e=>e.id===a.defaultId):void 0)||s.find(e=>e.isDefault)||s[0];e({shippingMethodsData:i,shippingProvidersLogos:null!=(n=i.shippingLogos)?n:[],selectedMethodId:p?r:null!=(o=null==d?void 0:d.externalId)?o:null,shippingMethodsFetchError:!1},!1,"Hydrate Shipping From Cart (SCS)")},productShippingData:null,productShippingFetchLoading:!1,productShippingFetchError:!1,fetchProductShipping:async i=>{let r=t();if(r.productShippingFetchLoading&&r.currentProductSku===i)return r.productShippingData;try{var n;e({productShippingData:null,productShippingFetchLoading:!0,productShippingFetchError:!1,currentProductSku:i},!1,"Fetch Product Shipping -> Start");let{siteData:r,shippingCountry:o}=t();if(!r||!o)throw Error("Site data and shipping country are required for fetch product shipping");let l=(0,d.JK)(r.country),h=(null==(n=s.A.getState().orderSummary)?void 0:n.subtotal)||0,c=await (0,p.LO)({siteData:r,pathname:"api/carts/v1/shippings/get",body:{productsSkus:[i],orderTotal:h,shippingTo:"uk"===o?"gb":o,locale:l,withExplanation:!0}});if(c.error||200!==c.statusCode)throw Error("Failed to fetch product shipping");let u=a(c);return e({productShippingData:u,currentProductSku:i},!1,"Fetch Product Shipping -> Success"),u}catch(t){return console.error("Error fetching product shipping",t),e({productShippingFetchError:!0},!1,"Fetch Product Shipping -> Error"),null}finally{e({productShippingFetchLoading:!1},!1,"Fetch Product Shipping -> End")}}}),{name:"Shipping Store"})));s.A.subscribe(e=>{var t;return{totalItems:e.totalItems,cartSubtotal:(null==(t=e.orderSummary)?void 0:t.subtotal)||0,skus:e.items.flatMap(e=>{var t,i;return[e.sku,...null!=(i=null==(t=e.pips)?void 0:t.map(e=>e.sku))?i:[]]}),externalSelectedShippingTypeId:e.externalSelectedShippingTypeId||null}},e=>{let{isShippingInitialized:t,fetchshippingMethodsData:i}=u.getState();if(!t)return;let{skus:r,cartSubtotal:n,externalSelectedShippingTypeId:o}=e;u.setState({selectedMethodId:o},!1,"Selected Method from Cart"),r.length<1||0===n||i(r,n)},{equalityFn:(e,t)=>{let i=e.skus.length===t.skus.length,r=t.skus.every((t,i)=>t===e.skus[i]),n=e.cartSubtotal===t.cartSubtotal,o=e.externalSelectedShippingTypeId===t.externalSelectedShippingTypeId;return i&&r&&n&&o}});let g=u}},e=>{e.O(0,[5352,6361,2709,8230,9012,9209,217,942,9069,3743,6306,636,6593,8792],()=>e(e.s=56394)),_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.