import{_ as a}from"./DZzUg3YV.js";import{_ as s}from"./CPKeCwqW.js";import{_ as e}from"./pHiPCBWo.js";import{_ as r}from"./vS--ASEp.js";import{a as o,h as l,i as t,b as i,P as d}from"./C8euUk8I.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"./BudKHhhf.js";import"./BSAw-T2Z.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"},b={key:1},D={__name:"search",setup(D){var F;const L=o().$axios,O=l(),P=u(+(null==(F=O.query)?void 0:F.page)||1),{data:T,status:E}=t("search",(()=>{var a,s;return L.get("search",{params:{keyword:null==(a=O.query)?void 0:a.keyword,page:null==(s=O.query)?void 0:s.page}}).then((a=>a.data)).catch((a=>a.response))}),{watch:[()=>{var a;return null==(a=O.query)?void 0:a.keyword},()=>{var a;return null==(a=O.query)?void 0:a.page}]}),{t:M}=i(),z=n((()=>{var a,s;return[{name:M("NAV.home"),to:"/"},{name:M("TITLES.search"),to:"",disabled:!0},{name:null==(a=O.query)?void 0:a.keyword,to:`/search?keyword=${null==(s=O.query)?void 0:s.keyword}`}]}));return(o,l)=>{var t,i,u,n;const D=a,F=s,L=e,O=m("VPagination"),M=r;return"pending"===c(E)?(p(),v("div",_,[g(D)])):"success"===c(E)?(p(),v("div",w,[g(F,{"data-aos":"fade-right",items:c(z)},null,8,["items"]),(null==(i=null==(t=c(T))?void 0:t.data)?void 0:i.length)?(p(),v("div",V,[y("div",x,[(p(!0),v(h,null,k(null==(u=c(T))?void 0:u.data,(a=>(p(),j(L,{key:a.id,product:a},null,8,["product"])))),128))]),y("div",$,[g(O,{modelValue:c(P),"onUpdate:modelValue":[l[0]||(l[0]=a=>f(P)?P.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(T))?void 0:n.meta.last_page,"range-size":1,"active-color":"#DCEDFF"},null,8,["modelValue","pages"])])])):(p(),v("div",b,[g(M,{class:"!min-h-[35vh]"})]))])):q("",!0)}}};export{D as default};
