PageSourceSearch

https://trendresell.com/assets/TopSellersPage-B6pQDWCE.js

js trendresell.com collected 2026-10-02 01:46:59 UTC 44,352 bytes, 1 lines download raw bytes

1import{j as e}from"./framer-C6n3ICkC.js";import{r as n}from"./sentry-DnK0TUx-.js";import{u as we,f as Xe,D as Qe,E as Je,t as Ze,F as Ne,A as Se,B as se,b as _e,y as Ce,H as $e,L as es,l as ke,n as ss,z as ts,o as as}from"./index-BGWpaLpH.js";import{n as ls}from"./ArrowSquareOut.es-BInCTMij.js";import{s as rs}from"./CaretLeft.es-BfPnQ7vO.js";import{s as ns}from"./CaretRight.es-Me-lhmzd.js";import{n as z}from"./Clock.es-BJwYi9dH.js";import{s as V}from"./CurrencyEur.es-ZoZ3AZBS.js";import{n as Te}from"./Heart.es-DEiYiPfM.js";import{c as $,H as is}from"./HowItWorksButton-RvEX0a7i.js";import{s as cs,G as os,A as ds,g as ms}from"./AIAnalysisSection-C7yl_K12.js";import{c as D}from"./TrendUp.es-BFX0QsjT.js";import{T as xs}from"./Toast-CAc8tKtf.js";import{W as ps,S as te}from"./Sparkline-CQItkeNI.js";import{C as hs,B as gs}from"./BrandFilter-CzwYwc5q.js";import{S as Pe}from"./SimpleDropdownFilter-BvSCauqI.js";import{c as Fe}from"./categoriesTree-CN1xPfSi.js";import{u as us}from"./useCategoryTranslation-Dl5X7gc6.js";import{S as fs}from"./SEO-CEGXMWYc.js";import{f as N}from"./formatCurrency-DCEbaGG3.js";import{R as T,A as js,b as bs,X as ys,Y as vs,T as Ee,d as ws,P as Ns,a as Ss,C as I,B as ae,e as le}from"./recharts-wAJvnJnG.js";import"./Robot.es-By_0ySdq.js";import"./Calendar.es-Z3qyqoBr.js";import"./ShoppingBag.es-BAd8t_-b.js";import"./Sparkle.es-DeSYyIqq.js";import"./categoryTranslations-B9WLDRLV.js";const W=["#54b3ff","#7BC4FF","#A5D6FF","#CFE7FF","#E5F1FF","#F2F8FF"],dt=()=>{var ue,fe,je;const{t:a,i18n:Le}=we(),{t:x}=we("topSellers"),{tc:U}=us();Xe();const{subscription:_s,canSearch:Cs,incrementProfileSearch:$s,incrementTopSellersFilter:ks}=Qe(),{addToProfileHistory:Me,profileHistory:Ts}=Je(),[p,P]=n.useState(null),[Re,re]=n.useState(!0),[q,Be]=n.useState(null),[Ps,Fs]=n.useState(!1),[Es,Ls]=n.useState(""),[ne,Ae]=Ze(),[Ms,Rs]=n.useState("none"),[u,F]=n.useState(null),[h,E]=n.useState([]),[G,L]=n.useState(10),[v,ze]=n.useState({key:"totalSales",direction:"desc"}),Ve=s=>{E(s),L(10),s&&s.length>0&&F(null)},De=s=>{F(s),L(10),s&&E([])},[H,ie]=n.useState(null),[l,O]=n.useState(null),[Ie,ce]=n.useState(!1),[Bs,As]=n.useState(!1),[K,oe]=n.useState("7d"),[Y,X]=n.useState("current"),[Q,M]=n.useState(8),[R,de]=n.useState(""),[B,me]=n.useState(""),[J,We]=n.useState(!1),[o,b]=n.useState({minSales:"",maxSales:"",minPrice:"",maxPrice:"",minTime:"",maxTime:"",minRevenue:"",maxRevenue:""}),[d,xe]=n.useState(o);n.useEffect(()=>{L(10)},[d]);const Ue=!1;n.useEffect(()=>{const s=ne.get("seller");if(s&&p&&p.sellers&&!H){const t=p.sellers.find(r=>r.pseudo===s);Z(t||{pseudo:s,totalSales:0,caEstime:0}),Ae({})}},[p,ne,H]);const pe=s=>{if(!s||!s.children||s.children.length===0)return s?[s.name]:[];let t=[];for(const r of s.children)t=[...t,...pe(r)];return t},qe=(s,t)=>{if(!Array.isArray(s))return[];let r=s,i=null;for(const c of t){const g=r.find(j=>j.name===c);if(g)i=g,r=g.children||[];else return[]}return i?pe(i):[]},A=s=>{if(!s||s.length<=6)return s||[];const t=[...s].sort((g,j)=>j.nombreVentes-g.nombreVentes),r=t.slice(0,5),c=t.slice(5).reduce((g,j)=>g+j.nombreVentes,0);return[...r,{categorie:a("top_sellers.others"),nombreVentes:c}]};n.useEffect(()=>{(async()=>{re(!0);try{let t=`${Se}/sellers/top?limit=50000&week=${Y}`;u&&(t+=`&brand=${encodeURIComponent(u)}`),h&&h.length>0&&(t+=`&category_path=${encodeURIComponent(h.join(","))}`),d.minSales&&(t+=`&minSales=${d.minSales}`),d.maxSales&&(t+=`&maxSales=${d.maxSales}`),d.minPrice&&(t+=`&minPrice=${d.minPrice}`),d.maxPrice&&(t+=`&maxPrice=${d.maxPrice}`),d.minTime&&(t+=`&minTime=${d.minTime}`),d.maxTime&&(t+=`&maxTime=${d.maxTime}`),d.minRevenue&&(t+=`&minRevenue=${d.minRevenue}`),d.maxRevenue&&(t+=`&maxRevenue=${d.maxRevenue}`);const i=await(await Ne(t)).json();i.success&&i.data&&i.data.sellers?P(i.data):(console.error("Failed to load top sellers:",i.error),P({sellers:[]}))}catch(t){console.error("Error loading top sellers:",t),P({sellers:[]})}finally{re(!1)}})()},[Y,u,h,d]);const[Ge,He]=n.useState([]);n.useEffect(()=>{if(p!=null&&p.brands&&!u){const s=p.brands.filter(Boolean);He(t=>{const r=new Set(t.map(c=>c.toLowerCase())),i=[...t];for(const c of s)r.has(c.toLowerCase())||(r.add(c.toLowerCase()),i.push(c));return i.length>
1t.length?i:t})}},[p==null?void 0:p.brands,u]),n.useMemo(()=>p?[...new Set(p.sellers.map(s=>s.mainCategory))].sort():[],[p]);const Oe=n.useMemo(()=>{if(!p)return[];let s=[...p.sellers];if(h.length>0){const t=qe(Fe,h),r=h[h.length-1];s=s.filter(i=>t.includes(i.mainCategory)||i.mainCategory===r?!0:i.mainCategory.toLowerCase().includes(r.toLowerCase()))}if(v.key){const t=v.direction==="asc"?1:-1;s.sort((r,i)=>{const c=r[v.key],g=i[v.key];return typeof c=="string"&&typeof g=="string"?c.localeCompare(g,void 0,{sensitivity:"base",numeric:!0})*t:(c??0)<(g??0)?-1*t:(c??0)>(g??0)?1*t:0})}return s},[p,u,h,d,v]);n.useMemo(()=>[{id:1,pseudo:"dimi50200",totalSales:1097,caEstime:22006,avgPrice:20.06,avgSaleTime:7.4,avatar:"https://i.pravatar.cc/80?img=12"},{id:2,pseudo:"novaempire",totalSales:547,caEstime:14495,avgPrice:26.5,avgSaleTime:7.1,avatar:"https://i.pravatar.cc/80?img=32"},{id:3,pseudo:"albaguuuti",totalSales:491,caEstime:20669,avgPrice:42.1,avgSaleTime:7.5,avatar:"https://i.pravatar.cc/80?img=47"},{id:4,pseudo:"mariemode34",totalSales:389,caEstime:18230,avgPrice:46.8,avgSaleTime:5.2,avatar:"https://i.pravatar.cc/80?img=23"},{id:5,pseudo:"luxe_corner",totalSales:723,caEstime:11567,avgPrice:16,avgSaleTime:3.8,avatar:"https://i.pravatar.cc/80?img=56"},{id:6,pseudo:"sportswear_fr",totalSales:312,caEstime:8450,avgPrice:27.1,avgSaleTime:6.1,avatar:"https://i.pravatar.cc/80?img=8"},{id:7,pseudo:"vintage_finds",totalSales:198,caEstime:31200,avgPrice:157.6,avgSaleTime:9.3,avatar:"https://i.pravatar.cc/80?img=41"},{id:8,pseudo:"eco_dresser",totalSales:856,caEstime:9870,avgPrice:11.5,avgSaleTime:2.9,avatar:"https://i.pravatar.cc/80?img=19"},{id:9,pseudo:"chic_paschère",totalSales:445,caEstime:12340,avgPrice:27.7,avgSaleTime:5.6,avatar:"https://i.pravatar.cc/80?img=36"},{id:10,pseudo:"sneaker_hype",totalSales:267,caEstime:24500,avgPrice:91.8,avgSaleTime:4.1,avatar:"https://i.pravatar.cc/80?img=53"}],[]);const Ke=s=>{ze(t=>({key:s,direction:t.key===s&&t.direction==="asc"?"desc":"asc"}))},C=(s,t,r="",i="center")=>{const c=v.key===s;return e.jsx("th",{onClick:()=>Ke(s),"aria-sort":c?v.direction==="asc"?"ascending":"descending":"none",className:`${r} cursor-pointer select-none transition-colors hover:text-gray-700`,children:e.jsxs("span",{className:`inline-flex items-center gap-1 ${i==="left"?"justify-start":"justify-center w-full"}`,children:[t,e.jsx(as,{weight:"bold",className:`w-3 h-3 shrink-0 transition-transform ${c?"text-accent opacity-100":"opacity-25"} ${c&&v.direction==="asc"?"rotate-180":""}`})]})},s)},S=Oe,m=n.useMemo(()=>S.slice(0,10),[S]),Z=async s=>{var t,r,i;ie(s),ce(!0),window.scrollTo({top:0,behavior:"smooth"});try{const c=new URLSearchParams({range:"30d",skipQuota:"true"}),j=await(await Ne(`${Se}/sellers/${s.pseudo}?${c.toString()}`)).json();if(j.success){const f=j.data,be={...f,caEstime:((t=f.caEstimated)==null?void 0:t.last30d)??0,nombreArticlesVendus:((r=f.salesCounts)==null?void 0:r.last30d)??f.totalSales??0,totalSales:((i=f.salesCounts)==null?void 0:i.last30d)??f.totalSales??0};O(be),P(w=>w!=null&&w.sellers?{...w,sellers:w.sellers.map(_=>{var ye,ve;return _.pseudo===s.pseudo?{..._,totalSales:((ye=f.salesCounts)==null?void 0:ye.last7d)??_.totalSales,caEstime:((ve=f.caEstimated)==null?void 0:ve.last7d)??_.caEstime,avgPrice:f.avgPrice??_.avgPrice,avgSaleTime:f.avgSaleTime??_.avgSaleTime}:_})}:w);try{await Me({username:s.pseudo,ventes:be.totalSales,ca:s.caEstime,tempsVenteMoyen:f.avgSaleTime||0,score:0,date:new Date().toLocaleDateString(Le.language||"fr"),avatar:f.profileImage})}catch(w){console.warn("Could not save to history:",w.message)}}else console.error("Failed to load seller analysis:",j.error),O(null)}catch(c){console.error("Error loading seller analysis:",c)}finally{ce(!1)}},Ye=()=>{ie(null),O(null),de(""),me(""),M(8)},ee=s=>{if(!s&&s!==0)return"N/A";const t=a("top_sellers.time_days"),r=a("top_sellers.time_hours");if(s<1){const g=Math.round(s*24*60),j=Math.floor(g/60),f=g%60;return`${j}${r}${f.toString().padStart(2,"0")}`}const i=Math.floor(s),c=Math.round((s-i)*24);return c===24?`${i+1}${t} 0${r}`:`${i}${t} ${c}${r}`},y=n.useMemo(()=>
1{if(!(l!=null&&l.recentSales))return[];const s=new Date,t=`${String(s.getDate()).padStart(2,"0")}/${String(s.getMonth()+1).padStart(2,"0")}/${s.getFullYear()}`;return l.recentSales.filter(r=>r.date!==t)},[l==null?void 0:l.recentSales]),he=n.useMemo(()=>[...new Set(y.map(t=>t.category).filter(Boolean))].sort(),[y]),ge=n.useMemo(()=>[...new Set(y.map(t=>t.brand).filter(Boolean))].sort(),[y]),k=n.useMemo(()=>y.filter(s=>!(R&&s.category!==R||B&&s.brand!==B)),[y,R,B]);return Re?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-accent"}),e.jsx("p",{className:"mt-4 text-gray-600",children:a("top_sellers.loading")})]})}):e.jsxs("div",{className:"space-y-6 md:space-y-8",children:[q&&e.jsx(xs,{message:q.message,variant:q.variant,onClose:()=>Be(null)}),e.jsx(fs,{title:a("tools_best_sellers_title"),noindex:!0}),H?e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3 md:gap-0",children:e.jsxs("button",{onClick:Ye,className:"flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-accent transition-colors",children:[e.jsx(rs,{className:"w-4 h-4"}),a("top_sellers.back_to_list")]})}),Ie?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-accent"}),e.jsx("p",{className:"mt-4 text-gray-600",children:a("top_sellers.loading_analysis")})]})}):l&&e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsxs("div",{className:"bg-white p-4 md:p-6 rounded-xl shadow-sm border border-gray-200 flex items-center space-x-4 md:space-x-6",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative w-16 h-16 md:w-20 md:h-20 rounded-full border-4 border-gray-50 shadow-sm bg-gray-200 flex items-center justify-center overflow-hidden",children:[l.profileImage&&l.profileImage.trim()!==""&&e.jsx("img",{src:l.profileImage,alt:l.pseudo,className:"absolute inset-0 w-full h-full object-cover",onError:s=>{s.target.style.display="none"}}),e.jsx(se,{className:"w-8 h-8 md:w-10 md:h-10 text-gray-500"})]}),e.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 md:w-5 md:h-5 bg-green-500 border-2 border-white rounded-full"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h2",{className:"text-lg md:text-2xl font-bold text-gray-900",children:l.pseudo}),l.user_id&&e.jsxs("a",{href:`https://www.vinted.fr/member/${l.user_id}-${l.pseudo}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3 py-1 bg-white border border-accent text-accent text-xs font-medium rounded-full shadow-sm hover:bg-blue-50 transition-colors",title:a("top_sellers.view_on_vinted"),children:[e.jsx("span",{className:"hidden sm:inline",children:a("top_sellers.view_on_vinted")}),e.jsx(ls,{className:"w-3 h-3"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3 md:space-x-4 mt-1 text-xs md:text-sm text-gray-500",children:[e.jsxs("span",{className:"flex items-center",children:[e.jsx(_e,{className:"w-3.5 h-3.5 md:w-4 md:h-4 mr-1"})," ",l.totalSales," ",a("top_sellers.sales")]}),e.jsxs("span",{className:"flex items-center",children:[e.jsx(z,{className:"w-3.5 h-3.5 md:w-4 md:h-4 mr-1"})," ",a("top_sellers.active_recently")]})]})]})]}),e.jsxs("div",{className:"space-y-6 md:space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 h-full flex flex-col overflow-hidden",children:[e.jsx("div",{className:"p-4 md:p-6 border-b border-gray-100",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2 md:space-x-3",children:[e.jsx(D,{className:"w-5 h-5 md:w-6 md:h-6 text-accent"}),e.jsx("h3",{className:"text-base md:text-lg font-bold text-gray-900",children:a("top_sellers.sales_evolution")})]}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsxs("div",{className:"flex space-x-1 bg-gray-100 p-1 rounded-full",children:[e.jsx("button",{onClick:()=>oe("7d"),className:`px-2.5 md:px-3 py-1 text-xs font-medium rounded-full transition-colors ${K==="7d"?"bg-accent text-white":"text-gray-600 hover:bg-gray-200"}`,children:a("common.7d")}),e.jsx("button",{onClick:()=>oe("30d"),className:`px-2.5 md:px-3 py-1 text-xs font-medium rounded-full transition-colors ${K==="30d"?"bg-accent text-white":"text-gray-600 hover:bg-gray-200"}`,children:a("common.30d")})]})})]})}),e.jsx("div",{className:"p-4 md:p-6 flex-1 w-full flex flex-col",children:e.jsx("div",{className:"w-full h-[300px] md:h-[400px]",children:e.jsx(T,{width:"100%",height:"100%",children:e.jsxs(js,{data:K==="7d"?l.history7d:l.history30d,margin:{top:5,right:5,left:-20,bottom:5},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"topSellerVentesGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#54b3ff",stopOpacity:.45}),e.jsx("stop",{offset:"100%",stopColor:"#54b3ff",stopOpacity:0})]})}),e.jsx(bs,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),e.jsx(ys,{dataKey:"date",tick:{fontSize:12,fill:"#6B7280"}
1,axisLine:!1,tickLine:!1,minTickGap:30}),e.jsx(vs,{tick:{fontSize:12,fill:"#6B7280"},axisLine:!1,tickLine:!1,allowDecimals:!1,tickFormatter:s=>s>=1e3?`${((s||0)/1e3).toFixed(1)}k`:s}),e.jsx(Ee,{content:({active:s,payload:t,label:r})=>{if(s&&t&&t.length){const i=t[0].payload;return e.jsxs("div",{className:"bg-white p-3 border border-gray-200 rounded-lg shadow-lg",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 mb-2",children:r}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm text-accent font-semibold",children:[i.ventes," ",a("top_sellers.sales")]}),e.jsx("p",{className:"text-sm text-gray-900 font-semibold",children:N(i.ca)})]})]})}return null}}),e.jsx(ws,{type:"monotone",dataKey:"ventes",stroke:"#54b3ff",strokeWidth:3,fill:"url(#topSellerVentesGradient)",dot:!1,activeDot:{r:6,fill:"#54b3ff",stroke:"#fff",strokeWidth:2},animationDuration:1e3})]})})})})]})}),e.jsx("div",{className:"lg:col-span-1",children:e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-1 gap-3 md:gap-4 h-full",children:[e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx(V,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.estimated_revenue")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.estimated_revenue_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:N(((ue=l.caEstimated)==null?void 0:ue.last30d)||0)})]})}),e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx(Ce,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.avg_price")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.avg_price_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:N(l.avgPrice)})]})}),e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx(D,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.sales_count")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.sales_count_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:l.totalSales})]})}),e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx($e,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.published_listings")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg op
1acity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.published_listings_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:((fe=l.publishedCounts)==null?void 0:fe.last30d)||l.activeListings||0})]})}),e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx(cs,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.sell_through_rate")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.sell_through_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:(()=>{var c;const s=((c=l.publishedCounts)==null?void 0:c.last30d)||l.activeListings||0;if(!s||s===0)return"0%";const t=typeof s=="number"?s:parseInt(s,10),r=l.totalSales||0,i=typeof r=="number"?r:parseInt(r,10);return Math.round(i/t*100)+"%"})()})]})}),e.jsx("div",{className:"p-3 md:p-4 bg-gray-50 rounded-lg border border-gray-100 flex flex-col justify-center",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0",children:[e.jsxs("div",{className:"flex items-center space-x-1.5 md:space-x-2",children:[e.jsx(z,{className:"w-3.5 h-3.5 md:w-4 md:h-4 text-gray-500 flex-shrink-0"}),e.jsx("span",{className:"text-xs md:text-sm text-gray-500 whitespace-nowrap",children:a("top_sellers.sale_time")}),e.jsxs("div",{className:"group relative",children:[e.jsx($,{className:"w-3 h-3 text-gray-400 cursor-help"}),e.jsx("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-10",children:a("top_sellers.sale_time_tooltip")})]})]}),e.jsx("span",{className:"text-base md:text-lg font-bold text-gray-900",children:ee(l.avgSaleTime)})]})})]})})]}),y.length>0&&e.jsx(os,{soldItems:y,formatMoney:N,context:"seller"}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden",children:[e.jsx("div",{className:"p-4 md:p-6 border-b border-gray-100",children:e.jsxs("div",{className:"flex items-center space-x-2 md:space-x-3",children:[e.jsx($e,{className:"w-5 h-5 md:w-6 md:h-6 text-accent"}),e.jsx("h3",{className:"text-base md:text-lg font-bold text-gray-900",children:a("top_sellers.top_categories")})]})}),e.jsx("div",{className:"p-4 md:p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 md:gap-8 items-center",children:[e.jsx("div",{className:"h-[200px] md:h-[250px] w-full md:col-span-1",children:e.jsx(T,{width:"100%",height:"100%",children:e.jsxs(Ns,{children:[e.jsx(Ss,{data:A(l.bestSellers),cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,paddingAngle:2,dataKey:"nombreVentes",nameKey:"categorie",children:A(l.bestSellers).map((s,t)=>e.jsx(I,{fill:W[t%W.length],stroke:"#fff",strokeWidth:2},`cell-${t}`))}),e.jsx(Ee,{})]})})}),e.jsx("div",{className:"md:col-span-2 grid grid-cols-1 sm:grid-cols-2 gap-3 md:gap-4",children:A(l.bestSellers).map((s,t)=>e.jsxs("div",{className:"flex items-center justify-between p-2.5 md:p-3 bg-gray-50 rounded-lg border border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:W[t%W.length]}}),e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-900",children:U(s.categorie)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 md:gap-2",children:[e.jsx("span",{className:"text-xs md:text-sm font-bold text-gray-700",children:s.nombreVentes}),e.jsx("span",{className:"text-[10px] md:text-xs text-gray-500",children:a("top_sellers.sales")})]})]},t))})]})})]}),e.jsx(ds,{type:"seller",data:{username:l.pseudo,caEstime:((je=l.caEstimated)==null?void 0:je.last30d)||0,prixMoyen:l.avgPrice||0,nombreArticlesVendus:l.totalSales||0,tempsMoyenVendre:l.avgSaleTime||0,bestSellers:A(l.bestSellers),recentSales:l.recentSales||[]},contextName:x("ai_context_seller",{pseudo:l.pseudo}),salesCount:l.totalSales||0}),y.length>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden",children:[e.jsx("div",{className:"p-4 md:p-6 border-b border-gray-100",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center space-x-2 md:space-x-3",children:[e.jsx(_e,{className:"w-5 h-5 md:w-6 md:h-6 text-accent"}),e.jsx("h3",{className:"text-base md:text-lg font-bold text-gray-900",children:a("top_sellers.recent_sales")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[he.length>0&&e.jsx(Pe,{options:he,selectedValue:R,onChange:s=>{de(s),M(8)},placeholder:a("top_sellers.all_categories"),icon:"category"}),ge.length>0&&e.jsx(Pe,{options:ge,selectedValue:B,onChange:s=>{me(s),M(8)},placeholder:a("top_sellers.all_brands"),icon:"brand"})]})]})}),e.jsxs("div",{className:"p-4 md:p-6",children:[k.length===0?e.jsx("div",{className:"py-12 text-center bg-gray-50 rounded-lg border border-gray-100 border-dashed col-span-2 md:col-span-4",children:e.jsx("p",{className:"text-gray-500 font-medium",children:a("top_sellers.no_sales_match")})}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4",children:k.slice(0,Q).map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"group border border-gray-100 rounded-lg overflow-hidden hover:shadow-md transition-all cursor-pointer block flex flex-col h-full",children:[e.jsxs("div",{className:"aspect-[3/4] bg-gray-100 relative overflow-hidden flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100",children:e.jsx("svg",{className:"w-10 h-10 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})})}),e.jsx("img",{src:s.image,alt:s.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",onError:t=>{t.target.style.display="none"}}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent p-2 md:p-3",children:e.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("p",{className:"text-white font-bold text-sm md:text-base leading-none",children:N(s.price)})}),e.jsxs("div",{className:"flex items-center gap-1 drop-shadow-md",children:[e.jsx("span",{className:"text-white font-bold text-sm md:text-base leading-none",children:s.likes_count||0}),e.jsx(Te,{weight:(s.likes_count||0)>0?"fill":"regular",className:`w-4 h-4 md:w-5 md:h-5 ${(s.likes_count||0)>0?"text-red-500":"text-white/80"}`})]})]})})]}),e.jsxs("div",{className:"p-2 md:p-3 flex flex-col flex-1",children:[e.jsx("h4",{className:"text-xs md:text-sm font-medium text-gray-900 truncate mb-0.5",children:s.title}),(s.size_title||s.item_status)&&e.jsx("p",{className:"text-[10px] md:text-xs text-gray-900 truncate mb-1",children:[s.size_title,ms(s.item_status,a)].filter(
1Boolean).join(" - ")}),e.jsxs("div",{className:"flex justify-between items-center text-[10px] md:text-xs text-gray-900 mt-auto",children:[e.jsx("span",{children:s.date}),e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#28865b] text-white font-medium",children:a("granularity.sold")})]})]})]},s.id))}),e.jsx("div",{className:"mt-3 flex justify-end",children:e.jsxs("span",{className:"text-xs md:text-sm text-gray-500",children:[Math.min(Q,k.length)," ",a("top_sellers.of")," ",k.length]})}),Q<k.length&&e.jsx("div",{className:"mt-4 md:mt-6 flex justify-center",children:e.jsx("button",{onClick:()=>M(s=>s+8),className:"px-6 py-2.5 border border-gray-300 text-gray-700 bg-white rounded-lg font-medium hover:bg-gray-50 transition-colors shadow-sm",children:a("top_sellers.see_more")})})]})]})]})]})]}):e.jsx(e.Fragment,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3 md:gap-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-xl md:text-2xl font-bold text-gray-900",children:a("top_sellers.title")}),e.jsxs(is,{title:x("hiw_title"),children:[e.jsxs("p",{children:[x("hiw_p1_before"),e.jsx("strong",{children:x("hiw_p1_strong")}),x("hiw_p1_after")]}),e.jsxs("p",{children:[x("hiw_p2_before"),e.jsx("strong",{children:x("hiw_p2_strong")}),x("hiw_p2_after")]}),e.jsx("p",{children:x("hiw_p3")})]})]}),e.jsx("p",{className:"mt-1 text-xs md:text-sm text-gray-500",children:a("top_sellers.subtitle")})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(es,{to:"/dashboard/history?from=/top-sellers",className:"inline-flex items-center px-3 py-2 text-xs font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:a("history.button")})})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6",children:[e.jsxs("div",{className:"bg-white p-4 md:p-6 rounded-xl border border-gray-100 shadow-sm aspect-square flex flex-col relative",children:[e.jsxs("div",{className:"flex justify-between items-start z-10 w-full mb-2",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-500",children:a("top_sellers.avg_revenue")}),e.jsx(Ce,{className:"w-4 h-4 md:w-5 md:h-5 text-gray-700"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 mt-2 w-full ",children:[e.jsx("span",{className:"text-xl md:text-3xl font-bold text-gray-900 mb-3 md:mb-4",children:m.length>0?N(m.reduce((s,t)=>s+t.caEstime,0)/m.length):"-"}),e.jsx("div",{className:"w-full h-[80px]",children:e.jsx(T,{width:"100%",height:"100%",children:e.jsx(ae,{data:m,barSize:15,children:e.jsx(le,{dataKey:"caEstime",radius:[4,4,0,0],children:m.map((s,t)=>e.jsx(I,{fill:"#54b3ff"},`cell-${t}`))})})})})]})]}),e.jsxs("div",{className:"bg-white p-4 md:p-6 rounded-xl border border-gray-100 shadow-sm aspect-square flex flex-col relative",children:[e.jsxs("div",{className:"flex justify-between items-start z-10 w-full mb-2",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-500",children:a("top_sellers.avg_price")}),e.jsx(V,{className:"w-4 h-4 md:w-5 md:h-5 text-gray-700"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 mt-2 w-full ",children:[e.jsx("span",{className:"text-xl md:text-3xl font-bold text-gray-900 mb-3 md:mb-4",children:m.length>0?(m.reduce((s,t)=>s+(t.avgPrice||0),0)/m.length).toFixed(0)+"€":"-"}),e.jsx("div",{className:"w-full h-[80px]",children:e.jsx(T,{width:"100%",height:"100%",children:e.jsx(ae,{data:m,barSize:15,children:e.jsx(le,{dataKey:"avgPrice",radius:[4,4,0,0],children:m.map((s,t)=>e.jsx(I,{fill:"#54b3ff"},`cell-${t}`))})})})})]})]}),e.jsxs("div",{className:"bg-white p-4 md:p-6 rounded-xl border border-gray-100 shadow-sm aspect-square flex flex-col relative",children:[e.jsxs("div",{className:"flex justify-between items-start z-10 w-full mb-2",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-500",children:a("top_sellers.sales_count")}),e.jsx(D,{className:"w-4 h-4 md:w-5 md:h-5 text-gray-700"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 mt-2 w-full ",children:[e.jsx("span",{className:"text-xl md:text-3xl font-bold text-gray-900 mb-3 md:mb-4",children:m.length>0?m.reduce((s,t)=>s+t.totalSales,0):"-"}),e.jsx("div",{className:"w-full h-[80px]",children:e.jsx(T,{width:"100%",height:"100%",children:e.jsx(ae,{data:m,barSize:15,children:e.jsx(le,{dataKey:"totalSales",radius:[4,4,0,0],children:m.map((s,t)=>e.jsx(I,{fill:"#54b3ff"},`cell-${t}`))})})})})]})]}),e.jsxs("div",{className:"bg-white p-4 md:p-6 rounded-xl border border-gray-100 shadow-sm aspect-square flex flex-col relative w-full",children:[e.jsxs("div",{className:"flex justify-between items-start z-10 w-full mb-2",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-500",children:a("top_sellers.sale_speed")}),e.jsx(z,{className:"w-4 h-4 md:w-5 md:h-5 text-gray-700"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 mt-2 w-full ",children:[e.jsx("span",{className:"text-xl md:text-3xl font-bold text-gray-900 mb-3 md:mb-4",children:m.length>0?ee((()=>{const s=m.filter(t=>t.avgSaleTime!==null);return s.length===0?null:s.reduce((t,r)=>t+r.avgSaleTime,0)/s.length})()):"-"}),e.jsx("div",{className:"w-full h-[80px] flex items-center",children:e.jsxs("div",{className:"w-full relative px-2",children:[e.jsx("div",{className:"h-3 w-full rounded-full bg-gradient-to-r from-[#54b3ff] to-[#CFE7FF]"}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-400 mt-2 font-medium w-full",children:[e.jsx("span",{children:a("top_sellers.fast")}),e.jsx("span",{children:a("top_sellers.slow")})]}),e.jsx("div",{className:"absolute top-[-8px] transform -translate-x-1/2 flex flex-col items-center transition-all duration-500 z-20",style:{left:`${Math.min(100,Math.max(0,m.reduce((s,t)=>s+t.avgSaleTime,0)/m.length/7*100))}%`},children:e.jsx("div",{className:"w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[8px] border-t-gray-800"})})]})})]})]})]}),e.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-gray-200 mb-6",children:[e.jsx("div",{className:"flex flex-col gap-4",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-end md:items-center",children:[e.jsx("div",{className:"flex-1 w-full",children:e.jsx(hs,{data:Fe||[],selectedPath:h,onChange:Ve,showAllButton:!0})}),e.jsx("div",{className:"flex-1 w-full",children:e.jsx(gs,{selectedBrand:u,onChange:De,externalBrands:Ge})}),e.jsx("div",{className:"w-full md:w-64",children:e.jsx(ps,{selectedWeek:Y,onCh
1ange:X})})]})}),(u||h.length>0)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-4 pt-3 border-t border-gray-100",children:[e.jsx("span",{className:"text-xs text-gray-500",children:a("top_sellers.active_filters")}),h.length>0&&e.jsx("span",{className:"px-2 py-1 bg-white text-accent text-xs font-medium rounded-md border border-accent",children:h.map(U).join(" › ")}),u&&e.jsx("span",{className:"px-2 py-1 bg-white text-accent text-xs font-medium rounded-md border border-accent",children:u}),e.jsxs("button",{onClick:()=>{F(null),E([]),X("current")},className:"text-xs text-red-600 hover:text-red-800 ml-auto flex items-center gap-1",children:[e.jsx(ke,{className:"w-3 h-3"}),a("top_sellers.clear_all")]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 relative overflow-hidden",children:[e.jsx("div",{className:"p-6 border-b border-gray-100",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(ss,{className:"w-6 h-6 text-accent mr-3"}),e.jsxs("h2",{className:"text-xs md:text-xl font-bold text-gray-900",children:[a("top_sellers.title")," ",u?`- ${u}`:h.length>0?`- ${U(h[h.length-1])}`:""]})]}),e.jsx("div",{className:"w-auto",children:e.jsxs("button",{onClick:()=>We(!J),className:"flex items-center justify-between w-auto px-3 py-2 text-sm bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-hidden sm:mr-2",children:[e.jsx("div",{className:"p-1 bg-gray-100 rounded text-gray-500 flex-shrink-0",children:e.jsx(ts,{className:"w-4 h-4"})}),e.jsx("span",{className:"hidden sm:inline text-sm text-gray-700 truncate",children:a("top_sellers.advanced_filters")})]}),e.jsx(ns,{className:`hidden sm:block w-4 h-4 text-gray-400 transition-transform ${J?"rotate-90":""}`})]})})]})}),J&&e.jsxs("div",{className:"p-4 bg-gray-50 border-b border-gray-200 animate-in fade-in slide-in-from-top-2",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium uppercase text-gray-500 mb-1.5 flex items-center gap-1",children:[e.jsx(V,{className:"w-3 h-3"})," ",a("top_sellers.revenue_label")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",placeholder:x("min"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.minRevenue,onChange:s=>b({...o,minRevenue:s.target.value})}),e.jsx("span",{className:"text-gray-400",children:"-"}),e.jsx("input",{type:"number",placeholder:x("max"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.maxRevenue,onChange:s=>b({...o,maxRevenue:s.target.value})})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium uppercase text-gray-500 mb-1.5 flex items-center gap-1",children:[e.jsx(D,{className:"w-3 h-3"})," ",a("top_sellers.sales_label")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",placeholder:x("min"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.minSales,onChange:s=>b({...o,minSales:s.target.value})}),e.jsx("span",{className:"text-gray-400",children:"-"}),e.jsx("input",{type:"number",placeholder:x("max"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.maxSales,onChange:s=>b({...o,maxSales:s.target.value})})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium uppercase text-gray-500 mb-1.5 flex items-center gap-1",children:[e.jsx(V,{className:"w-3 h-3"})," ",a("top_sellers.price_label")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",placeholder:x("min"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.minPrice,onChange:s=>b({...o,minPrice:s.target.value})}),e.jsx("span",{className:"text-gray-400",children:"-"}),e.jsx("input",{type:"number",placeholder:x("max"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.maxPrice,onChange:s=>b({...o,maxPrice:s.target.value})})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium uppercase text-gray-500 mb-1.5 flex items-center gap-1",children:[e.jsx(z,{className:"w-3 h-3"})," ",a("top_sellers.speed_label")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",placeholder:x("min"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.minTime,onChange:s=>b({...o,minTime:s.target.value})}),e.jsx("span",{className:"text-gray-400",children:"-"}),e.jsx("input",{type:"number",placeholder:x("max"),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-accent",value:o.maxTime,onChange:s=>b({...o,maxTime:s.target.value})})]})]})]}),e.jsxs("div",{className:"mt-4 flex justify-between items-center border-t border-gray-200 pt-3",children:[Object.values(o).some(s=>
1s!=="")?e.jsxs("button",{onClick:()=>{const s={minRevenue:"",maxRevenue:"",minSales:"",maxSales:"",minPrice:"",maxPrice:"",minTime:"",maxTime:""};b(s),xe(s)},className:"text-xs text-red-500 hover:text-red-700 font-medium flex items-center transition-colors",children:[e.jsx(ke,{className:"w-3 h-3 mr-1"}),a("top_sellers.clear_all")]}):e.jsx("div",{}),e.jsx("button",{onClick:()=>xe({...o}),className:"px-4 py-1.5 bg-accent text-white text-xs font-medium rounded-md hover:bg-accent/90 transition-colors",children:a("top_sellers.apply_filters")})]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 text-xs text-gray-500 uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 md:px-6 py-3 text-center font-medium",children:a("top_sellers.rank")}),C("pseudo",a("top_sellers.seller"),"px-2 md:px-6 py-3 text-left font-medium","left"),C("caEstime",a("top_sellers.estimated_revenue"),"table-cell px-3 md:px-6 py-3 text-center font-medium whitespace-nowrap"),C("totalSales",a("top_sellers.sales_count"),"table-cell px-3 md:px-6 py-3 text-center font-medium whitespace-nowrap"),C("avgPrice",a("top_sellers.avg_price"),"table-cell px-3 md:px-6 py-3 text-center font-medium whitespace-nowrap"),C("avgSaleTime",a("top_sellers.sale_time"),"table-cell px-3 md:px-6 py-3 text-center font-medium whitespace-nowrap"),C("avgLikes",a("top_sellers.favorites"),"px-2 md:px-6 py-3 text-center font-medium whitespace-nowrap")]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 ",children:S.length>0?S.slice(0,G).map((s,t)=>e.jsxs("tr",{onClick:()=>Z(s),className:"hover:bg-blue-50 transition-colors group cursor-pointer",children:[e.jsx("td",{className:"px-2 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsx("span",{className:"font-bold text-xs md:text-sm text-gray-500",children:t+1})}),e.jsx("td",{className:"px-2 md:px-6 py-3 md:py-4",children:e.jsxs("div",{className:"flex items-center",children:[e.jsxs("div",{className:"relative w-8 h-8 md:w-10 md:h-10 rounded-full border-2 border-gray-200 bg-gray-200 flex items-center justify-center overflow-hidden",children:[s.avatar&&s.avatar.trim()!==""&&e.jsx("img",{src:s.avatar,alt:s.pseudo,className:"absolute inset-0 w-full h-full object-cover",onError:r=>{r.target.style.display="none"}}),e.jsx(se,{className:"w-4 h-4 md:w-5 md:h-5 text-gray-500"})]}),e.jsxs("div",{className:"ml-2 md:ml-4",children:[e.jsx("div",{className:"text-xs md:text-base font-medium text-gray-900 group-hover:text-accent transition-colors",children:s.pseudo}),e.jsxs("div",{className:"text-[10px] md:text-xs text-gray-500 hidden md:block",children:["@",s.pseudo]})]})]})}),e.jsx("td",{className:"table-cell px-3 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsxs("div",{className:"inline-flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-700",children:N(s.caEstime)}),e.jsx(te,{color:"#54b3ff",data:s.revenueTrend})]})}),e.jsx("td",{className:"table-cell px-3 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsxs("div",{className:"inline-flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-700",children:s.totalSales}),e.jsx(te,{color:"#54b3ff",data:s.salesTrend})]})}),e.jsx("td",{className:"table-cell px-3 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-700",children:N(s.avgPrice)})}),e.jsx("td",{className:"table-cell px-3 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsx("span",{className:"text-xs md:text-sm font-medium text-gray-700",children:ee(s.avgSaleTime)})}),e.jsx("td",{className:"px-2 md:px-6 py-3 md:py-4 whitespace-nowrap text-center",children:e.jsxs("div",{className:"inline-flex flex-col items-center gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs md:text-sm font-medium text-gray-700",children:[e.jsx(Te,{weight:"fill",className:"w-3.5 h-3.5 text-rose-500"}),s.avgLikes!=null?Math.ceil(Number(s.avgLikes)):"—"]}),e.jsx(te,{data:s.likesTrend})]})})]},s.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:"7",className:"px-6 py-12 text-center bg-white border-t border-gray-100",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"p-3 bg-gray-50 rounded-full shadow-sm mb-4",children:e.jsx(se,{className:"w-6 h-6 text-gray-400"})}),e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:a("top_sellers.no_seller")}),e.jsx("p",{className:"text-gray-500 mt-1 max-w-sm mx-auto",children:u?a("top_sellers.no_seller_brand_desc",{brand:u}):a("top_sellers.no_seller_desc")}),e.jsx("button",{onClick:()=>{F(null),E([]),X("current")},className:"mt-4 text-accent hover:text-accent font-medium text-sm",children:a("top_sellers.reset_filters")})]})})})})]})}),e.jsx("div",{className:"mt-3 flex justify-end px-4 md:px-6",children:e.jsxs("span",{className:"text-xs md:text-sm text-gray-500",children:[Math.min(G,S.length)," ",a("common.of")," ",S.length]})}),G<S.length&&e.jsx("div",{className:"mt-4 md:mt-6 flex justify-center pb-4",children:e.jsx("button",{onClick:()=>L(s=>s+10),className:"px-6 py-2.5 border border-gray-300 text-gray-700 bg-white rounded-lg font-medium hover:bg-gray-50 transition-colors shadow-sm",children:a("common.see_more")})}),Ue]})]})})]})};export{dt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.