import{n as e}from"./f025431a.BlsbPO0-.js";import{Ft as a,Pt as n,nn as t,pt as l,yt as r}from"./630ba094.L_X-5TXi.js";import{Gg as o,Hd as s,Jp as i,Js as u,Sb as m,Wd as c,hw as v,mh as p,uS as b,xO as d}from"./6ec9a0fa.rdcQt2v8.js";var g=e({VaultingAgreementCheckbox:()=>y});function y({forceVaultingEligible:e=!1,blockNegotiations:g=!1,borderless:y=!1}={}){const h=m(),_=p(),f=a(void 0),{i18n:k,shop:w,checkout:{negotiator:x}}=d(),{acceptPaymentVaulting:P,paymentLines:V}=x.parts,j=u(),C=n(()=>j.value||e);b(({reason:e})=>(g&&"negotiation"===e||"negotiation"!==e)&&C.value&&(x.current.fields.paymentFlexibilityPaymentTermsTemplate.value&&!_.value||h.value)&&!P.value?{behavior:"block",reason:v.BlankVaultingAgreement,perform(){f.value=k.translate("field_errors.vaulting_agreement_blank")}}:"completion"!==e||C.value?{behavior:"allow"}:{behavior:"allow",perform(){f.value=""}},{checkIdentity:"paymentMethods"});const T=n(()=>V.value.some(e=>"bank"===e.method.type)?k.translate("payment.business_customer_with_bank_account_vaulting_payment_label",{company:w.name}):x.current.fields.buyerIdentity.value?.purchasingCompany?k.translate("payment.business_customer_vaulting_payment_label",{company:w.name}):k.translate("payment.vaulting_agreement_label",{company:w.name})),A=n(()=>C.value?P.value:void 0);return r(t,{children:r(o,{gap:"base",border:y?void 0:"base",borderRadius:y?void 0:"base",padding:y?void 0:"small-100",children:[r(l,{when:f,children:r(s,{tone:"critical",errorType:c.PaymentError,children:f})}),r(i,{name:"vaulting_and_subscription_agreement",checked:A.value,onChange:e=>{!function(e){C.value&&(P.value=e),f.value=""}(e)},error:f.value?" ":void 0,label:T.value})]})})}export{g as n,y as t};