1import{l as F,Y as x,j as M}from"./index-ywl6tMjC.js";import{d as V,i as I,u as P,A as Y,aa as $,o as q,b as N,c as T,e as t,t as r,f as s,L as U,E as z,x as u,g as j,n as b,h as A,N as D,r as a}from"./app-B5M2SnJB.js";import{u as K}from"./subscriptions-BhjW6RNP.js";const O={class:"container px-1 py-5"},G={class:"lg:text-3xl mb-5 md:mb-10 mr-10 text-2xl"},H={class:"bg-white border border-slate-200 md:w-7/12 p-2 rounded"},L={class:"font-semibold text-xs"},Q={class:"gap-4 grid grid-cols-2 mt-4"},W={class:"font-semibold text-xs"},Z={class:"font-semibold text-xs"},J={class:"mb-4 mt-10 mx-auto relative lg:w-2/3 md:w-full sm:w-2/3"},ae=V({__name:"UpdatePaymentMethod",setup(X){const n=I("__"),d=a({base:"bg-slate-50 p-2 rounded"}),_=a(null),c=a({base:{fontFamily:"Nunito, sans-serif",fontSize:"16px","::placeholder":{color:"#94a3b8"}},invalid:{iconColor:"#f87171",color:"#fca5a5","::placeholder":{color:"#fca5a5"}}}),i=a(!1),p=a(),h=P(),w=Y(),C=K(),m=a(!1),f=a(!1),v=a(!1),S=a(null),y=a(!1),E="pk_live_51NETBwKOYC6zRDBgVGcHqzRusETiz8lvQFKzNAGhu3qW4DskVEbQTFxZ0nO1bjWVJZhOwg0XiMH1zAKRv1igsIiR00FNgMBYpY",B=F(E),o=w.user.tenant;async function R(){i.value=!0;const{setupIntent:k,error:e}=await S.value.instance.confirmCardSetup(p.value.client_secret,{payment_method:{card:_.value.stripeElement,billing_details:{address:{city:o.city,country:o.country,line1:o.address_line_1,line2:o.address_line_2,postal_code:o.postal_code??null,state:o.county??null},email:o.email,name:o.name}}});e?(console.error(e),i.value=!1):await h.post("subscriptions/update-payment-method",{payment_method:k.payment_method}).then(async()=>{await w.refreshUser(),h.redirect({name:"subscriptions.billing"},{message:n("Payment method successfully updated."),status:200,title:n("Success")})}).catch(async()=>{i.value=!1,p.value=await C.getPaymentIntent()})}return $(()=>{B.then(()=>{y.value=!0})}),q(async()=>{p.value=await C.getPaymentIntent()}),(k,e)=>(N(),T("div",O,[t("h1",G,r(s(n)("Update payment method")),1),t("div",H,[y.value?(N(),U(s(M),{key:0,"stripe-key":s(E),ref_key:"stripeElements",ref:S},{default:z(({elements:g})=>[t("span",L,r(s(n)("Card number")),1),u(s(x),{type:"cardNumber",elements:g,options:{classes:d.value,showIcon:!0,style:c.value},ref_key:"cardElement",ref:_,onBlur:e[0]||(e[0]=l=>v.value=!1),onFocus:e[1]||(e[1]=l=>v.value=!0)},null,8,["elements","options"]),t("div",Q,[t("div",null,[t("span",W,r(s(n)("Expiration date")),1),u(s(x),{type:"cardExpiry",elements:g,options:{classes:d.value,placeholder:s(n)("MM/YY"),style:c.value},onBlur:e[2]||(e[2]=l=>f.value=!1),onFocus:e[3]||(e[3]=l=>f.value=!0)},null,8,["elements","options"])]),t("div",null,[t("span",Z,r(s(n)("Security code")),1),u(s(x),{type:"cardCvc",elements:g,options:{classes:d.value,style:c.value},onBlur:e[4]||(e[4]=l=>m.value=!1),onFocus:e[5]||(e[5]=l=>m.value=!0)},null,8,["elements","options"])])])]),_:1},8,["stripe-key"])):j("",!0),t("div",J,[e[6]||(e[6]=t("img",{class:"relative z-10",src:"/img/credit-card.png"},null,-1)),t("span",{class:b(["absolute duration-500 font-mono left-[8%] p-px lg:text-lg rounded text-white top-[50%] transition-all z-20",{"ring-2 ring-amber-500":v.value}])}," 0000 0000 0000 0000 ",2),t("span",{class:b(["absolute duration-500 font-mono left-[29%] lg:text-sm p-px rounded text-white text-xs top-[69%] transition-all z-20",{"ring-2 ring-amber-500":f.value}])}," 00/00 ",2),t("span",{class:b(["absolute duration-500 font-mono italic left-[70%] lg:text-sm p-px rounded text-xs top-[49%] transition-all z-20",{"ring-2 ring-amber-500":m.value}])}," 000 ",2)]),u(s(D),{class:"bg-success mt-10 text-white w-full",disabled:!y.value||i.value,onClick:R},{default:z(()=>[A(r(s(n)("Update payment method")),1)]),_:1},8,["disabled"])])]))}});export{ae as default}; 2//# sourceMappingURL=UpdatePaymentMethod-B5UL0qXN.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.