import{M as O,E,U as n,R as _,O as b,V as l,W as d,X as t,Z as c,Y as r,aA as U,a8 as V,e,az as v,bl as q}from"./vendor-CsGITfgk.js";import{aY as P,bF as y}from"./index-CsCqMgta.js";import{u as D}from"./useCheckout-DB1kmMTf.js";import{_ as W}from"./address-selection.vue_vue_type_script_setup_true_lang-CDik-WN2.js";const F={class:"flex flex-col gap-6 lg:flex-row lg:gap-8"},L={class:"lg:w-3/5"},R={class:"space-y-3 lg:w-2/5"},T={class:"flex items-center gap-3 p-3 text-sm"},Y=["data-selected-payment-method-id"],x=["data-payment-method-id"],J=O({__name:"billing-details-section",props:{disabled:{type:Boolean}},setup(X){const{allItemsAreDigital:m,availablePaymentMethods:f,availableShippingMethods:g}=P(),p=E(()=>$.value?.code===y||g.value.length===1&&g.value[0].code===y),{billingAddressEqualsShipping:i,billingAddress:k,paymentMethod:C,shipmentMethod:$,onBillingAddressChange:M,setPaymentMethod:S,isPurchaseOrderNumberEnabled:w,purchaseOrderNumber:u}=D();return(s,o)=>{const z=n("VcLabel"),B=n("VcCheckbox"),h=n("VcImage"),N=n("VcSelect"),A=n("VcInput"),I=n("VcWidget");return b(),_(I,{title:s.$t("shared.checkout.billing_details_section.title"),"prepend-icon":"cash",size:"lg","data-test-id":"checkout.payment-details-section"},{default:l(()=>[d("div",F,[d("div",L,[t(z,{required:""},{default:l(()=>[c(r(s.$t("shared.checkout.billing_details_section.labels.billing_address")),1)]),_:1}),d("div",{class:U(["grow divide-y rounded-[--vc-radius] border",{"cursor-not-allowed bg-neutral-50":s.disabled}])},[!e(m)&&!p.value?(b(),_(B,{key:0,modelValue:e(i),"onUpdate:modelValue":o[0]||(o[0]=a=>v(i)?i.value=a:null),disabled:s.disabled,name:"billingAddressEqualsShipping",class:"p-3"},{default:l(()=>[c(r(s.$t("shared.checkout.billing_details_section.labels.same_as_shipping_address")),1)]),_:1},8,["modelValue","disabled"])):V("",!0),t(e(W),{placeholder:!e(m)&&!p.value&&e(i)?s.$t("shared.checkout.shipping_details_section.links.select_address"):s.$t("shared.checkout.billing_details_section.links.select_address"),address:e(k),disabled:s.disabled,readonly:!e(m)&&!p.value&&e(i),class:"min-h-18 px-3 py-1.5",onChange:e(M)},null,8,["placeholder","address","disabled","readonly","onChange"])],2)]),d("div",R,[t(N,{"model-value":e(C),label:s.$t("shared.checkout.billing_details_section.labels.payment_method"),items:e(f),disabled:s.disabled,size:"auto",required:"","test-id-dropdown":"checkout.payment-method-selector",onChange:o[1]||(o[1]=a=>e(S)(a))},{placeholder:l(()=>[d("div",T,[t(h,{class:"size-12 rounded bg-neutral-100",src:"select-payment.svg"}),c(" "+r(s.$t("common.placeholders.select_payment_method")),1)])]),selected:l(({item:a})=>[d("div",{class:"flex items-center gap-3 p-3 text-sm","data-selected-payment-method-id":a.code},[t(h,{class:"size-12 rounded",src:a.logoUrl},null,8,["src"]),c(" "+r(a.name),1)],8,Y)]),item:l(({item:a})=>[t(h,{class:"size-12 rounded",src:a.logoUrl},null,8,["src"]),d("span",{"data-payment-method-id":a.code},r(a.name),9,x)]),_:1},8,["model-value","label","items","disabled"]),t(q,{name:"slide-fade-top",mode:"in-out"},{default:l(()=>[e(w)?(b(),_(A,{key:0,modelValue:e(u),"onUpdate:modelValue":o[2]||(o[2]=a=>v(u)?u.value=a:null),modelModifiers:{trim:!0},placeholder:s.$t("common.placeholders.purchase_order_number"),disabled:s.disabled,name:"purchaseOrderNumber"},null,8,["modelValue","placeholder","disabled"])):V("",!0)]),_:1})])])]),_:1},8,["title"])}}});export{J as _};
//# sourceMappingURL=billing-details-section.vue_vue_type_script_setup_true_lang-Bwf8Resb.js.map
