import{C,ac as w,q as u,N as c,K as r,a3 as k,u as t,E as m,O as d,Q as y,P as l,R as N}from"./vendor-BGtMsOoo.js";import"./index-CRze-aDK.js";import{u as S,P as x}from"./order-summary.vue_vue_type_style_index_0_scoped_471240a6_lang-DB8A0s2y.js";import{O as z}from"./order-summary-BfC6AHs9.js";import{_ as O,a as R,b as T,c as A}from"./payment-processing-cyber-source.vue_vue_type_style_index_0_lang-C3wsCoxz.js";import"./address-type.enum-CGCAFS3X.js";import"./useUserCheckoutDefaults-BlmbrerI.js";import"./useOrganizationAddresses-DFhlvSxC.js";import"./payment-policies.vue_vue_type_style_index_0_lang-BQUPSUyI.js";import"./add-or-update-address-modal.vue_vue_type_script_setup_true_lang-EfEQeCT4.js";import"./address-form.vue_vue_type_script_setup_true_lang-OQrHDDSp.js";import"./useSkyflowCards-Blgc1LI3.js";const B={class:"flex flex-row items-center justify-between space-x-3 p-4 shadow-lg md:p-6"},F={class:"min-w-0 truncate"},I={class:"p-5 md:p-6"},Y=C({__name:"payment",setup(j){const $=w(),{placedOrder:n,allOrderItemsAreDigital:h}=S(),i=u(()=>n.value.inPayments[0]),b=u(()=>{var o,e;return(e=(o=i.value)==null?void 0:o.paymentMethod)==null?void 0:e.paymentMethodType}),p=u(()=>{var o,e;return(e=(o=i.value)==null?void 0:o.paymentMethod)==null?void 0:e.typeName});async function a(o){await $.replace({name:"CheckoutPaymentResult",params:{status:o?"success":"failure"}})}return(o,e)=>{const M=c("VcImage"),P=c("VcWidget"),V=c("VcLayout");return t(n)?(m(),r(V,{key:0,"sidebar-position":"right","sticky-sidebar":""},{sidebar:d(()=>[y(t(z),{cart:t(n),"no-shipping":t(h)},null,8,["cart","no-shipping"])]),default:d(()=>[y(P,{size:"lg"},{"default-container":d(()=>{var f,_,v,g;return[l("div",B,[l("div",F,[y(M,{src:(_=(f=i.value)==null?void 0:f.paymentMethod)==null?void 0:_.logoUrl,class:"mr-3.5 inline-block size-8 object-center md:size-9",lazy:""},null,8,["src"]),l("span",null,N(o.$t(`common.methods.payment_by_code.${(g=(v=i.value)==null?void 0:v.paymentMethod)==null?void 0:g.code}`)),1)])]),l("div",I,[b.value===t(x).Redirection?(m(),r(t(O),{key:0,order:t(n)},null,8,["order"])):p.value==="AuthorizeNetPaymentMethod"?(m(),r(R,{key:1,order:t(n),onSuccess:e[0]||(e[0]=s=>a(!0)),onFail:e[1]||(e[1]=s=>a(!1))},null,8,["order"])):p.value==="SkyflowPaymentMethod"?(m(),r(T,{key:2,order:t(n),onSuccess:e[2]||(e[2]=s=>a(!0)),onFail:e[3]||(e[3]=s=>a(!1))},null,8,["order"])):p.value==="CyberSourcePaymentMethod"?(m(),r(A,{key:3,order:t(n),onSuccess:e[4]||(e[4]=s=>a(!0)),onFail:e[5]||(e[5]=s=>a(!1))},null,8,["order"])):k("",!0)])]}),_:1})]),_:1})):k("",!0)}}});export{Y as default};
//# sourceMappingURL=payment-QZUzyfFy.js.map
