var B=(w,k,c)=>new Promise((p,n)=>{var d=s=>{try{i(c.next(s))}catch(o){n(o)}},m=s=>{try{i(c.throw(s))}catch(o){n(o)}},i=s=>s.done?p(s.value):Promise.resolve(s.value).then(d,m);i((c=c.apply(w,k)).next())});import{d as $,s as z,r as I,f as S,g as e,z as A,B as b,_ as N,D as y,o as v,h as t,E as L,F as r,j as P,G as R,H as V,I as q,K as T,l as j,n as C,N as G,L as u,M as f,O,P as Q,Q as H,R as K,q as M}from"./index-C8qz7c0N.js";import{_ as U}from"./wd-navbar.CJYSDs2G.js";import{_ as Z}from"./z-paging.Dxcf6OUf.js";import{u as J}from"./useZPaging.DLVc1w-R.js";import{a as W}from"./product.BDPn1wDu.js";const X="/static/icons/seller-nav.png",Y="/static/icons/fire.png",ee=$({name:"BestSellers",__name:"bestSellers",setup(w){const c=z().safeAreaInsets,p=I(null);J(p);const n=I([]);function d(s,o){return B(this,null,function*(){try{const _=yield W({page:s,size:o});p.value.complete(_.data.list)}catch(_){p.value.complete(!1)}})}function m(s){return{0:"#DEA90B",1:"#5E719E",2:"#D47128"}[s]||"#A5ADBD"}function i(s){return s+1}return(s,o)=>{const _=b(y("wd-icon"),N),a=P,D=b(y("wd-navbar"),U),x=j,g=G,F=b(y("z-paging"),Z),E=A("layout-default-uni");return v(),S(E,null,{default:e(()=>[t(F,{ref_key:"paging",ref:p,modelValue:r(n),"onUpdate:modelValue":o[1]||(o[1]=l=>L(n)?n.value=l:null),"use-page-scroll":"",onQuery:d},{top:e(()=>{var l;return[t(a,{class:"relative from-[#FA2B19] to-[#FE6232] bg-gradient-to-br",style:C({paddingTop:`${(l=r(c))==null?void 0:l.top}px`})},{default:e(()=>[t(D,{bordered:!1,"custom-class":"bg-transparent!"},{left:e(()=>[t(_,{name:"thin-arrow-left",color:"#fff",size:"32rpx",onClick:o[0]||(o[0]=()=>r(K)())})]),title:e(()=>[t(a,{class:"text-white font-bold text-32rpx!"},{default:e(()=>[u(f(s.$t("bestSellers.title")),1)]),_:1})]),_:1}),t(x,{src:X,class:"absolute bottom-12rpx right-12rpx h-166.27rpx w-180rpx"})]),_:1},8,["style"])]}),default:e(()=>[t(a,{class:"pt-20rpx"},{default:e(()=>[(v(!0),R(V,null,q(r(n),(l,h)=>(v(),S(a,{key:l.productId,class:"mb-20rpx mb-20rpx flex items-center gap-24rpx bg-white p-24rpx",onClick:te=>r(T)({url:"/pages/productDetail/productDetail",params:{productId:l.productId}})},{default:e(()=>[t(a,{class:"relative"},{default:e(()=>[t(a,{class:"h-160rpx w-160rpx shrink-0"},{default:e(()=>[t(x,{src:l.image,class:"h-full w-full",mode:"aspectFit"},null,8,["src"])]),_:2},1024),t(a,{class:"absolute left-10rpx top-10rpx h-52rpx w-48rpx flex items-center justify-center rounded-4rpx text-20rpx text-white font-bold",style:C({backgroundColor:m(h),clipPath:"polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%)"})},{default:e(()=>[t(a,{class:"flex flex-col items-center leading-none"},{default:e(()=>[t(g,{class:"text-16rpx"},{default:e(()=>[u(" TOP ")]),_:1}),t(g,{class:"text-18rpx"},{default:e(()=>[u(f(i(h)),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["style"])]),_:2},1024),t(a,{class:"flex-1"},{default:e(()=>[t(a,{class:"line-clamp-2 mb-3px h-80rpx break-all text-28rpx"},{default:e(()=>[u(f(l.productName),1)]),_:2},1024),t(a,{class:"mb-3px text-28rpx text-#FF0010"},{default:e(()=>[u(" ৳ "+f(r(O)(l.price)),1)]),_:2},1024),t(a,{class:"flex items-center rounded-8rpx from-white via-[rgba(255,210,212,0.58)] to-[rgba(255,0,16,0.2)] bg-gradient-to-l px-10rpx py-6rpx text-24rpx text-#FF0010"},{default:e(()=>[t(x,{src:Y,class:"mr-8rpx h-24rpx w-24rpx"}),t(g,null,{default:e(()=>[u(f(r(Q)("bestSellers.successfullyGrouped",[r(H)(l.sales)])),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue"])]),_:1})}}}),ce=M(ee,[["__scopeId","data-v-0ab0e4d8"]]);export{ce as default};
