1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5816],{16810:(e,r,a)=>{"use strict";a.d(r,{WI:()=>f,pr:()=>p});var t=a(37876),o=a(62506),n=a(29171),s=a(13664),l=a(27058),i=a(70111),c=a(61154),u=a(11557),d=a(14232);let p="__ccavenue-data__",f=e=>{let{components:r}=(0,s.j)(),{locale:a}=(0,n.U)(),f=(0,l.k)().query,{isPaymentMethodEnabled:m}=(0,i.l)({params:f,avoidConfigChecks:!0,paymentMethod:c.g5.CCAvenue,previousPage:e.previousPage,hideTimeout:!0});return(0,d.useEffect)(()=>{if(!m)return;let r={previousPage:e.previousPage||"/",fallbackUrl:f.fallbackURL||e.previousPage||"/",redirectToURL:f.redirectToURL,paymentRef:f.paymentRef};sessionStorage.setItem(p,JSON.stringify(r));let[t,o]=u.o9.tenantAndSite,n="/payments/api/".concat(t,"/").concat(o,"/v1/ccavenue/entrypoint"),s=new URL(u.o9.beBaseUrl+n);s.searchParams.append("paymentRef",f.paymentRef),s.searchParams.append("locale",a),s.searchParams.append("portal",u.o9.portal),window.location.replace(s)},[m]),(0,t.jsx)(o.U,{show:!0,loader:(0,t.jsx)(r.Loader,{show:!0})})}},29518:(e,r,a)=>{"use strict";a.r(r),a.d(r,{__N_SSP:()=>k,default:()=>R});var t=a(37876),o=a(11557),n=a(43536),s=a(67113),l=a(81521),i=a(14605),c=a(15531);class u extends l.G{async captureOrder(e){try{let r=await s.A.paymentApi.ccAvenueCaptureOrder(...o.o9.tenantAndSite,e);if(r.status!==i.A.OK)throw new n.hD(r.status);return{saleAk:r.data.cypherSaleAk,outcome:(0,c.Zj)(r.data.outcome)}}catch(e){var r,a,t,l;if(e instanceof n.hD)throw e;throw new n.hD(null!=(l=null==(r=e.response)?void 0:r.status)?l:500,(0,c.Ae)(null==(t=e.response)||null==(a=t.data)?void 0:a.code),void 0,e.message)}}}let d=new u;var p=a(62506),f=a(13664),m=a(34736),v=a(27058),h=a(70111),y=a(61154),g=a(13057);a(10318),a(30667);var P=a(14232),w=a(16810);let U="CC AVENUE - ";var k=!0;let R=e=>{let{components:r}=(0,f.j)(),a=(0,v.k)(),{locale:o}=(0,m.M1)(),n=(0,P.useMemo)(()=>{let e=sessionStorage.getItem(w.pr);return e?JSON.parse(e):null},[]),{isPaymentMethodEnabled:s}=(0,h.l)({avoidConfigChecks:!0,avoidParamChecks:!0,paymentMethod:y.g5.CCAvenue,previousPage:null==n?void 0:n.previousPage,hideTimeout:!0,doAdditionalChecks:()=>e.encResp&&e.orderNo?(null==n?void 0:n.previousPage)&&(null==n?void 0:n.fallbackUrl)&&(null==n?void 0:n.redirectToURL)?void 0:(console.error(U+"Missing stored info"),!0):(console.error(U+"Missing required info: parameters"),!0)});return(0,P.useEffect)(()=>{s&&r();async function r(){try{let r=await d.captureOrder({encResult:e.encResp,orderId:e.orderNo,locale:o});if(r.outcome!==g.t.Success)return void a.goToPaymentErrorPage({paymentRef:n.paymentRef,fallbackUrl:n.fallbackUrl,outcome:r.outcome});let t=n.redirectToURL;sessionStorage.removeItem(w.pr),a.goToPage(t,{query:{paymentRef:n.paymentRef},asUrlWithoutParams:!0,replace:!0})}catch(e){console.error("Error occured during capture: ",e),a.goToPaymentErrorPage({paymentRef:n.paymentRef,fallbackUrl:n.fallbackUrl,outcome:g.t.GenericError})}}}
1,[s]),(0,t.jsx)(p.U,{show:!0,loader:(0,t.jsx)(r.Loader,{show:!0})})}},70111:(e,r,a)=>{"use strict";a.d(r,{l:()=>v});var t=a(32516),o=a(59096),n=a(33392),s=a(14232),l=a(42135),i=a(29171),c=a(13664),u=a(92345),d=a(61154),p=a(79444),f=a(95597),m=a(27058);let v=e=>{let{paymentMethod:r,params:a,previousPage:v,avoidConfigChecks:h,avoidParamChecks:y,configs:g,doAdditionalChecks:P,hideTimeout:w}=e,{behaviour:U}=(0,c.j)(),{loggedUser:k}=(0,i.U)(),{goHome:R}=(0,m.k)(),{setCustomPage:C,getMetaPaymentPageByUrl:_}=(0,u.t)(),{clear:A}=(0,o.F)(),T=(0,s.useMemo)(()=>"".concat(r," PAYMENT - "),[r]),{value:E,setTrue:b}=(0,l.Cg)(!1);return(0,n.S)(()=>{if(!h&&!g||(0,f.fU)({behaviour:U,loggedUser:k,paymentMethod:r})){console.error(T+"Missing required configs"),R({replace:!0});return}if(!y&&(!a||!(0,f.oc)(a,v))){console.error(T+"Missing required info"),R({replace:!0});return}if(null==P?void 0:P())return void R({replace:!0});let e=v?new URL(v).pathname:"/",t=_(e);t&&(e=t),(0,p.yy)(500).then(()=>{C(e,{hideCart:!0,hideTimeout:w||!1}),b()})}),{isPaymentMethodEnabled:E,handleBrowserBack:(0,s.useCallback)((e,r,a)=>{U.checkout.paymentErrorHandlingMode===d.PI.ClearCartAndGoToFirstPage&&A(),t.w.abortOrder(e,r,a).catch(p.Zi)},[U,A])}}},73988:(e,r,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/payments/ccavenue/result",function(){return a(29518)}])},95597:(e,r,a)=>{"use strict";function t(e){var r,a;let{behaviour:t,loggedUser:o,paymentMethod:n}=e,s=null==(a=null==o||null==(r=o.loadCreditPaymentMethods)?void 0:r.includes(n))||a;return!t||!t.paymentMethodsList.includes(n)&&!s}function o(e,r){return r&&(null==e?void 0:e.paymentRef)&&(null==e?void 0:e.saleAk)&&(null==e?void 0:e.redirectToURL)}function n(e){let r=e instanceof URL?e:new URL(e);return{pathName:r.pathname,query:Array.from(r.searchParams.entries()).reduce((e,r)=>({...e,[r[0]]:r[1]}),{})}}a.d(r,{bG:()=>n,fU:()=>t,oc:()=>o})}},e=>{e.O(0,[1436,3830,636,6593,8792],()=>e(e.s=73988)),_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.