1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PriceField-DXA4fqvq.js","assets/index-sUPB-bMu.js","assets/index-CjsJg3P0.css","assets/Options-B1s3eiZy.js","assets/validateRegistrationForPayment-33AxiamO.js","assets/Options-BgBnIJy4.css"])))=>i.map(i=>d[i]); 2import{j as v,_ as k,m as M,k as g,b as n,c as h,e as u,o as m,a as i,g as c,w as R,Z as P,t as l,a1 as D,a7 as G,n as V,aS as F,a8 as d,h as I,p}from"./index-sUPB-bMu.js";const T={computed:{...v(["giveCheckoutData"]),hasRecurrency(){return this.giveCheckoutData.recorrenciaDias>0},hasMultiplesSubject(){return this.giveCheckoutData.motivos.length>1}},methods:{gtagEventGive(e,t){this.$gtag.event(e,{event_category:"give",value:t})},analyticsGiveSuccessfulPayment(e){this.hasRecurrency?this.gtagEventGive("give_recurrency_payment",e):this.hasMultiplesSubject?this.gtagEventGive("give_multiples_payment",e):this.gtagEventGive("give_single_payment",e)},analyticsGiveErrorPayment(e){this.hasRecurrency?this.gtagEventGive("give_recurrency_payment_error",e):this.hasMultiplesSubject?this.gtagEventGive("give_multiples_payment_error",e):this.gtagEventGive("give_single_payment_error",e)}}},A=g(()=>p(()=>import("./PriceField-DXA4fqvq.js"),__vite__mapDeps([0,1,2]))),O=g(()=>p(()=>import("./Options-B1s3eiZy.js"),__vite__mapDeps([3,1,2,4,5]))),S={name:"CheckoutGive",components:{PriceField:A,CheckoutMethodOptions:O},mixins:[T],provide(){return{loadingFees:I(()=>this.loadingFees),setSelectedBrand:this.setSelectedBrand}},data(){return{payFees:!1,paymentWithFees:null,fees:0,paymentError:{type:null,message:null},loadingFees:!1,selectedBrand:null}},computed:{...v(["checkoutMethod","giveCheckoutData","giveGetTotalValue","churchPaymentMethods","checkoutIsUnregistered","checkoutUnregisteredUser","churchData"]),installmentValue(){return d(Number(this.giveValue),this.churchData.moeda)},installmentsTotalValue(){const e=Number(this.giveValue)*(this.specialGive?.parcels||0);return d(e,this.churchData.moeda)},giveValue(){return this.payFees?(Number(this.feesValue)+Number(this.giveGetTotalValue)).toString():this.giveGetTotalValue},specialGive(){const e=this.giveCheckoutData.specialGive;return!e||!this.subjects?.length?null:this.subjects.length===1&&this.subjects[0].motivo===e.subjectId?e:null},showSpecialInstallmentsInfo(){return!!this.specialGive},isRecurrent(){return this.giveCheckoutData.recorrenciaDias>0},excludedMethods(){if(!this.isRecurrent)return[];const e=["BOLETO","ACH","PIX"];return this.specialGive?e.filter(t=>t!=="BOLETO"):e},paymentMethods(){const e=this.churchPaymentMethods.metodosPagamento;return this.isRecurrent?{metodosPagamento:e.filter(t=>t.flagPermitirAssinatura&&!this.excludedMethods.includes(t.codigoMetodoPagamento)),isFree:!1}:{metodosPagamento:e,isFree:!1}},feesValue(){return this.checkoutMethodData?this.fees.toFixed(2):0},subjects(){return this.giveCheckoutData.motivos},valueValidation(){return Number(this.giveValue)<=0?{isValid:!1,message:this.$t("GIVE.CHECKOUT.FORM.VALIDATION.MIN_VALUE")}:this.checkoutMethod==="PICPAY"&&this.giveValue>4999.99?{isValid:!1,message:this.$t("GIVE.CHECKOUT.FORM.VALIDATION.PICPAY.MAX_VALUE")}:{isValid:!0,message:null}},checkoutMethodData(){return this.checkoutMethod?this.churchPaymentMethods.metodosPagamento.find(e=>e.codigoMetodoPagamento===this.checkoutMethod):null},queryMotivesFees(){const{motivos:e}=this.giveCheckoutData;let t="";return e.forEach(({motivo:r,valor:o},a)=>{const s=`&motivos[${a}][motivo]=${r}&motivos[${a}][valor]=${o}`;t+=s}),t}},watch:{checkoutMethod(){this.getFees()},selectedBrand(e,t){e===t||this.checkoutMethod!=="CREDIT_CARD"||this.getFees()}},mounted(){this.specialGive&&(this.payFees=!0),this.checkoutMethod&&this.getFees()},methods:{...M(["checkoutPostGive","setChallengeComplete"]),setSelectedBrand(e){this.selectedBrand=e},async getFees(){try{this.loadingFees=!0;const e=this.checkoutMethod==="CREDIT_CARD"?this.selectedBrand:null,r=(await F.getPaymentFinalValue(this.checkoutMethod,this.queryMotivesFees,e)).data.data;this.fees=r.reduce((o,{valorTaxas:a})=>o+a,0),this.paymentWithFees=r.map(({motivo:o,valorTotal:a})=>({motivo:o,valor:a})),this.loadingFees=!1}catch{this.paymentError={type:"error",message:this.$t("FORM.MESSAGE.ERROR.GENERIC_ERROR")}}},mountPaymentData(e){let t={ach:"ach"in e?e.ach:null,cartao:"cartao"in e?e.cartao:null,picpay:"picpay"in e?e.picpay:null,recorrenciaDias:this.giveCheckoutData.recorrenciaDias?this.giveCheckoutData.recorrenciaDias:0,salvarCartao:"salvarCartao"in e?e.salvarCartao:!1,metodoPagamento:"metodoPagamento"in e?e.metodoPagamento:"CREDIT_CARD",motivos:this.payFees?this.paymentWithFees:this.giveCheckoutData.motivos};return this.checkoutIsUnregistered&&(t={...t,usuario:this.checkoutUnregisteredUser}),t},async makePayment(e){this.paymentError={type:null,message:null};try{await this.checkoutPostGive(this.mountPaymentData(e)),this.checkoutMethod==="CREDIT_CARD"&&this.setChallengeComplete(!1),this.analyticsGiveSuccessfulPayment(this.giveValue),await this.$router.replace({name:"checkoutSuccess"}).catch(()=>{})}catch(t){if(window.scrollTo(0,0),t?.response){let r;switch(t.response?.status){case 400:case 404:case 500:r=`${t.response?.data?.error?.message}`;break;default:r=this.$t("FORM.MESSAGE.ERROR.GENERIC_ERROR");break}this.paymentError={type:"error",message:r},this.analyticsGiveErrorPayment(this.giveValue);return}this.paymentError={type:"error",message:this.$t("FORM.MESSAGE.ERROR.GENERIC_ERROR")}}}}},b={key:0,class:"checkout-give"},N={class:"give-value__wrapper"},U={class:"give-value__total"},w={class:"give-value__input"},B={key:0,class:"give-value__fees"},L={class:"input-item"},j={class:"input-item__field--checkbox"},x={class:"items-group"},H={class:"items-group__check"},K={class:"check-input"},W={class:"items-group__label"},X={key:1,class:"give-value__special-info"};function $(e,t,r,o,a,s){const _=n("PageContentHeader"),y=n("PriceField"),E=n("SvgElement"),f=n("CheckoutMethodOptions");return s.subjects?(m(),h("div",b,[i("div",{class:V(["give-value",{"give-value--payfees":a.payFees}])},[c(_,null,{default:R(()=>[P(l(e.$t("GIVE.HOME.TITLE.PAGE")),1)]),_:1}),i("div",N,[i("h3",U,l(e.$t("GIVE.HOME.BUTTON.TOTAL")),1),i("div",w,[t[1]||(t[1]=i("div",{class:"cover"},null,-1)),c(y,{"field-value":s.giveValue},null,8,["field-value"])]),s.feesValue?(m(),h("div",B,[i("div",L,[i("div",j,[i("label",x,[i("div",H,[i("div",K,[D(i("input",{"onUpdate:modelValue":t[0]||(t[0]=C=>a.payFees=C),type:"checkbox",name:"pay_fees"},null,512),[[G,a.payFees]])]),c(E,{name:a.payFees?"CheckCheckedRetangular":"CheckEmptyRetangular",title:"Pay Fees"},null,8,["name"])]),i("div",W,l(e.$t("GIVE.CHECKOUT.TEXT.PAYMENT.FEES",[s.feesValue])),1)])])])])):u("",!0),s.showSpecialInstallmentsInfo?(m(),h("p",X,l(e.$t("GIVE.CHECKOUT.TEXT.SPECIAL.INSTALLMENTS",{parcels:s.specialGive.parcels,value:s.installmentValue,total:s.installmentsTotalValue})),1)):u("",!0)])],2),c(f,{key:"give","accepted-methods":s.paymentMethods,"payment-error":a.paymentError,"preferred-method":"CREDIT_CARD","value-is-valid":s.valueV
2alidation.isValid,onMakePayment:s.makePayment},null,8,["accepted-methods","payment-error","value-is-valid","onMakePayment"])])):u("",!0)}const Y=k(S,[["render",$]]);export{Y as default};
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.