import S from"./CTAcmMAz.js";import T from"./B2sEaWda.js";import E from"./a5umXhxZ.js";import{Y as R,y as V,f as j,m as i,j as a,l as r,w as D,k as s,A as p,Z as H,i as U,p as t,t as n,v as A,C as F,_ as M}from"./BCLrUOBx.js";import{u as O}from"./BnLnKt_p.js";import{u as Y}from"./Di7fl9dA.js";import{u as Z}from"./Ce8lFovl.js";import"./Bxmfm8sn.js";const q={class:"p-tile"},G={class:"block img-wrapper"},J={key:0,class:"badge"},K=["title"],Q=["src","title","alt"],W={class:"item-title"},X={class:"block mtb-5"},tt={class:"f-10 ml-5 semi-bold color-lite"},et={class:"flex wrap start"},st={class:"price-wrapper"},ot={key:0,class:"strike-through"},at={class:"price"},it={key:0,class:"discount ml-10"},ft={__name:"ProductTile",props:{product:{type:Object,default(){return null}},isLazyImage:{type:Boolean,default:!0},compared:{type:Boolean,default:!1},titleEllipsis:{type:Number,default:2}},emits:["removed"],setup(g,{expose:h,emit:k}){const b=g,{product:e,isLazyImage:y,compared:lt,titleEllipsis:v}=R(b),w=k,{addToCompare:c}=O({product:e,emit:w});h({addToCompare:c});const{prevPrice:m,currentPricing:C,reducedPercent:u}=Y({product:e}),{getThumbImageURL:_,productLink:P}=V(),d=j(()=>{var o;return(o=e.value)==null?void 0:o.badge}),x=Z(),{setProduct:z}=x,B=()=>{z(e.value)};return(o,l)=>{const $=S,L=T,f=E,I=M;return a(),i("div",q,[r(I,{title:t(e).title,to:t(P)(t(e)),draggable:"false",class:"page-link",onClick:B},{default:D(()=>[s("span",G,[t(d)?(a(),i("span",J,n(t(d)),1)):p("",!0),H(o.$slots,"floating-btn",{},()=>[s("button",{"aria-label":"submit",class:"compare-btn",title:o.$t("product.compare"),onClick:l[0]||(l[0]=A((...N)=>t(c)&&t(c)(...N),["prevent"]))},l[1]||(l[1]=[s("i",{class:"icon reload-icon"},null,-1)]),8,K)]),t(y)?(a(),U($,{key:1,"lazy-src":t(_)(t(e).image),title:t(e).title,alt:t(e).title},null,8,["lazy-src","title","alt"])):(a(),i("img",{key:2,src:t(_)(t(e).image),title:t(e).title,alt:t(e).title,height:"50",width:"50"},null,8,Q))]),s("div",W,[s("h5",{class:F(["ellipsis",`ellipsis-${t(v)}`])},n(t(e).title),3),s("span",X,[r(L,{rating:parseFloat(t(e).rating)},null,8,["rating"]),s("span",tt,n(o.$t("productReview.reviews",{count:t(e).review_count})),1)]),s("span",et,[s("h4",st,[t(m)?(a(),i("span",ot,[r(f,{price:t(m)},null,8,["price"])])):p("",!0),s("span",at,[r(f,{price:t(C)},null,8,["price"])])]),t(u)?(a(),i("span",it," -"+n(t(u))+"%",1)):p("",!0)])])]),_:3},8,["title","to"])])}}};export{ft as default};
