1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7749],{4072:function(e,n,t){"use strict";var r=t(67294),a=t(30381),i=t.n(a),o=t(42851),c=t(85893);n.Z=function(e){var n=e.date,t=e.format,a=(0,o.Sv)();"da-DK"===a&&i().updateLocale("da",{monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"]}),"nb-NO"===a&&i().updateLocale("nb",{monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"]});var s=(0,r.useMemo)(function(){return i()(n).format(t)},[n,a,t]);return(0,c.jsx)(c.Fragment,{children:s})}},1424:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ex}});var r,a,i,o,c,s,l,d,u,m,v,h,p,x,g,y,f,j,b=t(50029),_=t(71383),Z=t(65344),w=t(27361),N=t.n(w),P=t(87794),S=t.n(P),C=t(67294),I=t(19395),D=t(45570),O=t(27861),A=t(77440),k=t(41664),M=t.n(k),T=t(15708),R=t(93612),W=t(42851),G=t(93967),E=t.n(G),H=t(33170),q=t(4072),B=t(32474),L=t(86092),F=t(1683),J=t(46920),K=t.n(J),z=t(85893);function InvoiceSummary(e){var n=e.invoice,t=(0,W.Sv)();if(!n)return null;var r=n.created,s=n.dueDate,l=n.dueAmount,d=n.invoiceNumber,u=(0,B.ZP)(l,{precision:2});return(0,z.jsxs)(F.Z,{align:"center",fill:!0,className:E()(K().container,K().invoiceOveriew),children:[(0,z.jsxs)("div",{children:[(0,z.jsx)(H.Z,{variant:"body2",uppercase:!0,children:(0,I.t)(a||(a=(0,_.Z)(["Invoice number"])))}),(0,z.jsx)(H.Z,{variant:"kicker",children:(0,z.jsxs)(L.Z,{href:"/api/Invoices/".concat(d,"/pdf/").concat(t),target:"_blank",rel:"noopener noreferrer",children:["#",d]})})]}),(0,z.jsxs)("div",{children:[(0,z.jsx)(H.Z,{variant:"body2",uppercase:!0,children:(0,I.t)(i||(i=(0,_.Z)(["Invoice date"])))}),(0,z.jsx)(H.Z,{variant:"body1",fontWeight:"bold",children:(0,z.jsx)(q.Z,{date:r,format:"ll"})})]}),(0,z.jsxs)("div",{children:[(0,z.jsx)(H.Z,{variant:"body2",uppercase:!0,children:(0,I.t)(o||(o=(0,_.Z)(["Due date"])))}),(0,z.jsx)(H.Z,{variant:"body1",fontWeight:"bold",children:(0,z.jsx)(q.Z,{date:s,format:"ll"})})]}),(0,z.jsxs)("div",{className:K().totalAmountContainer,children:[(0,z.jsx)(H.Z,{variant:"body2",textAlign:"right",uppercase:!0,children:(0,I.t)(c||(c=(0,_.Z)(["Total due"])))}),(0,z.jsx)(H.Z,{component:"p",variant:"kicker",textAlign:"right",fontWeight:"bold",children:u})]})]})}var Q=t(59499),V=t(81763),X=t.n(V),Y=t(27812),U=t(53857),$=t(55152),ee=t(19664),en=t.n(ee);function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach(function(n){(0,Q.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Row=function(e){var n=e.defaultImage,t=e.name,r=e.id,a=e.taxRate,i=e.total,o=e.classNameNameRow;return(0,z.jsxs)("tr",{children:[(0,z.jsx)("td",{children:(0,z.jsx)("div",{className:en().rowImage,children:n&&(0,z.jsx)($.Z,{image:n,width:24,height:24})})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body2",className:E()(o||en().noMargin),children:t})}),(0,z.jsx)("td",{children:(0,z.jsxs)(H.Z,{variant:"body2",textAlign:"center",className:en().noMargin,children:[a,"%"]})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body1",textAlign:"right",className:en().noMargin,children:(0,B.ZP)(i||0,{precision:2})})})]},r)};function InvoiceDetail(e){var n,t,r,a,i,o,c,p,x,g,y=e.invoice,f=(t=(n=(0,O.Wf)(y&&y.orderId&&"/Orders/".concat(y.orderId))).data,r=n.loading,a=C.useMemo(function(){return t&&t.orderData?t.orderData.reduce(function(e,n){var t="InventoryItem"===n.type.name&&n.id&&Number(n.id);return t?[].concat((0,Y.Z)(e),[t]):(0,Y.Z)(e)},[]):null},[t]),i=(0,U.Z)({filter:{id:{in:a}}}),c=(o=(0,O.Wf)(a&&a.length>0&&"/CatalogItems".concat(i))).data,p=o.loading,t&&{loading:r||p,inventoryItems:c||[],order:t}||{}),j=f.order,b=f.loading,Z=(0,O.Wf)((null==j?void 0:j.id)&&"/Orders/".concat(null==j?void 0:j.id,"?apiVersion=2.0")).data;if(!y)return null;var w=y.dueAmount,N=y.paymentInfo,P=(N=void 0===N?{}:N).paidAmount,S=(0,B.ZP)(w,{precision:2}),D=(0,B.ZP)(P,{precision:2}),k=(Z||{totals:{}}).totals,M=k.amount,T=k.tax,R=(0,B.ZP)(T||0,{precision:2}),W=(0,B.ZP)(M||0,{precision:2})||0;return(0,z.jsxs)(A.Z,{loading:b,relativeToParent:!0,children:[(0,z.jsx)(F.Z,{align:"center",fill:!0,className:E()(en().container),children:(0,z.jsx)("table",{className:en().invoiceDetailsTable,children:(0,z.jsxs)("tbody",{children:[(0,z.jsxs)("tr",{children:[(0,z.jsx)("th",{className:en().imageColumn,children:" "}),(0,z.jsx)("th",{className:en().descriptionColumn,children:(0,z.jsx)(H.Z,{variant:"kicker",textAlign:"left",component:"p",uppercase:!0,className:en().noMargin,children:(0,I.t)(s||(s=(0,_.Z)(["Description"])))})}),(0,z.jsx)("th",{className:en().taxRateColumn,children:(0,z.jsx)(H.Z,{variant:"body2",fontWeight:"bold",textAlign:"center",uppercase:!0,className:en().noMargin,children:(0,I.t)(l||(l=(0,_.Z)(["Tax rate"])))})}),(0,z.jsx)("th",{className:en().amountColumn,children:(0,z.jsx)(H.Z,{variant:"body2",fontWeight:"bold",textAlign:"right",uppercase:!0,className:en().noMargin,children:(0,I.t)(d||(d=(0,_.Z)(["Total"])))})})]}),null==Z?void 0:null===(x=Z.lots)||void 0===x?void 0:x.map(function(e){return(0,z.jsxs)(C.Fragment,{children:[(0,z.jsx)(Row,_objectSpread({},e)),e.buyersPremium&&(0,z.jsx)(Row,_objectSpread(_objectSpread({},e.buyersPremium),{},{classNameNameRow:en().feeSpacing})),e.additionalFees.map(function(e){return(0,z.jsx)(Row,_objectSpread(_objectSpread({},e),{},{classNameNameRow:en().feeSpacing}),e.id)})]},e.id)}),null==Z?void 0:null===(g=Z.orderFees)||void 0===g?void 0:g.map(function(e){var n;return(0,z.jsx)(Row,_objectSpread({},e),"".concat(null===(n=e.type)||void 0===n?void 0:n.name,"-").concat(e.id))})]})})}),(0,z.jsx)(F.Z,{align:"center",fill:!0,className:E()(en().container,en().invoiceDetails),children:(0,z.jsx)("table",{className:en().invoiceSummaryTable,children:(0,z.jsxs)("tbody",{children:[(0,z.jsxs)("tr",{children:[(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body2",textAlign:"right",uppercase:!0,className:en().noMargin,children:(0,I.t)(u||(u=(0,_.Z)(["Subtotal"])))})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body1",textAlign:"right",className:en().noMargin,children:W})})]}),(0,z.jsxs)("tr",{children:[(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body2",textAlign:"right",uppercase:!0,className:en().noMargin,children:(0,I.t)(m||(m=(0,_.Z)(["Tax"])))})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body1",textAlign:"right",className:en().noMargin,children:R})})]}),X()(P)&&P>0&&(0,z.jsxs)("tr",{children:[(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body2",textAlign:"right",uppercase:!0,className:en().noMargin,children:(0,I.t)(v||(v=(0,_.Z)(["Paid amount"])))})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body1",textAlign:"right",className:en().noMargin,children:D})})]}),(0,z.jsxs)("tr",{children:[(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body2",textAlign:"right",uppercase:!0,className:en().noMargin,children:(0,z.jsx)("b",{children:(0,I.t)(h||(h=(0,_.Z)(["Total due"])))})})}),(0,z.jsx)("td",{children:(0,z.jsx)(H.Z,{variant:"body1",textAlign:"right",className:en().noMargin,children:(0,z.jsx)("b",{children:S})})})]})]})})})]})}var et=t(13525),er=t(73792),PaymentGateways_Initialize=function(e){return e.gatewayName===et._?(0,z.jsx)(er._v,{}):null},ea=t(16835),ei=t(15862),PaymentComponent=function(e){var n=e.paymentGateway,t=e.invoiceNumber,r=e.router,a=e.handleCheckoutRe
1sultChanged,i=e.onSuccess;return n.name===et._?(0,z.jsx)(er.pV,{paymentGateway:n,invoiceNumber:t,router:r,onCheckoutResultChanged:a,onSuccess:i}):(0,z.jsx)("div",{children:(0,I.t)(p||(p=(0,_.Z)([""," is not implemented yet."])),n.name)})},PaymentGateways_CreditCardPaymentComponent=function(e){var n=e.invoiceNumber,t=e.onSuccess,r=e.router,a=(0,ei.Z)(),i=C.useState({}),o=(0,ea.Z)(i,2),c=o[0],s=o[1],l=C.useCallback(function(e){return s(e)},[a]);return a?c.error?(0,z.jsx)(F.Z,{align:"center",variant:"error",children:(0,z.jsxs)(H.Z,{variant:"shortText",textAlign:"center",component:"div",children:[(0,I.t)(x||(x=(0,_.Z)(["We are experiencing problems with payments at the moment."]))),(0,z.jsx)("br",{}),(0,I.t)(g||(g=(0,_.Z)(["Please try again later."])))]})}):(0,z.jsx)(PaymentComponent,{paymentGateway:a,router:r,invoiceNumber:n,handleCheckoutResultChanged:l,onSuccess:t}):null},eo=t(23868),ec=t(99088),es=t(71355),el=t(95979),ed=t(68581),eu=t.n(ed),PaymentPage=function(e){var n,t=e.invoiceNumber,r=e.paymentGateway,a=(0,el.lh)("header",{foregroundHoverColor:"color-primary-hover"}).foregroundHoverColor,i=(0,D.t)(),o=(0,R.Ke)("Purchase completed"),c=(0,ec.Y8)(ec.Yx.BRIQ_PAYMENTS),s=(0,O.Wf)("/Invoices/".concat(t)),l=s.data,d=s.loading,u=(0,eo.d$)(),m=(0,W.Sv)();(0,C.useEffect)(function(){c&&Z()},[]);var v=(0,es.ZP)().notifySettled,h=C.useCallback(function(){if(l){var e={invoiceNumber:"".concat(l.invoiceNumber),amount:l.dueAmount};T.Z.purchase.completed(e),o(e)}u({type:"success",message:(0,I.t)(y||(y=(0,_.Z)(["Payment successful!"])))}),setTimeout(function(){v(),i.push("/myaccount/[tabId]","/myaccount/invoices")},7e3)},[l,v]);if(!r)return"No default payment gateway found";var p=(0,C.useState)(""),x=p[0],g=p[1],Z=(n=(0,b.Z)(S().mark(function _callee(){var e,n;return S().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,(0,O.rd)("/BriqPay/CreateSession?apiVersion=2.0",{method:"POST",body:{invoiceNumber:"".concat(t),locale:m}});case 3:return null!=(n=r.sent)&&null!==(e=n.session)&&void 0!==e&&e.htmlSnippet&&g(n.session.htmlSnippet),r.abrupt("return",n);case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",u({message:(0,I.t)(f||(f=(0,_.Z)(["Something went wrong, please contact customer service."]))),type:"warning",autoHide:3e3}));case 11:case"end":return r.stop()}},_callee,null,[[0,8]])})),function(){return n.apply(this,arguments)}),w=(0,z.jsxs)(ev,{as:"a",foregroundHoverColor:a,children:[(0,z.jsx)(ep,{dir:"left",style:{marginTop:"2px"}}),(0,z.jsx)("span",{style:{fontWeight:"600"},children:(0,I.t)(j||(j=(0,_.Z)(["Back"])))})]});return(0,z.jsxs)(A.Z,{loading:d,children:[(0,z.jsx)(eh,{children:(0,z.jsx)(M(),{href:"/".concat(m,"/myaccount/invoices"),passHref:!0,legacyBehavior:!0,children:w})}),(0,z.jsx)(InvoiceSummary,{invoice:l}),(0,z.jsx)(InvoiceDetail,{invoice:l}),(0,z.jsx)(PaymentGateways_Initialize,{gatewayName:r.name}),!c&&(0,z.jsx)(PaymentGateways_CreditCardPaymentComponent,{invoiceNumber:t,onSuccess:h,router:i}),c&&(0,z.jsx)("div",{className:eu().briqPayContainer,children:(0,z.jsx)("div",{dangerouslySetInnerHTML:{__html:x}})})]})},em={name:"ubwun",styles:"text-decoration:none;cursor:pointer;color:var(--header-color-foreground);&:active{color:var(--header-color-foreground-active);}&:hover{color:var(--header-color-foreground-hover);}"},ev=(0,Z.Z)("span",{target:"edwmp3m2"})("--header-color-foreground-hover:",function(e){return e.foregroundHoverColor},";display:flex;align-items:center;font-weight:",function(e){return e.bold?600:500},";font-size:16px;line-height:24px;color:var(--header-color-foreground);>span{display:block;}",function(e){var n=e.as;return N()({a:em},n)},";"),eh=(0,Z.Z)("div",{target:"edwmp3m1"})({name:"1oq2yh3",styles:"align-items:center;display:flex;gap:6px;max-width:800px;margin:auto;margin-bottom:-40px;margin-top:12px"}),ep=(0,Z.Z)(function(e){var n=e.className,t=e.style;return(0,z.jsx)("svg",{className:n,style:t,viewBox:"0 0 24 24",width:"24",height:"24",children:(0,z.jsx)("path",{d:"M10 6 L16 12 L10 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})},{target:"edwmp3m0"})("transform:",function(e){var n=e.dir;return N()({left:"rotate(-180deg)"},null!=n?n:"")},";display:block;width:24px;height:24px;");PaymentPage.getInitialProps=(r=(0,b.Z)(S().mark(function _callee2(e){var n,t;return S().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.query.invoiceNumber,r.next=3,(0,O.n)("/PaymentGateways/Default");case 3:return t=r.sent.data,r.abrupt("return",{invoiceNumber:n,paymentGateway:t});case 6:case"end":return r.stop()}},_callee2)}
1)),function(e){return r.apply(this,arguments)});var ex=PaymentPage},96646:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[locale]/payment/[invoiceNumber]",function(){return t(1424)}])},19664:function(e){e.exports={noMargin:"InvoiceDetail_noMargin__AoHsw",container:"InvoiceDetail_container__bZP_x",invoiceDetails:"InvoiceDetail_invoiceDetails__NURvm",invoiceDetailsTable:"InvoiceDetail_invoiceDetailsTable__X6i_Q",feeSpacing:"InvoiceDetail_feeSpacing__tsPGm",invoiceSummaryTable:"InvoiceDetail_invoiceSummaryTable__3OwdD",imageColumn:"InvoiceDetail_imageColumn__b2eaP",rowImage:"InvoiceDetail_rowImage__ZnkvT"}},46920:function(e){e.exports={marginTop:"InvoiceSummary_marginTop__ZH_OQ",container:"InvoiceSummary_container__3BTxR",invoiceOveriew:"InvoiceSummary_invoiceOveriew__K_sUq",totalAmountContainer:"InvoiceSummary_totalAmountContainer____2vT"}},68581:function(e){e.exports={briqPayContainer:"BriqPayModal_briqPayContainer__1_L3i"}}},function(e){e.O(0,[3351,505,9774,2888,179],function(){return e(e.s=96646)}),_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.