import{_ as P}from"./Bgk-2nau.js";import{_ as b}from"./CO0TJbSZ.js";import{_ as k}from"./CD8dOBv2.js";import{aD as S,ay as $,a6 as E,D as U}from"./BmsEUx_s.js";import{k as B,ag as I,a as N,l as D,G as r,M as u,O as o,Q as m,u as e,V as _,H as T,I as V,X as p}from"./BO9AmBA3.js";const j={class:"p-3 h-14 text-sm flex items-center gap-3 hover:bg-gray-100 cursor-pointer transition duration-300 bg-white"},C={class:"rounded-md border-1 border-gray-200 overflow-hidden flex-none"},M={class:"flex items-center justify-between overflow-hidden gap-5 grow"},z={"data-testid":"layout-search-suggest-name",class:"text-gray-500 whitespace-nowrap overflow-hidden text-ellipsis"},A={class:"flex-none text-right"},F={key:0},H=10,X=B({__name:"ProductSuggestSearch",props:{product:{}},setup(g){const h=g,{product:s}=I(h),{unitPrice:n,displayFrom:f}=S(s),c=N(null),{width:i,height:d}=$(c);function l(t){return t?Math.ceil(t/100)*100:H}const v=D(()=>{var a;const t=i.value>d.value?`width=${l(i.value)}`:`height=${l(d.value)}`;return encodeURI(`${E((a=s.value.cover)==null?void 0:a.media)}?${t}&fit=crop,smart`)});return(t,a)=>{const y=P,w=b,x=k;return r(),u("div",j,[o("div",C,[m(y,{ref_key:"imageElement",ref:c,loading:"lazy","data-testid":"layout-search-suggest-image",src:e(v),class:"h-8 w-8 object-cover",alt:"Product image"},null,8,["src"])]),o("div",M,[o("div",z,_(e(U)(e(s),"name")),1),o("div",A,[e(n)?(r(),T(w,{key:0,"data-testid":"layout-search-suggest-price",class:"justify-end",value:e(n)},{beforePrice:V(()=>[e(f)?(r(),u("span",F,_(t.$t("product.price.from")),1)):p("",!0)]),_:1},8,["value"])):p("",!0),m(x,{"data-testid":"layout-search-suggest-units",product:e(s),"show-content":!1,class:"text-3"},null,8,["product"])])])])}}});export{X as _};