1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5672],{82084:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_sites/[site]/processing-purchase",function(){return r(86751)}])},69858:function(e,t,r){"use strict";var n=r(85893);r(67294);var a=r(45697),u=r(95872);function s(e){let{className:t,children:r,onClick:a,...s}=e;return(0,n.jsx)(u.ZP,{onClick:a,text:"".concat(r),className:t,...s})}s.propTypes={className:a.string,onClick:a.func},t.Z=s},32680:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var n=r(67294),a=r(26628),u=r(11163),s=r(53218),i=r(19034),o=r(36512),c=r.n(o),l=r(57456),d=r(92990),f=r(63253),m=r(25381),_=r(53307),y=r(31955),h=r(82586),E=()=>{let e=(0,a.I0)(),{push:t,query:r,isReady:o}=(0,u.useRouter)(),E=y.Z.get(h.r.guestUserToken)||null,[p,C]=(0,n.useState)(y.Z.get(h.r.accessToken)||null),[O,P]=(0,n.useState)(!1),[T,N]=(0,n.useState)(!1),k=(0,n.useRef)(!1),R=(0,n.useRef)(null),S=(0,n.useRef)(null),g=o?r.magic_token:void 0,I=(0,n.useCallback)(e=>{if(!e)return!1;let t=d.LM[e],r=t&&!t.isOnline;return r},[]),L=(0,n.useCallback)(async e=>{try{let t=await m.Z.validateMagicToken(e);if(t.ok){let e=t.data.authorization;e&&(y.Z.set(h.r.accessToken,e,{path:"/"}),C(e),P(!0));return}throw Error("Error validando magic token")}catch(e){N(!0)}},[]);(0,n.useEffect)(()=>{o&&g&&L(g)},[o,g,L]),(0,n.useEffect)(()=>{if(!o)return;let{status:n}=r,a=c().getLastOrderOnlyPay(),u=n||a&&a.paymentStatus;if(u===l.R$.COMPLETED)setTimeout(()=>{e(f.ZP.clearModals()),t((0,s.ko)(s.IQ.PURCHASE_SUCCESS.path)),e(i.default.clearCart()),e(i.default.setFutureOrderDate(null)),c().removeFutureOrderDate(),c().setLastOrderOnlyPay(null)},5e3);else if(u===l.R$.UNKNOWN){let r=async()=>{try{if(a&&a.paymentMethod){let r=I(a.paymentMethod);r&&setTimeout(()=>{e(f.ZP.clearModals()),t((0,s.ko)(s.IQ.PURCHASE_SUCCESS.path)),e(i.default.clearCart()),e(i.default.setFutureOrderDate(null)),c().removeFutureOrderDate(),c().setLastOrderOnlyPay(null)},5e3)}}catch(r){setTimeout(()=>{e(f.ZP.clearModals()),t({pathname:(0,s.ko)(s.IQ.PURCHASE_FAILURE.path),query:{errorCode:"UNKNOWN_STATUS_CHECK_ERROR"}})},5e3)}};r()}else u===l.R$.FAILED&&setTimeout(()=>{e(f.ZP.clearModals()),t({pathname:(0,s.ko)(s.IQ.PURCHASE_FAILURE.path),query:{errorCode:r.errorCode||"PAYMENT_FAILED"}})},5e3)},[e,t,r,o,I]),(0,n.useEffect)(()=>{if(k.current)return;if(g&&T){k.current=!0,S.current=setTimeout(()=>{t({pathname:(0,s.ko)(s.IQ.PURCHASE_FAILURE.path),query:{errorCode:"MAGIC_TOKEN_INVALID"}})},2e3);return}let r=async()=>{if(g&&!O)return;if(g&&O&&p)try{let t=await _.Z.getLastOrder(p);if(t.ok&&t.data&&(c().setLastOrderOnlyPay(t.data),t.data.uuid)){k.current=!0,R.current=setTimeout(()=>{e(i.default.confirmPayment({orderId:t.data.uuid},!0))},2e3);return}}catch(e){}let r=c().getLastOrderOnlyPay();if(r){k.current=!0,R.current=setTimeout(()=>{e(i.default.confirmPayment({orderId:r.uuid},!0))},2e3);return}if(!g&&(E||p)){k.current=!0,R.current=setTimeout(()=>{e(i.default.confirmPayment({token:E||p},!0))},2e3);return}if(!g){var n;let e=c().getLastOrderOnlyPay(),r=e&&e.paymentStatus===l.R$.UNKNOWN&&(null===(n=d.LM[e.paymentMethod])||void 0===n?void 0:n.isOnline);if(r)return;k.current=!0,S.current=setTimeout(()=>{t({pathname:(0,s.ko)(s.IQ.PURCHASE_FAILURE.path),query:{errorCode:"NO_ORDER_TO_CONFIRM"}})},2e3)}};r()},[g,O,T,E,t,e,p]),(0,n.useEffect)(()=>()=>{R.current&&clearTimeout(R.current),S.current&&clearTimeout(S.current)},[])}},86751:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return m},default:function(){return _}});var n=r(85893);r(67294);var a=r(26982),u=r(4596),s=r(69858),i=r(48685),o=r.n(i),c=r(32680),l=()=>((0,c.Z)(),(0,n.jsx)("div",{className:"full-width full-height column middle center text-center",children:(0,n.jsxs)("div",{className:o().itemsContainer,children:[(0,n.jsx)(u.Z,{loop:!0,icon:"addedToCart",width:150,height:150}),(0,n.jsx)(s.Z,{className:"body-font text-brand-secondary text-uppercase m-bottom-3 ".concat(o().title),children:a.ZP.t("ProcessingPurchase:title")})]})})),d=r(31974);let f=()=>(0,n.jsx)(l,{});f.getLayout=function(e){return(0,n.jsx)(d.p,{children:e})};var m=!0,_=f},48685:function(e){e.exports={navbarHeight:"70px","items-container":"styles_items-container__sgytP",itemsContainer:"styles_items-container__sgytP",title:"styles_title__MUiTk"}}},function(e){e.O(0,[9306,5039,2237,1974,4596,9774,2888,179],function(){return e(e.s=82084)}),_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.