speakid-hangman 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),l=require("react"),c={gmCenterScreen:{position:"relative",zIndex:1,minHeight:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"#1f2937",padding:"24px 16px",boxSizing:"border-box",fontFamily:'"Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',background:"transparent"},gmHeadline1:{fontWeight:600,fontSize:"clamp(30px, 4vw, 32px)",lineHeight:"110%",marginBottom:"24px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmHeadline3:{fontWeight:500,fontSize:"clamp(16px, 2vw, 24px)",lineHeight:"110%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyL:{fontWeight:400,fontSize:"18px",lineHeight:"120%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyM:{fontWeight:400,fontSize:"clamp(14px, 1.5vw, 16px)",lineHeight:"120%",marginBottom:"8px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyS:{fontWeight:400,fontSize:"clamp(12px, 1.5vw, 14px)",lineHeight:"120%",color:"#6b7280",marginBottom:"8px",fontFamily:'"Onest", system-ui, sans-serif'},gmButton:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:400,fontSize:"16px",lineHeight:"100%",padding:"10px 16px",borderRadius:"8px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"none",transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease",margin:"4px"},gmButtonSecondary:{background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",boxShadow:"none"},gmButtonGroup:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center",marginBottom:"24px"},gmWordDisplay:{fontSize:"clamp(20px, 5vw, 28px)",fontWeight:500,letterSpacing:"6px",margin:"32px 0",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmGuessedLetters:{fontSize:"clamp(12px, 1.5vw, 16px)",color:"#6b7280",marginTop:"16px",minHeight:"24px",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmStatusWin:{color:"#10b981",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmStatusLose:{color:"#ec4c44",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmInfoBox:{background:"#f9f9f9",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",marginBottom:"24px",maxWidth:"500px",width:"100%",boxShadow:"none"},gmLogoFixed:{position:"absolute",top:"24px",left:"24px",width:"auto",zIndex:30,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"28px",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",display:"block"}};function Ce({mistakes:r,maxMistakes:Z,size:X=200}){const p=X,m=X*1.25,b=Math.max(3,X/100),W=10*(p/200),x=240*(m/250),f=150*(p/200),y=80*(p/200),q=20*(m/250),G=240*(m/250),k=80*(p/200),Q=20*(m/250),v=150*(p/200),C=150*(p/200),$=20*(m/250),z=50*(m/250),j=150*(p/200),H=70*(m/250),P=20*(p/200),F=150*(p/200),K=90*(m/250),Y=150*(m/250),h=150*(p/200),L=110*(m/250),g=130*(p/200),D=130*(m/250),J=150*(p/200),R=110*(m/250),ge=170*(p/200),T=130*(m/250),ee=150*(p/200),_=150*(m/250),u=130*(p/200),te=190*(m/250),I=150*(p/200),ne=150*(m/250),i=170*(p/200),oe=190*(m/250),w=r===0||r<=Z*.5?"#1f2937":r<=Z*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:p,height:m,viewBox:"0 0 200 250",style:{display:"block",margin:"0 auto",overflow:"visible",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[r>0&&t.jsx("line",{x1:W,y1:x,x2:f,y2:x,stroke:w,strokeWidth:b}),r>1&&t.jsx("line",{x1:y,y1:q,x2:y,y2:G,stroke:w,strokeWidth:b}),r>2&&t.jsx("line",{x1:k,y1:Q,x2:v,y2:Q,stroke:w,strokeWidth:b}),r>3&&t.jsx("line",{x1:C,y1:$,x2:C,y2:z,stroke:w,strokeWidth:b}),r>4&&t.jsx("circle",{cx:j,cy:H,r:P,stroke:w,fill:"none",strokeWidth:b}),r>5&&t.jsx("line",{x1:F,y1:K,x2:F,y2:Y,stroke:w,strokeWidth:b}),r>6&&t.jsx("line",{x1:h,y1:L,x2:g,y2:D,stroke:w,strokeWidth:b}),r>7&&t.jsx("line",{x1:J,y1:R,x2:ge,y2:T,stroke:w,strokeWidth:b}),r>8&&t.jsx("line",{x1:ee,y1:_,x2:u,y2:te,stroke:w,strokeWidth:b}),r>9&&t.jsx("line",{x1:I,y1:ne,x2:i,y2:oe,stroke:w,strokeWidth:b})]})}function de({gameCubeSize:r=400,screenHeight:Z=800,screenWidth:X=800,logoUrl:p,showLogo:m=!0,baseURL:b}={}){const W={Professions:["teacher","doctor","nurse","driver","police","firefighter","cook","waiter","farmer","builder","singer","actor","dentist","pilot","vet","artist","cleaner","student","baker","mechanic"],Family:["mother","father","sister","brother","grandmother","grandfather","aunt","uncle","cousin","baby","parents","children","wife","husband","son","daughter","family","twins","relatives"],"Farm animals":["cow","pig","horse","sheep","goat","duck","chicken","rooster","turkey","goose","rabbit","mouse","donkey","bee","hen","lamb","bull","pony"],Food:["apple","banana","bread","cheese","milk","egg","rice","soup","fish","meat","potato","carrot","tomato","cucumber","butter","cake","salad","pasta","pizza","juice"],Hobbies:["reading","drawing","painting","dancing","singing","cooking","swimming","fishing","running","cycling","skating","writing","camping","photography","hiking","games"],Christmas:["tree","present","gift","santa","snow","snowman","bell","star","lights","card","cookies","elf","sleigh","reindeer","candle","stocking"],Halloween:["pumpkin","costume","candy","ghost","witch","spider","bat","skeleton","mask","monster","mummy","cat","broom","zombie","trick","treat","candle","night","party"],Sport:["football","basketball","tennis","swimming","running","baseball","skiing","skating","volleyball","hockey","golf","boxing","cycling","rugby","karate","yoga","surfing","climbing","dancing","gym","chess"],"Body parts":["head","hair","eyes","ears","nose","mouth","teeth","tongue","neck","shoulder","arm","hand","finger","leg","knee","foot","toe","back","stomach","heart","legs","nails","chin","beard"],"School subjects":["math","english","history","geography","art","music","science","biology","chemistry","physics","pe","literature","drama","design","economics"],Animals:["cat","dog","rabbit","elephant","lion","tiger","monkey","bear","fox","wolf","giraffe","zebra","crocodile","dolphin","whale","shark","frog","parrot","mouse","penguin","deer","lizard","turtle","snake"],Countries:["russia","canada","china","japan","france","germany","italy","spain","brazil","india","australia","america","england","korea","mexico","egypt","turkey","vietnam","norway","finland","thailand","georgia","kazakhstan"],Clothes:["shirt","dress","skirt","trousers","jeans","coat","jacket","sweater","socks","shoes","boots","hat","scarf","gloves","shorts","cap","belt","tie","uniform","pants","underwear"],Traveling:["ticket","luggage","suitcase","airport","flight","passport","visa","map","guide","hotel","reservation","bus","train","taxi","tourist","sightseeing","backpack","journey","adventure","beach","tour","souvenir"],Environment:["tree","forest","air","water","pollution","recycle","nature","clean","waste","plastic","energy","animal","climate","earth","ocean","river","planet","save","green","environment","litter","organic"],Space:["planet","star","sun","moon","astronaut","rocket","space","galaxy","universe","telescope","comet","asteroid","orbit","gravity","alien","spaceship","mars","satellite","sky","eclipse"],Devices:["computer","laptop","phone","tablet","tv","keyboard","mouse","printer","camera","headphones","charger","screen","watch","microphone","speaker","console","router","battery","cable","remote"]},[x,f]=l.useState("lobby"),[y,q]=l.useState(""),[G]=l.useState("Normal"),[k,Q]=l.useState(0),[v,C]=l.useState(1),[$,z]=l.useState(""),[j,H]=l.useState([]),[P,F]=l.useState(0),[K,Y]=l.useState(0),[h,L]=l.useState(null),[g,D]=l.useState(null),[J,R]=l.useState(1),[ge,T]=l.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,_=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[u,te]=l.useState(!1),[I,ne]=l.useState(!1),[i,oe]=l.useState(!1),[M,w]=l.useState(!1),a=l.useMemo(()=>{const e=(g||r||1e3)/400,o=i?.8:1,s=M?.9:1,d=o*s;return{headline1:u?Math.max(24,Math.min(30,30*e*d)):Math.max(28,Math.min(32,32*e*s)),headline2:Math.max(20,Math.min(28,24*e*d)),headline3:u?Math.max(14,Math.min(18,16*e*d)):Math.max(20,Math.min(26,24*e*d)),bodyL:Math.max(14,Math.min(20,18*e*d)),bodyM:u?Math.max(12,Math.min(16,14*e*d)):Math.max(14,Math.min(18,16*e*d)),bodyS:u?Math.max(10,Math.min(14,12*e*d)):Math.max(12,Math.min(16,14*e*d)),wordDisplay:Math.max(18,Math.min(32,26*e*d)),button:Math.max(12,Math.min(18,16*e*d))}},[u,g,r,i,M]),ue=l.useMemo(()=>{const e=(g||r||1e3)/400,o=i?.65:1,s=M?.85:1;return I?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*o*s},[I,g,r,i,M]),n=l.useMemo(()=>{const e=(g||r||1e3)/400,o=i?.65:1,s=M?.85:1;return I?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*o*s},[I,g,r,i,M]),S=l.useMemo(()=>{const e=(g||r||1e3)/400,o=M?.9:1;return Math.max(6,Math.min(10,8*e*o))},[g,r,M]),xe=(e,o)=>e.split("").every(s=>o.includes(s)),fe=(e,o)=>e.split("").map(s=>o.includes(s)?s:"_").join(" "),ye=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(s=>!e.includes(s)),N=(e,o=[])=>{var A;if(!e||!W[e]){const B=Object.keys(W)[0];return((A=W[B])==null?void 0:A[0])||""}const s=W[e];if(!s||s.length===0)return"";const d=s.filter(B=>!o.includes(B)),E=d.length>0?d:s;if(E.length===0)return"";let V;if(typeof crypto<"u"&&crypto.getRandomValues){const B=new Uint32Array(1);crypto.getRandomValues(B);const le=B[0]/4294967295;V=Math.floor(le*E.length)}else V=Math.floor(Math.random()*E.length);return E[V]},be=()=>{if(!y)return;T([]);const e=N(y,[]);if(!e){f("category");return}z(e),T([e]),H([]),F(0),C(1),Y(0),L(null),f("game")},re=l.useCallback(e=>{if(x!=="game"||h!==null)return;const o=e.toLowerCase();/^[a-z]$/.test(o)&&(H(s=>s.includes(o)?s:[...s,o]),z(s=>(s&&!s.includes(o)&&F(d=>d+1),s)))},[x,h]),se=l.useCallback(e=>{re(e.key)},[re]);l.useEffect(()=>{if(x==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[x,se]);const we=$?fe($,j):"",pe=$?xe($,j):!1,me=P>=10,ke=ye(j),ie=l.useCallback(()=>{if(!y||v>=k){f("result");return}C(e=>e+1),T(e=>{const o=N(y,e);return o?(z(o),[...e,o]):e}),H([]),F(0),L(null)},[y,v,k]);l.useEffect(()=>{if(pe&&h===null){L("win"),Y(o=>o+1);const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}if(me&&h===null){L("lose");const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}},[pe,me,h,ie]);const Me=()=>{if(!y||v>=k){f("result");return}C(e=>e+1),T(e=>{const o=N(y,e);return o?(z(o),[...e,o]):e}),H([]),F(0),L(null)};l.useEffect(()=>{const e=()=>{const o=window.innerWidth,s=window.innerHeight,d=o<768,E=o>s&&o<1e3&&s<500,A=d||E||(o===926&&s===428||o===932&&s===430),B=s<700,le=o/s>1.8,je=o===1024&&s===600,Fe=A&&o>s,Le=o>=1200&&o<=1400;if(te(A),ne(je),oe(Fe),w(Le),A)D(null),R(1);else if(B)D(null),R(1);else{const Te=o-80,Be=s-80,he=Math.min(Te,Be);let ce;r&&r>=320?ce=Math.min(r,he):ce=Math.min(1e3,he*.9);const We=Math.max(400,Math.min(1200,ce));D(We),R(le?.85:1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]);const U=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),l=require("react"),c={gmCenterScreen:{position:"relative",zIndex:1,minHeight:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"#1f2937",padding:"24px 16px",boxSizing:"border-box",fontFamily:'"Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',background:"transparent"},gmHeadline1:{fontWeight:600,fontSize:"clamp(30px, 4vw, 32px)",lineHeight:"110%",marginBottom:"24px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmHeadline3:{fontWeight:500,fontSize:"clamp(16px, 2vw, 24px)",lineHeight:"110%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyL:{fontWeight:400,fontSize:"18px",lineHeight:"120%",marginBottom:"12px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyM:{fontWeight:400,fontSize:"clamp(14px, 1.5vw, 16px)",lineHeight:"120%",marginBottom:"8px",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif'},gmBodyS:{fontWeight:400,fontSize:"clamp(12px, 1.5vw, 14px)",lineHeight:"120%",color:"#6b7280",marginBottom:"8px",fontFamily:'"Onest", system-ui, sans-serif'},gmButton:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:400,fontSize:"16px",lineHeight:"100%",padding:"10px 16px",borderRadius:"8px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"none",transition:"background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease",margin:"4px"},gmButtonSecondary:{background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",boxShadow:"none"},gmButtonGroup:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"center",marginBottom:"24px"},gmWordDisplay:{fontSize:"clamp(20px, 5vw, 28px)",fontWeight:500,letterSpacing:"6px",margin:"32px 0",color:"#1f2937",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmGuessedLetters:{fontSize:"clamp(12px, 1.5vw, 16px)",color:"#6b7280",marginTop:"16px",minHeight:"24px",fontFamily:'"Onest", system-ui, sans-serif',lineHeight:"120%"},gmStatusWin:{color:"#10b981",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmStatusLose:{color:"#ec4c44",fontWeight:500,fontSize:"clamp(14px, 1.5vw, 18px)",lineHeight:"120%",margin:"16px 0",fontFamily:'"Onest", system-ui, sans-serif'},gmInfoBox:{background:"#f9f9f9",border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",marginBottom:"24px",maxWidth:"500px",width:"100%",boxShadow:"none"},gmLogoFixed:{position:"absolute",top:"24px",left:"24px",width:"auto",zIndex:30,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"28px",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased",display:"block"}};function Ce({mistakes:r,maxMistakes:Z,size:X=200}){const p=X,m=X*1.25,b=Math.max(3,X/100),W=10*(p/200),x=240*(m/250),f=150*(p/200),y=80*(p/200),q=20*(m/250),G=240*(m/250),k=80*(p/200),Q=20*(m/250),v=150*(p/200),C=150*(p/200),$=20*(m/250),z=50*(m/250),j=150*(p/200),H=70*(m/250),P=20*(p/200),F=150*(p/200),K=90*(m/250),Y=150*(m/250),h=150*(p/200),L=110*(m/250),u=130*(p/200),D=130*(m/250),J=150*(p/200),R=110*(m/250),ge=170*(p/200),T=130*(m/250),ee=150*(p/200),_=150*(m/250),g=130*(p/200),te=190*(m/250),I=150*(p/200),ne=150*(m/250),i=170*(p/200),oe=190*(m/250),w=r===0||r<=Z*.5?"#1f2937":r<=Z*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:p,height:m,viewBox:"0 0 200 250",style:{display:"block",margin:"0 auto",overflow:"visible",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[r>0&&t.jsx("line",{x1:W,y1:x,x2:f,y2:x,stroke:w,strokeWidth:b}),r>1&&t.jsx("line",{x1:y,y1:q,x2:y,y2:G,stroke:w,strokeWidth:b}),r>2&&t.jsx("line",{x1:k,y1:Q,x2:v,y2:Q,stroke:w,strokeWidth:b}),r>3&&t.jsx("line",{x1:C,y1:$,x2:C,y2:z,stroke:w,strokeWidth:b}),r>4&&t.jsx("circle",{cx:j,cy:H,r:P,stroke:w,fill:"none",strokeWidth:b}),r>5&&t.jsx("line",{x1:F,y1:K,x2:F,y2:Y,stroke:w,strokeWidth:b}),r>6&&t.jsx("line",{x1:h,y1:L,x2:u,y2:D,stroke:w,strokeWidth:b}),r>7&&t.jsx("line",{x1:J,y1:R,x2:ge,y2:T,stroke:w,strokeWidth:b}),r>8&&t.jsx("line",{x1:ee,y1:_,x2:g,y2:te,stroke:w,strokeWidth:b}),r>9&&t.jsx("line",{x1:I,y1:ne,x2:i,y2:oe,stroke:w,strokeWidth:b})]})}function de({gameCubeSize:r=400,screenHeight:Z=800,screenWidth:X=800,logoUrl:p,showLogo:m=!0,baseURL:b}={}){const W={Professions:["teacher","doctor","nurse","driver","police","firefighter","cook","waiter","farmer","builder","singer","actor","dentist","pilot","vet","artist","cleaner","student","baker","mechanic"],Family:["mother","father","sister","brother","grandmother","grandfather","aunt","uncle","cousin","baby","parents","children","wife","husband","son","daughter","family","twins","relatives"],"Farm animals":["cow","pig","horse","sheep","goat","duck","chicken","rooster","turkey","goose","rabbit","mouse","donkey","bee","hen","lamb","bull","pony"],Food:["apple","banana","bread","cheese","milk","egg","rice","soup","fish","meat","potato","carrot","tomato","cucumber","butter","cake","salad","pasta","pizza","juice"],Hobbies:["reading","drawing","painting","dancing","singing","cooking","swimming","fishing","running","cycling","skating","writing","camping","photography","hiking","games"],Christmas:["tree","present","gift","santa","snow","snowman","bell","star","lights","card","cookies","elf","sleigh","reindeer","candle","stocking"],Halloween:["pumpkin","costume","candy","ghost","witch","spider","bat","skeleton","mask","monster","mummy","cat","broom","zombie","trick","treat","candle","night","party"],Sport:["football","basketball","tennis","swimming","running","baseball","skiing","skating","volleyball","hockey","golf","boxing","cycling","rugby","karate","yoga","surfing","climbing","dancing","gym","chess"],"Body parts":["head","hair","eyes","ears","nose","mouth","teeth","tongue","neck","shoulder","arm","hand","finger","leg","knee","foot","toe","back","stomach","heart","legs","nails","chin","beard"],"School subjects":["math","english","history","geography","art","music","science","biology","chemistry","physics","pe","literature","drama","design","economics"],Animals:["cat","dog","rabbit","elephant","lion","tiger","monkey","bear","fox","wolf","giraffe","zebra","crocodile","dolphin","whale","shark","frog","parrot","mouse","penguin","deer","lizard","turtle","snake"],Countries:["russia","canada","china","japan","france","germany","italy","spain","brazil","india","australia","america","england","korea","mexico","egypt","turkey","vietnam","norway","finland","thailand","georgia","kazakhstan"],Clothes:["shirt","dress","skirt","trousers","jeans","coat","jacket","sweater","socks","shoes","boots","hat","scarf","gloves","shorts","cap","belt","tie","uniform","pants","underwear"],Traveling:["ticket","luggage","suitcase","airport","flight","passport","visa","map","guide","hotel","reservation","bus","train","taxi","tourist","sightseeing","backpack","journey","adventure","beach","tour","souvenir"],Environment:["tree","forest","air","water","pollution","recycle","nature","clean","waste","plastic","energy","animal","climate","earth","ocean","river","planet","save","green","environment","litter","organic"],Space:["planet","star","sun","moon","astronaut","rocket","space","galaxy","universe","telescope","comet","asteroid","orbit","gravity","alien","spaceship","mars","satellite","sky","eclipse"],Devices:["computer","laptop","phone","tablet","tv","keyboard","mouse","printer","camera","headphones","charger","screen","watch","microphone","speaker","console","router","battery","cable","remote"]},[x,f]=l.useState("lobby"),[y,q]=l.useState(""),[G]=l.useState("Normal"),[k,Q]=l.useState(0),[v,C]=l.useState(1),[$,z]=l.useState(""),[j,H]=l.useState([]),[P,F]=l.useState(0),[K,Y]=l.useState(0),[h,L]=l.useState(null),[u,D]=l.useState(null),[J,R]=l.useState(1),[ge,T]=l.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,_=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[g,te]=l.useState(!1),[I,ne]=l.useState(!1),[i,oe]=l.useState(!1),[M,w]=l.useState(!1),a=l.useMemo(()=>{const e=(u||r||1e3)/400,o=i?.8:1,s=M?.9:1,d=o*s;return{headline1:g?Math.max(24,Math.min(30,30*e*d)):Math.max(28,Math.min(32,32*e*s)),headline2:Math.max(20,Math.min(28,24*e*d)),headline3:g?Math.max(14,Math.min(18,16*e*d)):Math.max(20,Math.min(26,24*e*d)),bodyL:Math.max(14,Math.min(20,18*e*d)),bodyM:g?Math.max(12,Math.min(16,14*e*d)):Math.max(14,Math.min(18,16*e*d)),bodyS:g?Math.max(10,Math.min(14,12*e*d)):Math.max(12,Math.min(16,14*e*d)),wordDisplay:Math.max(18,Math.min(32,26*e*d)),button:Math.max(12,Math.min(18,16*e*d))}},[g,u,r,i,M]),ue=l.useMemo(()=>{const e=(u||r||1e3)/400,o=i?.65:1,s=M?.85:1;return I?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*o*s},[I,u,r,i,M]),n=l.useMemo(()=>{const e=(u||r||1e3)/400,o=i?.65:1,s=M?.85:1;return I?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*o*s},[I,u,r,i,M]),S=l.useMemo(()=>{const e=(u||r||1e3)/400,o=M?.9:1;return Math.max(6,Math.min(10,8*e*o))},[u,r,M]),xe=(e,o)=>e.split("").every(s=>o.includes(s)),fe=(e,o)=>e.split("").map(s=>o.includes(s)?s:"_").join(" "),ye=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(s=>!e.includes(s)),N=(e,o=[])=>{var A;if(!e||!W[e]){const B=Object.keys(W)[0];return((A=W[B])==null?void 0:A[0])||""}const s=W[e];if(!s||s.length===0)return"";const d=s.filter(B=>!o.includes(B)),E=d.length>0?d:s;if(E.length===0)return"";let V;if(typeof crypto<"u"&&crypto.getRandomValues){const B=new Uint32Array(1);crypto.getRandomValues(B);const le=B[0]/4294967295;V=Math.floor(le*E.length)}else V=Math.floor(Math.random()*E.length);return E[V]},be=()=>{if(!y)return;T([]);const e=N(y,[]);if(!e){f("category");return}z(e),T([e]),H([]),F(0),C(1),Y(0),L(null),f("game")},re=l.useCallback(e=>{if(x!=="game"||h!==null)return;const o=e.toLowerCase();/^[a-z]$/.test(o)&&(H(s=>s.includes(o)?s:[...s,o]),z(s=>(s&&!s.includes(o)&&F(d=>d+1),s)))},[x,h]),se=l.useCallback(e=>{re(e.key)},[re]);l.useEffect(()=>{if(x==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[x,se]);const we=$?fe($,j):"",pe=$?xe($,j):!1,me=P>=10,ke=ye(j),ie=l.useCallback(()=>{if(!y||v>=k){f("result");return}C(e=>e+1),T(e=>{const o=N(y,e);return o?(z(o),[...e,o]):e}),H([]),F(0),L(null)},[y,v,k]);l.useEffect(()=>{if(pe&&h===null){L("win"),Y(o=>o+1);const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}if(me&&h===null){L("lose");const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}},[pe,me,h,ie]);const Me=()=>{if(!y||v>=k){f("result");return}C(e=>e+1),T(e=>{const o=N(y,e);return o?(z(o),[...e,o]):e}),H([]),F(0),L(null)};l.useEffect(()=>{const e=()=>{const o=window.innerWidth,s=window.innerHeight,d=o<768,E=o>s&&o<1e3&&s<500,A=d||E||(o===926&&s===428||o===932&&s===430),B=s<700,le=o/s>1.8,je=o===1024&&s===600,Fe=A&&o>s,Le=o>=1200&&o<=1400;if(te(A),ne(je),oe(Fe),w(Le),A)D(null),R(1);else if(B)D(null),R(1);else{const Te=o-80,Be=s-80,he=Math.min(Te,Be);let ce;r&&r>=320?ce=Math.min(r,he):ce=Math.min(1e3,he*.9);const We=Math.max(400,Math.min(1200,ce));D(We),R(le?.85:1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]);const U=`
2
2
  <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
3
3
  <!-- Каракули мелками и фломастерами -->
4
4
 
@@ -42,5 +42,5 @@
42
42
  <path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
43
43
  fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
44
44
  </svg>
45
- `,Se=!u&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!u&&m&&(x!=="game"||Se),$e={...c.gmCenterScreen,width:"100%",height:"100%",padding:`${ue}px`,paddingTop:ae?"80px":`${ue}px`,overflow:M?"hidden":"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=l.useMemo(()=>{if(!ae)return null;const e=window.innerWidth;if(u&&e>window.innerHeight)return null;const o=p||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:c.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${o}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${o}.png`,alt:"SPEAKID Logo",style:c.gmLogoImg,loading:"lazy"})]})})},[u,ae,p,x]),ve=()=>x==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>f("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*3}px`,borderRadius:`${S*1.5}px`,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#ec4c44",color:"#ffffff",border:"none",cursor:"pointer",transition:"background 0.2s ease, transform 0.1s ease",boxShadow:"0 2px 8px rgba(236, 76, 68, 0.2)",minWidth:"120px"},onMouseEnter:e=>{e.currentTarget.style.background="#d43a32",e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(236, 76, 68, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="#ec4c44",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(236, 76, 68, 0.2)"},onMouseDown:e=>{e.currentTarget.style.transform="translateY(0)"},children:[t.jsx("svg",{width:`${a.button*1.3}px`,height:`${a.button*1.3}px`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",marginRight:`${n}px`},children:t.jsx("path",{d:"M8 5V19L19 12L8 5Z",fill:"#ffffff",stroke:"none"})}),t.jsx("span",{style:{fontWeight:500},children:"PLAY"})]}),t.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",pointerEvents:"none",zIndex:0},children:[t.jsx("img",{src:`${_}/sun.png`,alt:"Sun",style:{position:"absolute",left:u?"-10%":"5%",top:"20%",width:"auto",height:u?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((g||r||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}}),t.jsx("img",{src:`${_}/character.png`,alt:"Hangman character",style:{position:"absolute",right:u?"5%":"10%",bottom:"10%",width:"auto",height:u?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((g||r||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):x==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"24px",left:"24px",zIndex:10},children:"←"}),t.jsx("div",{style:{...c.gmButtonGroup,gap:`${n}px`,marginBottom:`${n*3}px`,marginTop:`${n*4}px`,position:"relative",zIndex:1},children:Object.keys(W).map(e=>t.jsx("button",{onClick:()=>{q(e),f("rounds")},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="#f0f0f0",o.currentTarget.style.borderColor="#1f2937",o.currentTarget.style.transform="scale(1.05)"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.borderColor="#e5e7eb",o.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*2}px`,borderRadius:`${S*2}px`,margin:`${n/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="rounds"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("button",{onClick:()=>f("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"24px",left:"24px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...c.gmButtonGroup,gap:`${n}px`,marginBottom:`${n*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),be()},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="#f0f0f0",o.currentTarget.style.borderColor="#1f2937",o.currentTarget.style.transform="scale(1.05)"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.borderColor="#e5e7eb",o.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*2}px`,borderRadius:`${S*2}px`,margin:`${n/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="game"?t.jsxs(t.Fragment,{children:[O,!i&&t.jsx("div",{dangerouslySetInnerHTML:{__html:U}})," ",t.jsxs("div",{style:{...c.gmInfoBox,padding:`${i?n*.5:n*.8}px`,marginBottom:`${i?n*.2:n*.5}px`,maxWidth:`${(g||r)*.9}px`,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsxs("h3",{style:{...c.gmHeadline3,fontSize:`${a.headline3}px`,marginBottom:`${n*.2}px`,textAlign:"center"},children:["Category: ",y]}),t.jsxs("p",{style:{...c.gmBodyM,fontSize:`${a.bodyM}px`,marginBottom:"0px",textAlign:"center"},children:["Round ",v," of ",k]})]}),$&&t.jsxs("p",{style:{...c.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${i?n*.2:n*.5}px`,marginBottom:`${i?n*.3:n}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:$.length})," letters long"]}),t.jsx("div",{style:{margin:`${i?n*.3:n}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Ce,{mistakes:P,maxMistakes:ee,size:I?Math.max(80,Math.min(110,(g||r)*.16)):u?i?Math.max(90,Math.min(130,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,(g||r)*.2))})}),t.jsx("div",{style:{...c.gmWordDisplay,fontSize:`${i?Math.max(14,Math.min(20,a.wordDisplay*.8)):Math.max(16,Math.min(24,a.wordDisplay*.9))}px`,margin:`${i?n*.3:n}px 0`,letterSpacing:`${i?n*.6:n*.8}px`,minHeight:`${(i?Math.max(14,Math.min(20,a.wordDisplay*.8)):Math.max(16,Math.min(24,a.wordDisplay*.9)))*1.2}px`},children:we||"Loading..."}),t.jsx("div",{style:{...c.gmInfoBox,padding:`${i?n*.5:n}px`,marginTop:`${i?n*.3:n}px`,marginBottom:`${i?n*.3:n}px`,maxWidth:`${(g||r)*.95}px`},children:t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${i?n/4:n/3}px`,justifyContent:"center",alignItems:"center",fontFamily:'"Onest", system-ui, sans-serif'},children:ke.map(e=>{const o=i?Math.max((g||r)*.05,n*1.5):Math.max((g||r)*.06,n*2),s=i?Math.max((g||r)*.1,n*2.5):Math.max((g||r)*.12,n*3);return t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:d=>{h===null&&(d.currentTarget.style.backgroundColor="#e5e7eb",d.currentTarget.style.cursor="pointer")},onMouseLeave:d=>{h===null&&(d.currentTarget.style.backgroundColor="#f9f9f9",d.currentTarget.style.cursor="pointer")},style:{flex:"1 1 auto",padding:`${i?n*.4:n*.5}px ${i?n*.3:n*.4}px`,borderRadius:`${S*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${o}px`,maxWidth:`${s}px`,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${i?Math.max(12,Math.min(16,a.bodyS*1)):Math.max(14,Math.min(20,a.bodyS*1.2))}px`,fontWeight:500,transition:"background-color 0.2s ease"},children:e.toUpperCase()},e)})})}),j.length>0&&t.jsx("div",{style:{...c.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,a.bodyS*.85))}px`,marginTop:`${n*.5}px`,marginBottom:"2px"},children:t.jsxs("span",{style:{color:"#6b7280"},children:["Guessed letters: ",t.jsx("strong",{children:j.join(", ")})]})}),h==="win"&&t.jsx("div",{style:{...c.gmStatusWin,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...c.gmStatusLose,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:$})]}),h!==null&&v<k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${n}px`},children:t.jsx("button",{onClick:Me,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${Math.max(11,Math.min(14,a.button*.85))}px`,padding:`${n*.6}px ${n*1.2}px`,borderRadius:`${S}px`},children:"NEXT"})}),h!==null&&v>=k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${n}px`},children:t.jsx("button",{onClick:()=>f("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`},children:"View results"})}),h===null&&j.length===0&&t.jsx("p",{style:{...c.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${n}px`,marginBottom:`${n}px`},children:"Type a letter on your keyboard"})]}):x==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...c.gmBodyL,fontSize:`${a.bodyL}px`,marginBottom:`${n*2}px`},children:["You guessed ",t.jsx("strong",{children:K})," out of ",t.jsx("strong",{children:k})," words correctly."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:`${n}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!y||k===0){f("lobby");return}T([]);const e=N(y,[]);e&&(z(e),T([e]),H([]),F(0),C(1),Y(0),L(null),f("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Play again"}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Exit"})]})]}):null;return t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"transparent",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:t.jsx("div",{style:{width:u?"100%":g||r||1e3,height:u?"100%":g||r||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:u?0:"20px",background:"#ffffff",boxShadow:u?"none":"0 0 40px rgba(0,0,0,0.1)",margin:u?"0 auto":"unset",position:"relative",transform:u&&!i?`scale(${J})`:void 0},children:t.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{style:$e,children:ve()})})})})}exports.Game=de;exports.HangmanLobbyGame=de;exports.default=de;
45
+ `,Se=!g&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!g&&m&&(x!=="game"||Se),$e={...c.gmCenterScreen,width:"100%",height:"100%",padding:`${ue}px`,paddingTop:ae?"80px":`${ue}px`,overflow:M?"hidden":"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=l.useMemo(()=>{if(!ae)return null;const e=window.innerWidth;if(g&&e>window.innerHeight)return null;const o=p||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:c.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${o}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${o}.png`,alt:"SPEAKID Logo",style:c.gmLogoImg,loading:"lazy"})]})})},[g,ae,p,x]),ve=()=>x==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>f("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*3}px`,borderRadius:`${S*1.5}px`,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#ec4c44",color:"#ffffff",border:"none",cursor:"pointer",transition:"background 0.2s ease, transform 0.1s ease",boxShadow:"0 2px 8px rgba(236, 76, 68, 0.2)",minWidth:"120px"},onMouseEnter:e=>{e.currentTarget.style.background="#d43a32",e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(236, 76, 68, 0.3)"},onMouseLeave:e=>{e.currentTarget.style.background="#ec4c44",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(236, 76, 68, 0.2)"},onMouseDown:e=>{e.currentTarget.style.transform="translateY(0)"},children:[t.jsx("svg",{width:`${a.button*1.3}px`,height:`${a.button*1.3}px`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",marginRight:`${n}px`},children:t.jsx("path",{d:"M8 5V19L19 12L8 5Z",fill:"#ffffff",stroke:"none"})}),t.jsx("span",{style:{fontWeight:500},children:"PLAY"})]}),t.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",pointerEvents:"none",zIndex:0},children:[t.jsx("img",{src:`${_}/sun.png`,alt:"Sun",style:{position:"absolute",left:g?"-10%":"5%",top:"20%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((u||r||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}}),t.jsx("img",{src:`${_}/character.png`,alt:"Hangman character",style:{position:"absolute",right:g?"5%":"10%",bottom:"10%",width:"auto",height:g?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((u||r||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):x==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:g?"24px":"64px",left:"24px",zIndex:10},children:"←"}),t.jsx("div",{style:{...c.gmButtonGroup,gap:`${n}px`,marginBottom:`${n*3}px`,marginTop:`${n*4}px`,position:"relative",zIndex:1},children:Object.keys(W).map(e=>t.jsx("button",{onClick:()=>{q(e),f("rounds")},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="#f0f0f0",o.currentTarget.style.borderColor="#1f2937",o.currentTarget.style.transform="scale(1.05)"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.borderColor="#e5e7eb",o.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*2}px`,borderRadius:`${S*2}px`,margin:`${n/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="rounds"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:U}}),t.jsx("button",{onClick:()=>f("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:g?"24px":"64px",left:"24px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...c.gmButtonGroup,gap:`${n}px`,marginBottom:`${n*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),be()},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="#f0f0f0",o.currentTarget.style.borderColor="#1f2937",o.currentTarget.style.transform="scale(1.05)"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.borderColor="#e5e7eb",o.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${n*1.2}px ${n*2}px`,borderRadius:`${S*2}px`,margin:`${n/2}px`,background:"transparent",border:"2px solid #e5e7eb",color:"#1f2937",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",boxShadow:"none"},children:e},e))})]}):x==="game"?t.jsxs(t.Fragment,{children:[O,!i&&t.jsx("div",{dangerouslySetInnerHTML:{__html:U}})," ",t.jsxs("div",{style:{...c.gmInfoBox,padding:`${i?n*.5:n*.8}px`,marginBottom:`${i?n*.2:n*.5}px`,maxWidth:`${(u||r)*.9}px`,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsxs("h3",{style:{...c.gmHeadline3,fontSize:`${a.headline3}px`,marginBottom:`${n*.2}px`,textAlign:"center"},children:["Category: ",y]}),t.jsxs("p",{style:{...c.gmBodyM,fontSize:`${a.bodyM}px`,marginBottom:"0px",textAlign:"center"},children:["Round ",v," of ",k]})]}),$&&t.jsxs("p",{style:{...c.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${i?n*.2:n*.5}px`,marginBottom:`${i?n*.3:n}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:$.length})," letters long"]}),t.jsx("div",{style:{margin:`${i?n*.3:n}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Ce,{mistakes:P,maxMistakes:ee,size:I?Math.max(80,Math.min(110,(u||r)*.16)):g?i?Math.max(90,Math.min(130,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,(u||r)*.2))})}),t.jsx("div",{style:{...c.gmWordDisplay,fontSize:`${i?Math.max(14,Math.min(20,a.wordDisplay*.8)):Math.max(16,Math.min(24,a.wordDisplay*.9))}px`,margin:`${i?n*.3:n}px 0`,letterSpacing:`${i?n*.6:n*.8}px`,minHeight:`${(i?Math.max(14,Math.min(20,a.wordDisplay*.8)):Math.max(16,Math.min(24,a.wordDisplay*.9)))*1.2}px`},children:we||"Loading..."}),t.jsx("div",{style:{...c.gmInfoBox,padding:`${i?n*.5:n}px`,marginTop:`${i?n*.3:n}px`,marginBottom:`${i?n*.3:n}px`,maxWidth:`${(u||r)*.95}px`},children:t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${i?n/4:n/3}px`,justifyContent:"center",alignItems:"center",fontFamily:'"Onest", system-ui, sans-serif'},children:ke.map(e=>{const o=i?Math.max((u||r)*.05,n*1.5):Math.max((u||r)*.06,n*2),s=i?Math.max((u||r)*.1,n*2.5):Math.max((u||r)*.12,n*3);return t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:d=>{h===null&&(d.currentTarget.style.backgroundColor="#e5e7eb",d.currentTarget.style.cursor="pointer")},onMouseLeave:d=>{h===null&&(d.currentTarget.style.backgroundColor="#f9f9f9",d.currentTarget.style.cursor="pointer")},style:{flex:"1 1 auto",padding:`${i?n*.4:n*.5}px ${i?n*.3:n*.4}px`,borderRadius:`${S*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${o}px`,maxWidth:`${s}px`,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${i?Math.max(12,Math.min(16,a.bodyS*1)):Math.max(14,Math.min(20,a.bodyS*1.2))}px`,fontWeight:500,transition:"background-color 0.2s ease"},children:e.toUpperCase()},e)})})}),j.length>0&&t.jsx("div",{style:{...c.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,a.bodyS*.85))}px`,marginTop:`${n*.5}px`,marginBottom:"2px"},children:t.jsxs("span",{style:{color:"#6b7280"},children:["Guessed letters: ",t.jsx("strong",{children:j.join(", ")})]})}),h==="win"&&t.jsx("div",{style:{...c.gmStatusWin,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...c.gmStatusLose,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:$})]}),h!==null&&v<k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${n}px`},children:t.jsx("button",{onClick:Me,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${Math.max(11,Math.min(14,a.button*.85))}px`,padding:`${n*.6}px ${n*1.2}px`,borderRadius:`${S}px`},children:"NEXT"})}),h!==null&&v>=k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${n}px`},children:t.jsx("button",{onClick:()=>f("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`},children:"View results"})}),h===null&&j.length===0&&t.jsx("p",{style:{...c.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${n}px`,marginBottom:`${n}px`},children:"Type a letter on your keyboard"})]}):x==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...c.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${n*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...c.gmBodyL,fontSize:`${a.bodyL}px`,marginBottom:`${n*2}px`},children:["You guessed ",t.jsx("strong",{children:K})," out of ",t.jsx("strong",{children:k})," words correctly."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:`${n}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!y||k===0){f("lobby");return}T([]);const e=N(y,[]);e&&(z(e),T([e]),H([]),F(0),C(1),Y(0),L(null),f("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...c.gmButton,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Play again"}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...c.gmButton,...c.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${n}px ${n*1.5}px`,borderRadius:`${S}px`,minWidth:"200px"},children:"Exit"})]})]}):null;return t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"transparent",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:t.jsx("div",{style:{width:g?"100%":u||r||1e3,height:g?"100%":u||r||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:g?0:"20px",background:"#ffffff",boxShadow:g?"none":"0 0 40px rgba(0,0,0,0.1)",margin:g?"0 auto":"unset",position:"relative",transform:g&&!i?`scale(${J})`:void 0},children:t.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{style:$e,children:ve()})})})})}exports.Game=de;exports.HangmanLobbyGame=de;exports.default=de;
46
46
  //# sourceMappingURL=speakid-hangman.cjs.js.map