import{F as O,m as P,P as n,_,R as b,a1 as l,T as d,X as t,a2 as c,a0 as r,Z as q,W as v,e,Y as V,bm as E}from"./vendor-DJC-2VPc.js";import{a_ as U,bu as y}from"./index-BZco6cza.js";import{_ as D}from"./address-selection.vue_vue_type_script_setup_true_lang-B0Add-rk.js";import{u as T}from"./useCheckout-C1A6QOJc.js";const W={class:"flex flex-col gap-6 lg:flex-row lg:gap-8"},F={class:"lg:w-3/5"},L={class:"space-y-3 lg:w-2/5"},R={class:"flex items-center gap-3 p-3 text-sm"},x=["data-selected-payment-method-id"],X=["data-payment-method-id"],J=O({__name:"billing-details-section",props:{disabled:{type:Boolean}},setup(Y){const{allItemsAreDigital:m,availablePaymentMethods:f,availableShippingMethods:g}=U(),p=P(()=>$.value?.code===y||g.value.length===1&&g.value[0].code===y),{billingAddressEqualsShipping:i,billingAddress:k,paymentMethod:C,shipmentMethod:$,onBillingAddressChange:S,setPaymentMethod:w,isPurchaseOrderNumberEnabled:B,purchaseOrderNumber:u}=T();return(s,o)=>{const M=n("VcLabel"),N=n("VcCheckbox"),h=n("VcImage"),z=n("VcSelect"),I=n("VcInput"),A=n("VcWidget");return b(),_(A,{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",W,[d("div",F,[t(M,{required:""},{default:l(()=>[c(r(s.$t("shared.checkout.billing_details_section.labels.billing_address")),1)]),_:1}),d("div",{class:q(["grow divide-y rounded-[--vc-radius] border",{"cursor-not-allowed bg-neutral-50":s.disabled}])},[!e(m)&&!p.value?(b(),_(N,{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(D),{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(S)},null,8,["placeholder","address","disabled","readonly","onChange"])],2)]),d("div",L,[t(z,{"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(w)(a))},{placeholder:l(()=>[d("div",R,[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,x)]),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(E,{name:"slide-fade-top",mode:"in-out"},{default:l(()=>[e(B)?(b(),_(I,{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-D4g8eZq-.js.map
