import{u as N,c as o,o as e,d as m,k as d,e as p,F as w,l as D,r as i,i as b,b as T,a as v,t as s,g as S,f}from"./app-q0jdcHwC.js";import{S as x}from"./SkeletonLoader-DoyP93ZN.js";import{_ as V,S as $,a as B,b as L}from"./ShopCardTop-F4jh5Hhy.js";import"./ri-star-fill-DTNr-wIb.js";import"./ri-arrow-right-line-sR0bdBhF.js";import"./ArrowRightIcon-lWca2ARp.js";import"./useTruncateText-CroACzlR.js";const P={__name:"ShopCardToggler",props:{shopData:{type:Object,required:!0}},setup(u){const t=N();return(_,l)=>(e(),o(w,null,[p(t).themeName=="NextMart"?(e(),m(V,{key:0,shop:u.shopData},null,8,["shop"])):d("",!0),p(t).themeName=="NovaStore"||p(t).themeName=="PrimeCart"?(e(),m($,{key:1,shop:u.shopData},null,8,["shop"])):d("",!0),p(t).themeName=="MegaMart"?(e(),m(B,{key:2,shop:u.shopData},null,8,["shop"])):d("",!0),p(t).themeName=="UltraMart"?(e(),m(L,{key:3,shop:u.shopData},null,8,["shop"])):d("",!0)],64))}},U={class:"main-container py-14"},j={key:0,class:"text-slate-800 text-3xl font-bold leading-9"},A={class:"mt-8 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 items-start"},F={key:2,class:"flex justify-between items-center w-full mt-8 gap-4 flex-wrap"},q={class:"text-slate-800 text-base font-normal leading-normal"},J={__name:"Shop",setup(u){const t=N(),_=new D,l=i(!0),r=i(1),c=i(12),g=i(0),h=i([]);b(()=>{if(!t.multiVendor){_.push("/");return}k(),window.scrollTo(0,0)});const C=async a=>{r.value=a,k()},k=async()=>{window.scrollTo(0,0),l.value=!0,axios.get("/shops",{params:{page:r.value,per_page:c.value},headers:{"Accept-Language":t.locale||"en"}}).then(a=>{g.value=a.data.data.total,h.value=a.data.data.shops,setTimeout(()=>{l.value=!1},300)})};return(a,y)=>{const M=T("vue-awesome-paginate");return e(),o("div",U,[l.value?(e(),m(x,{key:1,class:"w-48 sm:w-60 md:w-72 lg:w-96 h-12 rounded-lg"})):(e(),o("div",j,s(a.$t("All Shops")),1)),v("div",A,[l.value?(e(),o(w,{key:1},S(8,n=>v("div",{key:n},[f(x,{class:"w-full h-[200px] sm:h-[250px] rounded-lg"})])),64)):(e(!0),o(w,{key:0},S(h.value,n=>(e(),o("div",{key:n.id,class:"w-full"},[f(P,{shopData:n},null,8,["shopData"])]))),128))]),h.value.length>0&&!l.value?(e(),o("div",F,[v("div",q,s(a.$t("Showing"))+" "+s(c.value*(r.value-1)+1)+" "+s(a.$t("to"))+" "+s(c.value*(r.value-1)+h.value.length)+" "+s(a.$t("of"))+" "+s(g.value)+" "+s(a.$t("results")),1),v("div",null,[f(M,{"total-items":g.value,"items-per-page":c.value,type:"button","hide-prev-next-when-ends":!0,"max-pages-shown":5,modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=n=>r.value=n),onClick:C},null,8,["total-items","items-per-page","modelValue"])])])):d("",!0)])}}};export{J as default};
