1import{r as i,j as t}from"./index-BmUWOtyf.js";import R from"./DigTreasureGame-Curg6tfv.js";function j(n){const s={};return{on(e,u){(s[e]||(s[e]=[])).push(u)},off(e,u){s[e]=(s[e]||[]).filter(a=>a!==u)},emit(e){e==="digTreasure"&&n.handleDig()},_fire(e,u){(s[e]||[]).forEach(a=>a(u))}}}const y=["è·¯é人é","å¤è²å","æ
人ç²"];function T(){const[n,s]=i.useState(!1),[e,u]=i.useState(5),[a,h]=i.useState(1),[c,p]=i.useState(20),[m,x]=i.useState(15),d=i.useRef(0),l=i.useRef(0),o=i.useRef(j({handleDig:()=>{if(d.current>=e){o.current._fire("digTreasureRejected",{reason:"已鿬ååæå¯¶æ¬¡æ¸ä¸é"});return}const r=a+Math.floor(Math.random()*(c-a+1));d.current+=1,l.current+=r,o.current._fire("digTreasureResult",{reward:r,digsUsed:d.current,digsLeft:e-d.current,totalReward:l.current})}})),b=()=>{n||(s(!0),d.current=0,l.current=0,o.current._fire("digGameWarn",{secondsLeft:5}),setTimeout(()=>{o.current._fire("digGameStart",{duration:m,maxDigs:e,rewardMin:a,rewardMax:c}),setTimeout(()=>{o.current._fire("digGameEnd"),setTimeout(()=>{const r={};l.current>0&&(r.å°æ=l.current),y.forEach(f=>{if(Math.random()<.7){r[f]=0;for(let g=0;g<e;g++)Math.random()<.8&&(r[f]+=a+Math.floor(Math.random()*(c-a+1)))}}),o.current._fire("digGameResult",{rewards:r}),s(!1)},600)},m*1e3)},5e3))};return t.jsxs("main",{style:{minHeight:"100vh",padding:24,background:"linear-gradient(180deg, #101010, #1a1a1a)",color:"#eee",fontFamily:"Arial, sans-serif"},children:[t.jsx("h1",{style:{marginTop:0},children:"âï¸ æå¯¶éæ² Demo"}),t.jsx("p",{style:{opacity:.75,maxWidth:560},children:"å
¨è¢å¹è¦èå±¤çæ¬çå±ç¤ºé ï¼ä¸é£ççå¾ç«¯ï¼ç¨åç socket äºä»¶æ¨¡æ¬ãéå§å 30 ç§é åï¼demo ç¸®çæ 5 ç§ï¼ããé姿坶ããæ¯æ¬¡æå¯¶ä¼ºæå¨å³ææ²åºé¨æ©çåµããæéå°çµ±ä¸çµç®ãæ´åæµç¨ã æçåååºå®æ¯ãå°æãï¼å¦å¤æ¨¡æ¬äº 3 ä½å
¶ä»ç©å®¶çæå¯¶æç¸¾ç¨ä¾ççµç®ç«é¢çæè¡æ¦ã"}),t.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",marginTop:16,flexWrap:"wrap"},children:[t.jsxs("label",{children:["æçºæé(ç§)ï¼",t.jsx("input",{type:"number",min:5,max:60,value:m,onChange:r=>x(Number(r.target.value)||15),disabled:n,style:{width:60,marginLeft:6}})]}),t.jsxs("label",{children:["æå¯¶æ¬¡æ¸ï¼",t.jsx("input",{type:"number",min:1,max:20,value:e,onChange:r=>u(Number(r.target.value)||5),disabled:n,style:{width:60,marginLeft:6}})]}),t.jsxs("label",{children:["鍿©çåµç¯åï¼",t.jsx("input",{type:"number",min:1,value:a,onChange:r=>h(Number(r.target.value)||1),disabled:n,style:{width:60,marginLeft:6}}),"ï½",t.jsx("input",{type:"number",min:1,value:c,onChange:r=>p(Number(r.target.value)||20),disabled:n,style:{width:60,marginLeft:6}})]}),t.jsx("button",{onClick:b,disabled:n,style:{padding:"8px 16px"},children:n?"é²è¡ä¸â¦":"âï¸ é姿坶"})]}),t.jsx(R,{socket:o.current,token:"demo",name:"å°æ",setApples:()=>{}})]})}export{T 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.