import{_ as a}from"./WVgwOS-U.js";import{_ as s}from"./DcWtwwof.js";import{_ as e}from"./BAUYdZVe.js";import{_ as r}from"./Dd9hA68a.js";import{u as o,i as l,a as t,d as i,P as d}from"./ZipTOXeQ.js";import{c as u,f as n,B as m,u as c,L as p,M as v,x as g,$ as y,F as h,O as k,V as j,l as f,W as q}from"./CFGNYEIb.js";import"./Y2qjdm8f.js";import"./b9RiRfZU.js";import"./mqjJGHgV.js";const _={key:0,class:"container my-10"},w={key:1,class:"my-10 container"},V={key:0},x={class:"grid mt-6 lg:mt-14 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-y-8 gap-x-2.5"},$={class:"mt-10"},F={key:1},T={__name:"search",setup(T){var b;const D=o().$axios,E=l(),L=u(+(null==(b=E.query)?void 0:b.page)||1),{data:O,status:P}=t("search",(()=>{var a,s;return D.get("search",{params:{keyword:null==(a=E.query)?void 0:a.keyword,page:null==(s=E.query)?void 0:s.page}}).then((a=>a.data)).catch((a=>a.response))}),{watch:[()=>{var a;return null==(a=E.query)?void 0:a.keyword},()=>{var a;return null==(a=E.query)?void 0:a.page}]}),{t:S}=i(),W=n((()=>{var a,s;return[{name:S("NAV.home"),to:"/"},{name:S("TITLES.search"),to:"",disabled:!0},{name:null==(a=E.query)?void 0:a.keyword,to:`/search?keyword=${null==(s=E.query)?void 0:s.keyword}`}]}));return(o,l)=>{var t,i,u,n;const T=a,b=s,D=e,E=m("VPagination"),S=r;return"pending"===c(P)?(p(),v("div",_,[g(T)])):"success"===c(P)?(p(),v("div",w,[g(b,{"data-aos":"fade-right",items:c(W)},null,8,["items"]),(null==(i=null==(t=c(O))?void 0:t.data)?void 0:i.length)?(p(),v("div",V,[y("div",x,[(p(!0),v(h,null,k(null==(u=c(O))?void 0:u.data,(a=>(p(),j(D,{key:a.id,product:a},null,8,["product"])))),128))]),y("div",$,[g(E,{modelValue:c(L),"onUpdate:modelValue":[l[0]||(l[0]=a=>f(L)?L.value=a:null),l[1]||(l[1]=a=>o.$router.push({query:Object.assign({},(o._.provides[d]||o.$route).query,{page:a})}))],pages:null==(n=c(O))?void 0:n.meta.last_page,"range-size":1,"active-color":"#DCEDFF"},null,8,["modelValue","pages"])])])):(p(),v("div",F,[g(S,{class:"!min-h-[35vh]"})]))])):q("",!0)}}};export{T as default};
