1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f77a06dd-597c-4238-84aa-31b244fe194b",e._sentryDebugIdIdentifier="sentry-dbid-f77a06dd-597c-4238-84aa-31b244fe194b")}catch(e){}}();"use strict";(self.webpackChunkaudioboom_web=self.webpackChunkaudioboom_web||[]).push([[669],{16127:function(e,t,a){a.d(t,{default:function(){return x}});var s=a(74848),r=a(96540),d=a(7547),n=a(15987),l=a(54669),i=a(73240),c=a(29032),o=a(20311),u=a.n(o),m=a(27010),b=a(62417),h=a(4111),f=a(76601),p=({setupIntentURL:e,updateURL:t})=>{let[a,n]=(0,r.useState)(null),[o,p]=(0,r.useState)(!1),[x,y]=(0,r.useState)(null),g=r.useId(),j=(0,d.t2)(),w=(0,d.HH)(),_=async e=>{e.preventDefault();let s=new FormData(e.currentTarget).get("cardholder_name");u()(a&&j&&w,"missing deps"),p(!0);let{setupIntent:r,error:n}=await j.confirmCardSetup(a,{payment_method:{card:w.getElement(d.hA),billing_details:{name:s}}});if(n){y(n.message||"Couldn't save card details"),p(!1);return}try{let e=await (0,i.C)((0,l.E8)(t,{stripe_customer:{payment_method:r.payment_method}}));u()("ok"===e.status,"unexpected result when updating card"),u()("string"==typeof e.redirect,"Unexpected CardDetails response"),m.V.visit(e.redirect)}catch(e){y((await (0,l.i)(e))[0].title||"An error occurred"),p(!1)}};return(0,r.useEffect)(()=>{(0,l.ht)(e).then(e=>e.json()).then(e=>n(e.client_secret))},[e]),(0,s.jsxs)("div",{className:"mbl",children:[(0,s.jsx)("p",{children:"Update your default payment method:"}),(0,s.jsxs)("div",{className:"card",children:[(0,s.jsx)("div",{className:"card-body",children:(0,s.jsxs)("form",{onSubmit:_,children:[x?(0,s.jsx)(f.A,{errors:[{title:x}]}):null,(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("label",{htmlFor:g,className:"form-label",children:"Cardholder name"}),(0,s.jsx)("input",{id:g,className:"form-control",name:"cardholder_name"})]}),(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsx)(c.A,{disabled:!a})}),(0,s.jsx)(h.A,{loading:o,label:"Update payment details",disabled:!j})]})}),(0,s.jsx)("div",{className:"text-muted card-footer",children:(0,s.jsx)(b.b,{})})]})]})},x=({prompt:e="Change default card",startOpen:t=!1,setupIntentURL:a,updateURL:l})=>{let[i,c]=(0,r.useState)(t);return(0,s.jsx)(s.Fragment,{children:i?(0,s.jsx)(d.S8,{stripe:(0,n.A)(),children:(0,s.jsx)(p,{setupIntentURL:a,updateURL:l})}):(0,s.jsx)("a",{href:"#",onClick:e=>{e.preventDefault(),c(!0)},className:"btn btn-brand-01",children:e})})}}}]);
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.