import{c as i,o as a,a as e,p as g,l as x,u as d,i as v,b as w,f as s,a8 as b,k as r,F as y,g as k,e as n,ae as A,t as l,n as $,w as C,af as M}from"./app-q0jdcHwC.js";function V(m,c){return a(),i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),e("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"})])}const B={class:"flex flex-col h-full"},N={class:"p-3 md:p-4 xl:p-6 h-full flex flex-col justify-between gap-4"},j={class:"space-y-4"},D={class:"flex w-[60px] sm:w-[88px] bg-slate-50 rounded-lg flex-col gap-2 justify-center items-center shrink-0"},Z={class:"px-1.5 py-[3px] bg-slate-800 rounded-md text-white text-xs font-medium uppercase"},E={class:"overflow-hidden"},F={class:"text-slate-950 text-lg font-medium leading-normal tracking-tight"},H={class:"text-slate-500 text-base font-normal leading-normal"},S={class:"text-slate-500 text-base font-normal leading-normal truncate"},z={key:0,class:"text-blue-500 mt-1 text-sm font-normal leading-[18px] italic"},L=["onClick"],R={class:"text-xs md:text-sm font-normal"},T={key:0,class:"w-full bg-white p-2 md:p-3 lg:p-4 rounded md:rounded-lg border border-slate-200"},q={class:"text-slate-600 text-xl font-medium leading-normal italic"},G={class:"w-full flex justify-end"},I={class:"text-base font-medium leading-normal"},P={__name:"ManageAddress",setup(m){const c=g(),p=x(),u=d();v(()=>{_(),window.scrollTo(0,0)});const _=()=>{c.fetchAddresses()},h=o=>{p.push({name:"edit-address",params:{id:o.id}})};return(o,J)=>{const f=w("router-link");return a(),i("div",B,[s(b,{title:"Manage Address"}),e("div",N,[e("div",j,[(a(!0),i(y,null,k(n(c).addresses,t=>(a(),i("div",{key:t.id,class:"p-2 md:p-3 lg:p-4 flex gap-2 md:gap-4 xl:gap-6 rounded-lg border border-slate-200 w-full bg-white relative"},[e("div",D,[s(n(A),{class:"w-6 h-6 text-primary-600"}),e("div",Z,l(t==null?void 0:t.address_type),1)]),e("div",E,[e("div",F,l(t==null?void 0:t.name),1),e("div",H,l(t==null?void 0:t.phone),1),e("div",S,l((t!=null&&t.flat_no?(t==null?void 0:t.flat_no)+", ":"")+(t==null?void 0:t.address_line)+", "+(t!=null&&t.address_line2?(t==null?void 0:t.address_line2)+", ":""))+" "+l((t==null?void 0:t.area)+"-"+(t==null?void 0:t.post_code)),1),t.is_default?(a(),i("div",z,l(o.$t("Default Address")),1)):r("",!0)]),e("button",{class:$(["absolute top-2 md:top-3 lg:top-4 px-1 py-0.5 md:px-2 md:py-1 rounded-md border border-primary hover:bg-primary text-primary hover:text-white transition-all flex items-center gap-0.5",n(u).langDirection=="rtl"?"left-2 md:left-3 lg:left-4":"right-2 md:right-3 lg:right-4"]),type:"button",onClick:K=>h(t)},[s(n(V),{class:"w-4 h-4 md:w-5 md:h-5"}),e("div",R,l(o.$t("Edit")),1)],10,L)]))),128)),n(c).addresses.length===0?(a(),i("div",T,[e("div",q,l(o.$t("Address list is empty")),1)])):r("",!0)]),e("div",G,[s(f,{to:"/manage-address/new",class:"p-2 md:p-3 lg:p-4 flex gap-2 rounded md:rounded-lg bg-primary text-white items-center"},{default:C(()=>[s(n(M),{class:"w-5 h-5"}),e("div",I,l(o.$t("New Address")),1)]),_:1})])])])}}};export{P as default};
