1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9269],{94236:function(e,r,n){"use strict";n.r(r),n.d(r,{__N_SSP:function(){return h},default:function(){return E}});var t=n(56690),o=n(67294),i=n(11163),s=n(84588),a=n(54321),d=n(9255),u=n(17116),c=n(26237);const l=()=>{const e=(0,i.useRouter)(),{t:r}=(0,t.$G)("",{keyPrefix:"$common.$successPage"}),{t:n}=(0,t.$G)("",{keyPrefix:"$common"});return o.createElement("div",{className:"checkout-error"},o.createElement("div",{className:"checkout-error__content"},o.createElement("h1",null,r("orderDetailsUnavailableHeading")),o.createElement("div",{dangerouslySetInnerHTML:{__html:r("orderDetailsUnavailableContent")}}),o.createElement("div",{className:"button-group vertical-max-768"},o.createElement("button",{type:"button",className:"btn btn-plain",onClick:()=>{e.push(c.k)}},n("$buttons.backToCheckout")),o.createElement("button",{type:"button",className:"btn btn-primary",onClick:()=>{e.push(c.H)}},n("$buttons.backToHome")))))},m=e=>{"undefined"!==typeof window&&window.dataLayer&&window.dataLayer.push(e)},g={successViewLoaded:(e,r)=>m({event:"success_view_loaded",order_id:e,is_guest:r,timestamp:(new Date).toISOString()}),missingParams:e=>m({event:"missing_params",missing_params:e,timestamp:(new Date).toISOString()}),guestTokenInvalid:e=>m({event:"guest_token_invalid",order_id:e,timestamp:(new Date).toISOString()}),paymentDeniedRendered:e=>m({event:"payment_denied_rendered",order_id:e,timestamp:(new Date).toISOString()}),orderFetchError:(e,r)=>m({event:"order_fetch_error",order_id:e,error_message:r instanceof Error?r.message:String(r),error_type:r instanceof Error?r.constructor.name:typeof r,timestamp:(new Date).toISOString()})};var y=n(84759),v=n(52599),_=n(11210),P=n(75968),p=n(18064);var f=(0,a.w)((()=>{const{query:e,push:r,isReady:n}=(0,i.useRouter)(),{apolloConfig:t}=(0,o.useContext)(s._),[a,c]=(0,o.useState)({isLoading:!0,order:null,error:null,isPaymentDenied:!1,isPaymentPending:!1}),m=r=>{const n=e[r];return Array.isArray(n)?n[0]:n},f=(0,d.$8)(),k=m("orderIncrementId"),w=m("checkout_token"),h=m("error"),E=m("payment_status"),b=m("statusOutput.statusCode")||m("statusCode")||m("status"),L="4"===b||"CAPTURE_REQUESTED"===b,C="pending"===E,D=m("orderId")||m("order_id"),S=m("token")||m("guest_token"),I=k||D,T=w||S,N=Boolean(I&&(f||T));return(0,o.useEffect)((()=>{if(n){if(N)return"paymentdenied"===h?(g.paymentDeniedRendered(I),void c({isLoading:!1,order:null,error:null,isPaymentDenied:!0,isPaymentPending:!1})):I?f||T?void(async()=>{var e,n,o;try{let o;if(f){const{data:e,errors:r}=await(0,v.a)(t(),{query:y.a,variables:{orderNumber:I}},"GetOrder");if(null===r||void 0===r?void 0:r.length)throw new Error(r[0].message);const[n]=e.customer.orders.items;o=n}else{const{data:e,errors:r}=await(0,v.p)(t(),{query:y.G,variables:{orderId:I,token:T}},"GetGuestOrderByToken");if(null===r||void 0===r?void 0:r.length)throw new Error(r[0].message);o=e.checkOrderWithToken}if(!o)throw new Error("Order not found");const i=(null==o.status?"":String(o.status)).toLowerCase(),s=i===_.iF.Pending.toLowerCase()||["pending_payment","en attente","pendiente","ausstehend"].includes(i);if(i===_.iF.Canceled.toLowerCase())return void r("/checkout/failure");const a=null===(n=null===(e=null===o||void 0===o?void 0:o.payment_methods)||void 0===e?void 0:e[0])||void 0===n?void 0:n.type,d=a===p.P.BankTransfer||a===p.P.BankTransferDirect;if(C||s||i===_.iF.Processing.toLowerCase()&&L&&d)return g.successViewLoaded(I,!f),void c({isLoading:!1,order:o,error:null,isPaymentDenied:!1,isPaymentPending:!0});g.successViewLoaded(I,!f),c({isLoading:!1,order:o,error:null,isPaymentDenied:!1,isPaymentPending:!1})}catch(i){null===(o=g.orderFetchError)||void 0===o||o.call(g,I,i);const e=i instanceof Error?i.message:"Failed to fetch order data";if((e.toLowerCase().includes("expired")||e.toLowerCase().includes("invalid")||e.toLowerCase().includes("token"))&&!f)return g.guestTokenInvalid(I),void r("/checkout/thank-you");c({isLoading:!1,order:null,error:e,isPaymentDenied:!1,isPaymentPending:!1})}})():(g.guestTokenInvalid(I),void c({isLoading:!1,order:null,error:"Guest order requires token parameter",isPaymentDenied:!1,isPaymentPending:!1})):(g.missingParams(["orderIncrementId"]),void c({isLoading:!1,order:null,error:"Missing required parameter: orderIncrementId",isPaymentDenied:!1,isPaymentPending:!1}));c((e=>({...e,isLoading:!1,error:"Missing required parameters for checkout success",isPaymentPending:!1})))}}
1),[I,T,h,f,N,C,L,n]),a.isLoading?o.createElement(P.Z,null):a.isPaymentDenied||a.error?o.createElement(l,null):a.order?o.createElement(u.S,{order:a.order,isProcessing:!1,isPaymentPending:a.isPaymentPending}):o.createElement(l,null)}),{translation:!0,snackbar:!0}),k=n(42269),w=n(85893),h=!0,E=function(e){var r=e.error,n=(0,t.$G)("",{keyPrefix:""}).t,o={title:n("$common.$labels.orderConfirm"),description:n("$common.$labels.orderConfirm")};return(0,w.jsx)(k.N,{error:r,meta:o,children:(0,w.jsx)(f,{})})}},98841:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/success",function(){return n(94236)}])}},function(e){e.O(0,[1350,7116,4759,9774,2888,179],(function(){return r=98841,e(e.s=r);var r}));var r=e.O();_N_E=r}]); 2//# sourceMappingURL=success-9148064995d1bccb.js.map
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.