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