1import{g as se,b as ne,X as re,a as oe,e as le,f as ie,d as de,Y as ce,W as ue,l as pe,Z as he,o as d,h as R,i as n,t as c,m as r,p as me,$ as fe,q as xe,F as be,s as ve,n as ye,a0 as A,T as ge,j as T,k as $,a1 as we,a2 as Me,r as o,c as Pe}from"./CarT9DBq.js";import{P as Ce}from"./C5sfTpJp.js";import{E as _e}from"./sDwBGIWT.js";import"./pi4H7M5y.js";const ke={class:"max-w-3xl mx-auto px-2 md:px-4 pt-3 md:pt-12 pb-16 md:pb-20"},Re={class:"flex flex-col md:flex-row md:items-center justify-between gap-1 md:gap-3 mb-4 md:mb-10"},Ae={class:"text-[18px] md:text-[28px] font-semibold tracking-tighter uppercase"},Te={class:"relative max-w-sm w-full group"},$e=["placeholder"],Ie={class:"relative space-y-1 md:space-y-12 pb-16"},Se={class:"absolute left-0 top-4 w-10 h-10 md:w-12 md:h-12 flex items-center justify-center"},Le={class:"glass relative rounded-[1.5rem] md:rounded-[2rem] p-3 md:p-6 cursor-pointer border-2 border-transparent hover:border-blue-500/20 transition-all"},Ne={class:"flex justify-between items-start mb-1 gap-2"},Ue={class:"text-[11px] md:text-xs font-bold opacity-50 block mb-0.5"},Oe={class:"text-[14px] md:text-[16px] font-semibold pr-10 md:pr-12"},Ee={class:"flex flex-col items-end gap-2 shrink-0"},Fe={class:"flex items-center gap-2"},Be=["onClick"],De=["onClick"],je=["onClick"],ze=500,Ve=600*1e3,Xe=se({__name:"trending",setup(He){const{t:i,locale:x}=ne(),{trendingMatches:I,openPredictionModal:S,selectedMatchId:j}=re(),b=oe(),{isVip:z,isAuthenticated:L,userId:V}=le(),{openLoginModal:N}=ie(),{error:H}=de(),{formatFixtureDate:Z}=ce(),u=o(""),h=o(!1),U=o(null),O=o(null),v=o(!1);let p=null;const m=o(!1),y=o("member"),g=o(null),w=o(!1),E=o(null),M=o(!1),P=o(""),C=o(""),_=(a,t)=>{const e=String(a?.[t]??"").trim();if(!e)return"";if(t==="matchResult"){const s=e.toLowerCase();if(x.value==="zh"){if(s==="home")return"主è";if(s==="draw")return"å¹³";if(s==="away")return"客è"}else{if(s==="home")return"Home Win";if(s==="draw")return"Draw";if(s==="away")return"Away Win"}}return e},W=(a,t)=>{const e=x.value==="zh",s=[t?.matchResult?`${e?"èå¹³è´":"Match Result"}ï¼${_(t,"matchResult")}`:"",t?.handicapLine?`${e?"让åèè´":"Handicap"}ï¼${_(t,"handicapLine")}`:"",t?.overUnderLine?`${e?"大å°ç":"Over/Under"}ï¼${_(t,"overUnderLine")}`:""].filter(Boolean),l=[t?.matchResult?`${e?"èå¹³è´":"Match Result"}ï¼${String((e?t?.matchReasonCn??t?.matchReason:t?.matchReason??t?.matchReasonCn)||"")}`:"",t?.handicapLine?`${e?"让åèè´":"Handicap"}ï¼${String((e?t?.handicapReasonCn??t?.handicapReason:t?.handicapReason??t?.handicapReasonCn)||"")}`:"",t?.overUnderLine?`${e?"大å°ç":"Over/Under"}ï¼${String((e?t?.overUnderReasonCn??t?.overUnderReason:t?.overUnderReason??t?.overUnderReasonCn)||"")}`:""].map(f=>f.trim()).filter(Boolean);return{match:a,personalResultLineText:s.join(" / "),personalAnalysisText:l.join(` 2 3`)}},F=a=>({...a,id:a?.fixtureId??a?.id}),G=()=>{M.value=!1,P.value="",C.value=""},q=async(a,t)=>
3{const e=await b.get("/prediction/user/predict",{params:{matchId:a,uid:t}}),s=typeof e=="object"&&e!==null&&e.data!==void 0?e.data:e;return(Array.isArray(s)?s:Array.isArray(s?.data)?s.data:[])[0]??null},X=()=>{p&&clearTimeout(p),p=setTimeout(()=>{k()},ze)},Y=Pe(()=>a=>{const e=x.value==="zh"?a.cname||a.name:a.name||a.cname;if(e)return e;const s=a.home,l=a.away;return s&&l?`${s} vs ${l}`:""}),J=a=>{const t=a?.timestamp??a?.date;if(t==null||t==="")return null;if(typeof t=="number")return t>1e12?t:t*1e3;const e=Number(t);if(!Number.isNaN(e)&&t!=="")return e>1e12?e:e*1e3;const s=new Date(t).getTime();return Number.isNaN(s)?null:s},K=a=>{const t=J(a);return t?t-Date.now()<=Ve:!1},B=a=>{if(!L.value){N(()=>B(a));return}if(!z.value){y.value="member",g.value=null,m.value=!0;return}G(),S(F(a))},Q=a=>{y.value="predict",g.value=a?.predictId||null,m.value=!0},ee=async a=>{if(K(a)){H(i("matchPredictionClosedSoon"));return}U.value=a.leagueId??a.league?.id??null,O.value=a.id;const t=a.id;try{const e=await b.get("/prediction/user/predict",{params:{matchI
3d:t,uid:V.value}}),s=typeof e=="object"&&e!==null&&e.data!==void 0?e.data:e,l=Array.isArray(s)?s:Array.isArray(s?.data)?s.data:[];v.value=l.length>0}catch{v.value=!1}h.value=!0},te=()=>{h.value=!1,k()},D=a=>{if(!L.value){N(()=>D(a));return}E.value=a,w.value=!0},ae=async a=>{const t=F(a?.match??a),e=a?.expertId;if(!(!t?.id||e===void 0||e===null||e===""))try{const s=await q(t.id,e);if(!s)return;const l={...t,...s,matchProfit:s?.matchProfit,overUnderProfit:s?.overUnderProfit,handicapProfit:s?.handicapProfit},f=W(l,s);M.value=!0,P.value=f.personalResultLineText,C.value=f.personalAnalysisText,S(l)}catch(s){console.error("Failed to fetch expert prediction detail:",s)}},k=async()=>{try{const a=await b.get("/fixture/list/hot",{params:{kw:u.value}}),t=Array.isArray(a)?a:[];I.value=t.map(e=>({id:e.fixtureId||e.id,timestamp:e.timestamp,date:e.timestamp?Z(e.timestamp):"",home:e.home,away:e.away,name:e.name,cname:e.cname,leagueId:e.leagueId??e.league?.id,type:e.type||"èå¹³è´",result:typeof e.homeGoals=="number"&&typeof e.awayGoals=="number",roi:e.roi,predictions:e.predictions||{gpt:"N/A",claude:"N/A",deepseek:"N/A"},odds:e.odds||{}}))}catch(a){console.error("Fetch hot fixtures failed",a)}};return ue(()=>{k()}),pe(u,()=>{X()}),he(()=>{p&&clearTimeout(p)}),(a,t)=>(d(),R("main",ke,[n("div",Re,[n("h2",Ae,c(r(i)("benchmark")),1),n("div",Te,[me(n("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>xe(u)?u.value=e:null),type:"text",placeholder:r(i)("searchPlaceholder"),class:"w-full bg-slate-500/5 border border-black/10 dark:border-white/10 rounded-xl px-3 md:px-4 py-2 text-xs md:text-sm outline-none focus:ring-2 ring-blue-500/30 pl-10 md:pl-12 transition-all uppercase"},null,8,$e),[[fe,r(u)]]),t[4]||(t[4]=n("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute left-3 md:left-4 top-1/2 -translate-y-1/2 opacity-40",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[n("circle",{cx:"11",cy:"11",r:"8"}),n("path",{d:"m21 21-4.3-4.3"})],-1))])]),n("div",Ie,[t[5]||(t[5]=n("div",{class:"absolute left-[20px] md:left-[23px] top-4 bottom-0 w-0.5 bg-current opacity-10"},null,-1)),(d(!0),R(be,null,ve(r(I),e=>(d(),R("div",{key:e.id,class:"relative pl-10 md:pl-12 group"},[n("div",Se,[n("div",{class:ye([e.result?"bg-slate-400":"bg-blue-600 animate-pulse","w-3 h-3 rounded-full z-10 ring-4 ring-white dark:ring-slate-900"])},null,2)]),n("div",Le,[n("div",Ne,[n("div",null,[n("span",Ue,c(e.date),1),n("h4",Oe,c(r(Y)(e)),1)]),n("div",Ee,[n("div",Fe,[n("button",{type:"button",class:"px-3 py-1 rounded-full bg-blue-50 text-blue-600 border border-blue-200 text-[11px] md:text-xs font-medium flex items-center gap-1 transition-all hover:bg-blue-100",onClick:A(s=>B(e),["stop"])},c(r(i)("aiPredict")),9,Be),n("button",{type:"button",class:"px-3 py-1 rounded-full bg-emerald-50 text-emerald-600 border border-emerald-200 text-[11px] md:text-xs font-medium flex items-center gap-1 transition-all hover:bg-emerald-100",onClick:A(s=>D(e),["stop"])},c(r(i)("expertPredict")),9,De)]),n("button",{type:"button",class:"px-4 md:px-6 py-2 md:py-2.5 rounded-full bg-gradient-to-r from-blue-500 to-indigo-600 text-white text-[11px] md:text-xs font-black uppercase tracking-[0.2em] shadow-lg hover:shadow-xl transition-all",onClick:A(s=>ee(e),["stop"])},c(r(i)("participateMatchPredict")),9,je)])])])]))),128))]),ge(Ce,{"match-id":r(j),"is-personal":r(M),"personal-result-line-text":r(P),"personal-analysis-text":r(C),model:"AI"},null,8,["match-id","is-personal","personal-result-line-text","personal-analysis-text"]),r(w)?(d(),T(_e,{key:0,match:r(E),onClose:t[1]||(t[1]=e=>w.value=!1),onOpenPersonalPrediction:ae,onOpenSubscribe:Q},null,8,["match"])):$("",!0),r(h)?(d(),T(we,{key:1,"league-id":r(U),"match-id":r(O),"is-edit":r(v),onClose:t[2]||(t[2]=e=>h.value=!1),onSubmitted:te},null,8,["league-id","match-id","is-edit"])):$("",!0),r(m)?(d(),T(Me,{key:2,"sub-type":r(y),"predict-id":r(g),onClose:t[3]||(t[3]=e=>m.value=!1)},null,8,["sub-type","predict-id"])):$("",!0)]))}});export{Xe 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.