1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8817],{200:(e,t,r)=>{"use strict";r.d(t,{BW:()=>d,N:()=>l,Qn:()=>o,Wh:()=>c,cf:()=>i});var s=r(4956);let n={eur:50,usd:50,gbp:30,sek:300},a={eur:"â¬",usd:"$",gbp:"\xa3",sek:"kr"};function c(e){let t=null==e?void 0:e.toLowerCase();return t&&s.qx.some(e=>e.code===t)?t:"eur"}function i(e){let t=c(e);return s.qx.find(e=>e.code===t)||s.qx[0]}function l(e,t){let r=c(t).toUpperCase();return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}function o(e){return a[c(e)]}function d(e){return n[c(e)]}},22885:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(68730).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},58580:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>S,default:()=>F});var s=r(37876),n=r(14232),a=r(65411),c=r(18334),i=r(89099),l=r(48230),o=r.n(l),d=r(96851),x=r(4241),u=r(39742),m=r(90606),p=r(9115),h=r(43445),f=r(200),y=r(86739),b=r(7446),j=r(99239),g=r(22885),v=r(13569),N=r(65390),w=r(98549);let k=(0,x.c)("pk_live_ZUYUsGE26hCuAsT47DO1X3q100vHtBs49v"),_=(e,t)=>{let r=parseFloat(e),s=isNaN(r)?0:r,n=Math.round(100*s),a=(0,f.BW)(t),c=n>0&&n<a;return{amountToCharge:c?a/100:s,isBelowMinimum:c,minimumAmount:a/100,walletTopUp:c?(a-n)/100:0}},A=e=>{let{amount:t,currencyCode:r,invoiceId:i}=e,l=(0,d.c3)("account"),o=(0,d.c3)("checkout"),x=(0,u.t2)(),m=(0,u.HH)(),[p,h]=(0,n.useState)(!1),[f,g]=(0,n.useState)(null),v=async e=>{if(e.preventDefault(),!x||!m)return;h(!0),g(null),(0,a.Z)({category:"invoice",message:"User paying invoice",data:{invoiceId:i,amount:t},level:"info"});let{error:r}=await x.confirmPayment({elements:m,confirmParams:{return_url:"".concat(window.location.origin,"/account/invoices/").concat(i,"?paid=true")}});r&&((0,c.wd)("Invoice payment failed",{level:"error",extra:{error:r.message,code:r.code,invoiceId:i}}),g(r.message||l("paymentFailed")),h(!1))},N=(e,t)=>{let r=parseFloat(e);if(isNaN(r))return e;switch(t.toUpperCase()){case"SEK":return"".concat(r.toFixed(2)," kr");case"GBP":return"\xa3".concat(r.toFixed(2));case"USD":return"$".concat(r.toFixed(2));default:return"â¬".concat(r.toFixed(2))}},{amountToCharge:k,isBelowMinimum:A,minimumAmount:S,walletTopUp:F}=_(t,r);return(0,s.jsxs)("form",{onSubmit:v,translate:"no",className:"notranslate space-y-6",children:[(0,s.jsx)("div",{className:"bg-t-card rounded-lg p-4 border border-t-border",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-t-text-tertiary",children:l("amountToPay")}),(0,s.jsx)("span",{className:"text-2xl font-bold text-t-text",children:N(String(k),r)})]})}),A&&(0,s.jsx)("div",{className:"bg-blue-900/20 rounded-lg p-4 border border-blue-700/50",children:(0,s.jsx)("p",{className:"text-sm text-blue-300",children:o("minimumPaymentNotice",{minimum:N(String(S),r),difference:N(String(F),r)})})}),f&&(0,s.jsxs)("div",{className:"p-4 bg-red-500/10 border border-red-500/50 rounded-lg flex items-start gap-3",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-red-500 mt-0.5 flex-shrink-0"}),(0,s.jsx)("p",{className:"text-red-400 text-sm",children:f})]}),(0,s.jsx)("div",{className:"bg-t-card rounded-lg p-4 border border-t-border",children:(0,s.jsx)(u.He,{options:{paymentMethodOrder:w.M}})}),(0,s.jsx)("button",{type:"submit",disabled:!x||p,className:"w-full flex items-center justify-center gap-2 px-6 py-4 bg-gradient-to-r from-red-600 to-red-500 hover:from-red-700 hover:to-red-600 text-white font-bold rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.A,{className:"w-5 h-5 animate- animate-spin"}),l("processing")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{className:"w-4 h-4"}),l("payNow")]})}),(0,s.jsx)("p",{className:"text-center text-t-text-muted text-xs",children:l("securePayment")})]})};var S=!0;let F=()=>{let e=(0,d.c3)("account"),{id:t,secret:r,amount:a}=(0,i.useRouter)().query,{data:c}=(0,h.F7)(),[l,x]=(0,n.useState)(!1),f="string"==typeof r?r:"",y="string"==typeof t?t:"";return f?(0,s.jsxs)(p.A,{title:e("payInvoice"),children:[(0,s.jsx)(m.A,{title:e("payInvoice"),description:e("payInvoiceDescription")}),(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)(o(),{href:"/account/invoices/".concat(y),className:"inline-flex items-center gap-2 text-t-text-tertiary hover:text-t-text transition-colors",children:[(0,s.jsx)(g.A,{className:"w-4 h-4"}),e("backToInvoice")]})}),(0,s.jsx)("div",{className:"max-w-lg mx-auto",children:l?(0,s.jsxs)("div",{className:"bg-card-gradient rounded-xl border border-t-border p-8 text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(v.A,{className:"w-8 h-8 text-green-500"})}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-t-text mb-2",children:e("paymentSuccessful")}),(0,s.jsx)("p",{className:"text-t-text-tertiary",children:e("invoiceUpdated")})]}):(0,s.jsxs)("div",{className:"bg-card-gradient rounded-xl border border-t-border p-8",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-red-500/10 rounded-lg flex items-center justify-center",children:(0,s.jsx)(N.A,{className:"w-6 h-6 text-red-500"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-t-text",children:e("payInvoice")}),(0,s.jsx)("p",{className:"text-t-text-tertiary text-sm",children:e("completePayment")})]})]}),(0,s.jsx)(u.S8,{stripe:k,options:{clientSecret:f,appearance:{theme:"night",variables:{colorPrimary:"#ef4444",colorBackgroun
1d:"#1f2937",colorText:"#ffffff",colorDanger:"#ef4444",fontFamily:"system-ui, sans-serif",borderRadius:"8px"}}},children:(0,s.jsx)(A,{amount:"string"==typeof a?a:"0.00",currencyCode:(null==c?void 0:c.currencyCode)||"EUR",invoiceId:y})})]})})]}):(0,s.jsxs)(p.A,{title:e("payInvoice"),children:[(0,s.jsx)(m.A,{title:e("payInvoice"),description:e("payInvoiceDescription")}),(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(b.A,{className:"w-8 h-8 text-red-500 animate- animate-spin"})})]})}},71776:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/invoices/[id]/pay",function(){return r(58580)}])},86739:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(68730).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])}},e=>{var t=t=>e(e.s=t);e.O(0,[2710,1187,3237,7577,5333,2554,636,6593,8792],()=>t(71776)),_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.