import{C as y,V as B,r as k,q as l,al as N,a8 as q,l as E,N as d,K as M,E as S,O as o,Q as s,u as r,P as A,S as c,R as u}from"./vendor-BGtMsOoo.js";import{aQ as Q}from"./index-CRze-aDK.js";import{_ as $}from"./address-form.vue_vue_type_script_setup_true_lang-OQrHDDSp.js";const j={class:"flex flex-wrap items-center justify-between gap-4 pt-2 *:max-xs:flex-1"},O=y({__name:"add-or-update-address-modal",props:{address:{},loading:{type:Boolean}},emits:["result"],setup(m,{emit:p}){const f=p,_=m,{countries:n,loadCountries:v}=Q(),{t}=B(),a=k(),b=l(()=>a.value?t("common.titles.edit_address"):t("common.titles.new_address")),h=l(()=>a.value?t("common.buttons.save"):t("common.buttons.create"));N(async()=>{n.value.length||await v()});function w(e){f("result",e)}return q(()=>{a.value=E.clone(_.address)}),(e,D)=>{const i=d("VcButton"),g=d("VcModal");return S(),M(g,{title:b.value,"max-width":"60rem","hide-actions":"","is-mobile-fullscreen":""},{default:o(({close:x})=>[s(r($),{"model-value":a.value,countries:r(n),disabled:e.loading,"with-personal-info":"","required-email":"","required-city":"",onSave:w},{append:o(({dirty:C,valid:V})=>[A("div",j,[s(i,{"min-width":"8rem",color:"secondary",variant:"outline",onClick:x},{default:o(()=>[c(u(e.$t("common.buttons.cancel")),1)]),_:2},1032,["onClick"]),s(i,{"min-width":"8rem",disabled:!C||!V,loading:e.loading,type:"submit"},{default:o(()=>[c(u(h.value),1)]),_:2},1032,["disabled","loading"])])]),_:2},1032,["model-value","countries","disabled"])]),_:1},8,["title"])}}});export{O as _};
//# sourceMappingURL=add-or-update-address-modal.vue_vue_type_script_setup_true_lang-EfEQeCT4.js.map
