1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{36546:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment-frame",function(){return n(31145)}])},31145:function(e,a,n){"use strict";n.r(a),n.d(a,{PaymentFrame:function(){return v}});var t=n(52322),s=n(12524),r=n.n(s),i=n(44313),l=n(97729),d=n.n(l),c=n(45847),o=n.n(c),m=n(2784),_=n(36314),u=n(85998),y=n(52171);let v=()=>{let[e,a]=(0,m.useState)(!1),[n,s]=(0,m.useState)(),{isExpired:l}=(0,_.PK)(),{isLoading:c,order:v,amountToPay:f}=(0,_.Aj)(void 0,{revalidateOnFocus:!1}),p=(0,y.H4)();(0,m.useEffect)(()=>{var e,a;s(null===(a=window.__assertis)||void 0===a?void 0:null===(e=a.payment)||void 0===e?void 0:e.token)},[]);let h=(0,m.useCallback)(async()=>{var e,a;null===(a=window.__assertis)||void 0===a||null===(e=a.payment)||void 0===e||e.closePaymentFrame()},[]),x=(0,m.useCallback)(()=>{var e,a;null===(a=window.__assertis)||void 0===a||null===(e=a.payment)||void 0===e||e.handleBackToSleeperClick()},[]),[j,N]=(0,m.useState)(!1),w=(0,m.useRef)(),b=(0,m.useCallback)(()=>{w.current&&(w.current.destroy(),w.current=void 0)},[]),P=(0,i.OB)("NEXT_PUBLIC_PAYMENT_LIVE_STATUS");return((0,m.useEffect)(()=>{if(!l&&j&&n&&v&&!w.current){let e=window.SecureTrading({jwt:n,livestatus:"0"===P?0:1,disableNotification:"0"!==P,animatedCard:!1,submitOnSuccess:!1,submitOnError:!1,panIcon:!0,submitCallback:e=>{let n="0"===e.errorcode;if(n){var t,s;return null===(s=window.__assertis)||void 0===s?void 0:null===(t=s.payment)||void 0===t?void 0:t.handlePaymentDone(e.jwt)}let r="";try{r=JSON.stringify(e.errordata)}catch(a){r=e.errordata}console.error("Payment error. ".concat(e.errormessage,": ").concat(r)),a(!n)}});w.current=e,w.current.on("paymentStarted",async()=>{let e=new Date;await p(null==v?void 0:v.totalPrice,e,y.is.CARD_PAYMENT_PAY_SUBMIT)}),w.current.Components()}},[b,j,p,a,n,v,l,P]),(0,m.useEffect)(()=>{l&&b()},[b,l]),l)?(0,t.jsx)(u.xI,{onClose:x}):e?(0,t.jsx)(u.yS,{onClose:h}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d(),{children:(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n html,body {\n background: #fff;\n overflow: hidden;\n }\n "}})}),(c||!v)&&(0,t.jsx)("div",{className:"row",children:(0,t.jsx)("div",{className:"col-12 centered",children:(0,t.jsx)("div",{className:"loader",children:(0,t.jsx)("h1",{className:"loader__title",children:"Loading Payment"})})})}),!c&&v&&(0,t.jsxs)("div",{className:"payment__head",children:[(0,t.jsx)("h1",{className:"payment__title",children:"Credit or Debit card details"}),(0,t.jsxs)("a",{href:"https://www.trustpayments.com/",target:"__blank",rel:"external",className:"payment__logo",children:["Payments powered by ",(0,t.jsx)("span",{className:"sr-only",children:"Trust Payments"})]})]}),(0,t.jsxs)("div",{className:r()("payment__wrap",{"payment__wrap--loading":c||!v}),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{id:"st-notification-frame"}),(0,t.jsxs)("form",{className:"payment__form",id:"st-form",children:[(0,t.jsxs)("div",{className:"payment__box",children:[(0,t.jsx)("div",{className:"payment__field",id:"st-card-number"}),(0,t.jsx)("div",{className:"payment__field",id:"st-expiration-date"}),(0,t.jsx)("div",{className:"payment__field",id:"st-security-code"})]}),(0,t.jsx)("div",{className:"payment__info",children:(0,t.jsx)("button",{className:"btn btn--primary payment__button",type:"submit",children:"Pay"})})]})]}),v&&(0,t.jsxs)("div",{className:"payment__total",children:["total:"," ",(0,t.jsx)("span",{children:(0,t.jsx)(u.tA,{valuePence:f})})]}),!w.current&&(0,t.jsx)(o(),{src:(0,i.OB)("NEXT_PUBLIC_PAYMENT_LIB_SRC"),strategy:"afterInteractive",onLoad:()=>{N(!0)}})]})]})};a.default=v}},function(e){e.O(0,[888,774,179],function(){return e(e.s=36546)}),_N_E=e.O()}]); 2//# sourceMappingURL=payment-frame-a0e3d29d3fdc94f6.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.