PageSourceSearch

https://bacctrack-7ha7hyw7.manus.space/assets/StatisticsPage-5dlt3eOO.js

js bacctrack-7ha7hyw7.manus.space collected 2026-10-03 05:00:33 UTC 14,746 bytes, 1 lines download raw bytes

1import{t as f,r as j,j as t,C,e as T}from"./index-C3Qps0S4.js";import{F as N}from"./flame-ClgW77Uq.js";import{T as b}from"./trending-up-Dq4_iocl.js";import{T as A}from"./target-FUBQRvNw.js";function D(){const{data:h}=f.sessions.list.useQuery(),[y,k]=j.useState(null),P=y??h?.[0]?.id??null,{data:v}=f.sessions.get.useQuery({id:P},{enabled:!!P}),c=v?.rounds??[],e=j.useMemo(()=>{if(c.length===0)return{totalHands:0,bankerCount:0,playerCount:0,tieCount:0,bankerPct:"0.0",playerPct:"0.0",tiePct:"0.0",longestBankerStreak:0,longestPlayerStreak:0,longestTieStreak:0,currentStreak:{type:"",length:0},last20:[]};const s=c.length,n=c.filter(l=>l.result==="banker").length,x=c.filter(l=>l.result==="player").length,u=c.filter(l=>l.result==="tie").length;let r=0,g=0,d=0,p="",m=0,o=0,a=0,S=0;for(const l of c)l.result==="banker"?(o++,a=0,S=0):l.result==="player"?(a++,o=0,S=0):(S++,o=0,a=0),r=Math.max(r,o),g=Math.max(g,a),d=Math.max(d,S);if(c.length>0){p=c[c.length-1].result,m=1;for(let l=c.length-2;l>=0&&c[l].result===p;l--)m++}const w=c.slice(-20).map(l=>l.result);return{totalHands:s,bankerCount:n,playerCount:x,tieCount:u,bankerPct:(n/s*100).toFixed(1),playerPct:(x/s*100).toFixed(1),tiePct:(u/s*100).toFixed(1),longestBankerStreak:r,longestPlayerStreak:g,longestTieStreak:d,currentStreak:{type:p,length:m},last20:w}},[c]),i=j.useMemo(()=>{if(c.length<4)return{streak:"N/A",alternating:"N/A",dragon:"N/A",pingpong:"N/A"};const s=c.map(a=>a.result).filter(a=>a!=="tie"),n=s.length;if(n<4)return{streak:"N/A",alternating:"N/A",dragon:"N/A",pingpong:"N/A"};let x=1;for(let a=n-2;a>=0&&s[a]===s[n-1];a--)x++;const u=x>=4?"Strong":x>=2?"Active":"Low",r=s.slice(-8);let g=0;for(let a=1;a<r.length;a++)r[a]!==r[a-1]&&g++;const d=r.length>1?g/(r.length-1):0,p=d>.7?"Strong":d>.5?"Moderate":"Low",m=x>=5?"Active":x>=3?"Forming":"Low",o=d>.8?"Active":d>.6?"Detected":"Low";return{streak:u,alternating:p,dragon:m,pingpong:o}},[c]);return t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:138",className:"space-y-4",children:[t.jsxs("h1",{"data-loc":"client/src/pages/StatisticsPage.tsx:139",className:"text-xl font-bold text-gold-gradient flex items-center gap-2",children:[t.jsx(C,{"data-loc":"client/src/pages/StatisticsPage.tsx:140",className:"w-5 h-5 text-orange-400"}),"สถิติขั้นสูง"]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:145",className:"glass-card rounded-xl p-3",children:[t.jsx("label",{"data-loc":"client/src/pages/StatisticsPage.tsx:146",className:"text-[10px] text-gray-500 mb-1 block",children:"เลือกเซสชัน"}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:147",className:"relative",children:[t.jsxs("select",{"data-loc":"client/src/pages/StatisticsPage.tsx:148",value:P??"",onChange:s=>k(Number(s.target.value)||null),className:"w-full bg-black/60 border border-red-500/20 rounded-lg px-3 py-2 text-sm text-white appearance-none",children:[h?.map(s=>t.jsxs("option",{"data-loc":"client/src/pages/StatisticsPage.tsx:154",value:s.id,children:[s.name," (",s.totalRounds," ตา)"]},s.id)),(!h||h.length===0)&&t.jsx("option",{"data-loc":"client/src/pages/StatisticsPage.tsx:159",value:"",children:"ยังไม่มีเซสชัน"})]}),t.jsx(T,{"data-loc":"client/src/pages/StatisticsPage.tsx:162",className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500 pointer-events-none"})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:167",className:"glass-card-orange rounded-2xl p-4 text-center",children:[t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:168",className:"text-xs text-gray-400",children:"จำนวนตาทั้งหมด"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:169",className:"text-4xl font-bold text-white mt-1",children:e.totalHands}),e.currentStreak.type&&e.currentStreak.length>1&&t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:171",className:"text-xs text-orange-400 mt-1",children:["Streak ปัจจุบัน: ",e.currentStreak.type==="banker"?"Banker":e.currentStreak.type==="player"?"Player":"Tie"," x",e.currentStreak.length]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:178",className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:179",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:180",className:"w-8 h-8 mx-auto rounded-full bg-[#EF4444] flex items-center justify-center text-xs font-bold text-white mb-1.5",children:"B"}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:183",className:"text-lg font-bold text-white",children:[e.bankerPct,"%"]}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:184",className:"text-[10px] text-gray-400",children:["Banker (",e.bankerCount,")"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:186",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:187",className:"w-8 h-8 mx-auto rounded-full bg-[#3B82F6] flex items-center justify-center text-xs font-bold text-white mb-1.5",children:"P"}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:190",className:"text-lg font-bold text-white",children:[e.playerPct,"%"]}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:191",className:"text-[10px] text-gray-400",children:["Player (",e.playerCount,")"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:193",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:194",className:"w-8 h-8 mx-auto rounded-full bg-[#22C55E] flex items-center justify-center text-xs font-bold text-white mb-1.5",children:"T"}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:197",className:"text-lg font-bold text-white",children:[e.tiePct,"%"]}),t.jsxs("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:198",className:"text-[10px] text-gray-400",children:["Tie (",e.tieCount,")"]})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:203",className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:204",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx(N,{"data-loc":"client/src/pages/StatisticsPage.tsx:205",className:"w-4 h-4 text-red-400 mx-auto mb-1"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:206",className:"text-xl font-bold text-red-400",children:e.longestBankerStreak}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:207",className:"text-[10px] text-gray-400",children:"B Streak สูงสุด"})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:209",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx(N,{"data-loc":"client/src/pages/StatisticsPage.tsx:210",className:"w-4 h-4 text-blue-400 mx-auto mb-1"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:211",className:"text-xl font-bold text-blue-400",children:e.longestPlayerStreak}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:212",className:"text-[10px] text-gray-400",children:"P Streak สูงสุด"})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:214",className:"glass-card rounded-xl p-3 text-center",children:[t.jsx(N,{"data-loc":"client/src/pages/StatisticsPage.tsx:215",className:"w-4 h-4 text-green-400 mx-auto mb-1"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:216",className:"text-xl font-bold text-green-400",children:e.longestTieStreak}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:217",className:"text-[10px] text-gray-400",children:"T Streak สูงสุด"})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:222",className:"glass-card rounded-xl p-3",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:223",className:"flex items-center gap-2 mb-2",children:[t.jsx(b,{"data-loc":"client/src/pages/StatisticsPage.tsx:224",className:"w-4 h-4 text-orange-400"}),t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:225",className:"text-xs font-medium text-white",children:"20 ตาล่าสุด"})]}),e.last20.length>0?t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:228",className:"flex flex-wrap gap-1",children:e.last20.map((s,n)=>t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:230",className:`w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold text-white ${s==="banker"?"bg-[#EF4444]":s==="player"?"bg-[#3B82F6]":"bg-[#22C55E]"}`,children:s==="banker"?"B":s==="player"?"P":"T"},n))}):t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:245",className:"text-xs text-gray-500 text-center py-2",children:"ยังไม่มีข้อมูล"})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:250",className:"glass-card-orange rounded-2xl p-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:251",className:"flex items-center gap-2 mb-3",children:[t.jsx(b,{"data-loc":"client/src/pages/StatisticsPage.tsx:252",className:"w-4 h-4 text-orange-400"}),t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:253",className:"text-sm font-medium text-white",children:"การกระจายตัว"})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:255",className:"space-y-2",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:256",className:"flex justify-between items-center",children:[t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:257",className:"text-xs text-gray-400 w-14",children:"Banker"}),t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:258",className:"flex-1 mx-3 h-3 rounded-full bg-black/40 overflow-hidden",children:t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:259",className:"h-full bg-gradient-to-r from-red-500 to-red-400 rounded-full transition-all duration-500",style:{width:`${e.bankerPct}%`}})}),t.jsxs("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:261",className:"text-xs text-red-400 w-12 text-right",children:[e.bankerPct,"%"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:263",className:"flex justify-between items-center",children:[t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:264",className:"text-xs text-gray-400 w-14",children:"Player"}),t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:265",className:"flex-1 mx-3 h-3 rounded-full bg-black/40 overflow-hidden",children:t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:266",className:"h-full bg-gradient-to-r from-blue-500 to-blue-400 rounded-full transition-all duration-500",style:{width:`${e.playerPct}%`}})}),t.jsxs("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:268",className:"text-xs text-blue-400 w-12 text-right",children:[e.playerPct,"%"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:270",className:"flex justify-between items-center",children:[t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:271",className:"text-xs text-gray-400 w-14",children:"Tie"}),t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:272",className:"flex-1 mx-3 h-3 rounded-full bg-black/40 overflow-hidden",children:t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:273",className:"h-full bg-gradient-to-r from-green-500 to-green-400 rounded-full transition-all duration-500",style:{width:`${e.tiePct}%`}})}),t.jsxs("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:275",className:"text-xs text-green-400 w-12 text-right",children:[e.tiePct,"%"]})]})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:281",className:"glass-card rounded-2xl p-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:282",className:"flex items-center gap-2 mb-3",children:[t.jsx(A,{"data-loc":"client/src/pages/StatisticsPage.tsx:283",className:"w-4 h-4 text-orange-400"}),t.jsx("span",{"data-loc":"client/src/pages/StatisticsPage.tsx:284",className:"text-sm font-medium text-white",children:"Pattern Detection"})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:286",className:"grid grid-cols-2 gap-2",children:[t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:287",className:"bg-black/40 rounded-lg p-3 text-center",children:[t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:288",className:"text-[10px] text-gray-400",children:"Streak"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:289",className:`text-sm font-bold mt-0.5 ${i.streak==="Strong"?"text-orange-400":i.streak==="Active"?"text-yellow-400":"text-gray-500"}`,children:i.streak})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:293",className:"bg-black/40 rounded-lg p-3 text-center",children:[t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:294",className:"text-[10px] text-gray-400",children:"Alternating"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:295",className:`text-sm font-bold mt-0.5 ${i.alternating==="Strong"?"text-blue-400":i.alternating==="Moderate"?"text-cyan-400":"text-gray-500"}`,children:i.alternating})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:299",className:"bg-black/40 rounded-lg p-3 text-center",children:[t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:300",className:"text-[10px] text-gray-400",children:"Dragon Tail"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:301",className:`text-sm font-bold mt-0.5 ${i.dragon==="Active"?"text-red-400":i.dragon==="Forming"?"text-orange-400":"text-gray-500"}`,children:i.dragon})]}),t.jsxs("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:305",className:"bg-black/40 rounded-lg p-3 text-center",children:[t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:306",className:"text-[10px] text-gray-400",children:"Ping Pong"}),t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:307",className:`text-sm font-bold mt-0.5 ${i.pingpong==="Active"?"text-green-400":i.pingpong==="Detected"?"text-emerald-400":"text-gray-500"}`,children:i.pingpong})]})]})]}),t.jsx("div",{"data-loc":"client/src/pages/StatisticsPage.tsx:315",className:"rounded-lg border border-red-500/20 bg-red-500/5 p-2.5",children:t.jsx("p",{"data-loc":"client/src/pages/StatisticsPage.tsx:316",className:"text-[10px] text-red-400/70 text-center",children:"สถิติเป็นเพียงข้อมูลอ้างอิงเท่านั้น ไม่สามารถรับประกันผลลัพธ์ในอนาคตได้"})})]})}export{D 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.