speakid-hangman 1.0.6 → 1.0.7

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 +1 @@
1
- {"version":3,"file":"HangmanLobbyGame.d.ts","sourceRoot":"","sources":["../../src/components/HangmanLobbyGame.tsx"],"names":[],"mappings":"AA+MA,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAkB,EAClB,YAAkB,EAClB,WAAiB,EACjB,OAAO,EACP,QAAe,EACf,OAAO,GACR,GAAE,qBAA0B,2CAkjC5B"}
1
+ {"version":3,"file":"HangmanLobbyGame.d.ts","sourceRoot":"","sources":["../../src/components/HangmanLobbyGame.tsx"],"names":[],"mappings":"AA+MA,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,YAAkB,EAClB,YAAkB,EAClB,WAAiB,EACjB,OAAO,EACP,QAAe,EACf,OAAO,GACR,GAAE,qBAA0B,2CAukC5B"}
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":""}
@@ -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"),i={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:"16px",left:"16px",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 Se({mistakes:r,maxMistakes:U,size:D=200}){const c=D,g=D*1.25,b=Math.max(3,D/100),B=10*(c/200),m=240*(g/250),x=150*(c/200),f=80*(c/200),q=20*(g/250),G=240*(g/250),k=80*(c/200),Q=20*(g/250),S=150*(c/200),z=150*(c/200),M=20*(g/250),W=50*(g/250),$=150*(c/200),C=70*(g/250),_=20*(c/200),v=150*(c/200),K=90*(g/250),A=150*(g/250),h=150*(c/200),j=110*(g/250),u=130*(c/200),H=130*(g/250),J=150*(c/200),I=110*(g/250),ce=170*(c/200),F=130*(g/250),ee=150*(c/200),N=150*(g/250),d=130*(c/200),te=190*(g/250),R=150*(c/200),ne=150*(g/250),p=170*(c/200),oe=190*(g/250),y=r===0||r<=U*.5?"#1f2937":r<=U*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:c,height:g,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:B,y1:m,x2:x,y2:m,stroke:y,strokeWidth:b}),r>1&&t.jsx("line",{x1:f,y1:q,x2:f,y2:G,stroke:y,strokeWidth:b}),r>2&&t.jsx("line",{x1:k,y1:Q,x2:S,y2:Q,stroke:y,strokeWidth:b}),r>3&&t.jsx("line",{x1:z,y1:M,x2:z,y2:W,stroke:y,strokeWidth:b}),r>4&&t.jsx("circle",{cx:$,cy:C,r:_,stroke:y,fill:"none",strokeWidth:b}),r>5&&t.jsx("line",{x1:v,y1:K,x2:v,y2:A,stroke:y,strokeWidth:b}),r>6&&t.jsx("line",{x1:h,y1:j,x2:u,y2:H,stroke:y,strokeWidth:b}),r>7&&t.jsx("line",{x1:J,y1:I,x2:ce,y2:F,stroke:y,strokeWidth:b}),r>8&&t.jsx("line",{x1:ee,y1:N,x2:d,y2:te,stroke:y,strokeWidth:b}),r>9&&t.jsx("line",{x1:R,y1:ne,x2:p,y2:oe,stroke:y,strokeWidth:b})]})}function le({gameCubeSize:r=400,screenHeight:U=800,screenWidth:D=800,logoUrl:c,showLogo:g=!0,baseURL:b}={}){const B={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"]},[m,x]=l.useState("lobby"),[f,q]=l.useState(""),[G]=l.useState("Normal"),[k,Q]=l.useState(0),[S,z]=l.useState(1),[M,W]=l.useState(""),[$,C]=l.useState([]),[_,v]=l.useState(0),[K,A]=l.useState(0),[h,j]=l.useState(null),[u,H]=l.useState(null),[J,I]=l.useState(1),[ce,F]=l.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,N=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[d,te]=l.useState(!1),[R,ne]=l.useState(!1),[p,oe]=l.useState(!1),a=l.useMemo(()=>{const e=(u||r||1e3)/400,n=p?.8:1;return{headline1:d?Math.max(24,Math.min(30,30*e*n)):Math.max(28,Math.min(32,32*e)),headline2:Math.max(20,Math.min(28,24*e*n)),headline3:d?Math.max(14,Math.min(18,16*e*n)):Math.max(20,Math.min(26,24*e*n)),bodyL:Math.max(14,Math.min(20,18*e*n)),bodyM:d?Math.max(12,Math.min(16,14*e*n)):Math.max(14,Math.min(18,16*e*n)),bodyS:d?Math.max(10,Math.min(14,12*e*n)):Math.max(12,Math.min(16,14*e*n)),wordDisplay:Math.max(18,Math.min(32,26*e*n)),button:Math.max(12,Math.min(18,16*e*n))}},[d,u,r,p]),y=l.useMemo(()=>{const e=(u||r||1e3)/400,n=p?.65:1;return R?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*n},[R,u,r,p]),o=l.useMemo(()=>{const e=(u||r||1e3)/400,n=p?.65:1;return R?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*n},[R,u,r,p]),w=l.useMemo(()=>{const e=(u||r||1e3)/400;return Math.max(6,Math.min(10,8*e))},[u,r]),ue=(e,n)=>e.split("").every(s=>n.includes(s)),pe=(e,n)=>e.split("").map(s=>n.includes(s)?s:"_").join(" "),he=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(s=>!e.includes(s)),P=(e,n=[])=>{var Z;if(!e||!B[e]){const T=Object.keys(B)[0];return((Z=B[T])==null?void 0:Z[0])||""}const s=B[e];if(!s||s.length===0)return"";const L=s.filter(T=>!n.includes(T)),E=L.length>0?L:s;if(E.length===0)return"";let X;if(typeof crypto<"u"&&crypto.getRandomValues){const T=new Uint32Array(1);crypto.getRandomValues(T);const Y=T[0]/4294967295;X=Math.floor(Y*E.length)}else X=Math.floor(Math.random()*E.length);return E[X]},me=()=>{if(!f)return;F([]);const e=P(f,[]);if(!e){x("category");return}W(e),F([e]),C([]),v(0),z(1),A(0),j(null),x("game")},re=l.useCallback(e=>{if(m!=="game"||h!==null)return;const n=e.toLowerCase();/^[a-z]$/.test(n)&&(C(s=>s.includes(n)?s:[...s,n]),W(s=>(s&&!s.includes(n)&&v(L=>L+1),s)))},[m,h]),se=l.useCallback(e=>{re(e.key)},[re]);l.useEffect(()=>{if(m==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[m,se]);const xe=M?pe(M,$):"",de=M?ue(M,$):!1,ge=_>=10,fe=he($),ie=l.useCallback(()=>{if(!f||S>=k){x("result");return}z(e=>e+1),F(e=>{const n=P(f,e);return n?(W(n),[...e,n]):e}),C([]),v(0),j(null)},[f,S,k]);l.useEffect(()=>{if(de&&h===null){j("win"),A(n=>n+1);const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}if(ge&&h===null){j("lose");const e=setTimeout(()=>{ie()},2e3);return()=>clearTimeout(e)}},[de,ge,h,ie]);const ye=()=>{if(!f||S>=k){x("result");return}z(e=>e+1),F(e=>{const n=P(f,e);return n?(W(n),[...e,n]):e}),C([]),v(0),j(null)};l.useEffect(()=>{const e=()=>{const n=window.innerWidth,s=window.innerHeight,L=n<768||n===926&&s===428||n===932&&s===430,E=s<700,X=n/s>1.8,Z=n===1024&&s===600,T=L&&n>s;if(te(L),ne(Z),oe(T),r&&r>=320){const Me=Math.max(320,Math.min(1200,r));H(Me),I(1)}else if(L)H(null),I(1);else if(E)H(null),I(1);else if(X){const Y=Math.min(1e3,Math.min(n,s)*.9);H(Y),I(.85)}else{const Y=Math.min(1e3,Math.min(n,s)*.9);H(Y),I(1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]);const V=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),i={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:"16px",left:"16px",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 Te({mistakes:s,maxMistakes:U,size:D=200}){const d=D,u=D*1.25,b=Math.max(3,D/100),z=10*(d/200),x=240*(u/250),f=150*(d/200),y=80*(d/200),q=20*(u/250),G=240*(u/250),w=80*(d/200),Q=20*(u/250),v=150*(d/200),W=150*(d/200),$=20*(u/250),C=50*(u/250),j=150*(d/200),H=70*(u/250),_=20*(d/200),F=150*(d/200),K=90*(u/250),Y=150*(u/250),h=150*(d/200),L=110*(u/250),p=130*(d/200),A=130*(u/250),J=150*(d/200),R=110*(u/250),ge=170*(d/200),T=130*(u/250),ee=150*(d/200),N=150*(u/250),g=130*(d/200),te=190*(u/250),I=150*(d/200),ne=150*(u/250),m=170*(d/200),oe=190*(u/250),k=s===0||s<=U*.5?"#1f2937":s<=U*.75?"#f59e0b":"#ec4c44";return t.jsxs("svg",{width:d,height:u,viewBox:"0 0 200 250",style:{display:"block",margin:"0 auto",overflow:"visible",WebkitFontSmoothing:"antialiased",transform:"translateZ(0)"},children:[s>0&&t.jsx("line",{x1:z,y1:x,x2:f,y2:x,stroke:k,strokeWidth:b}),s>1&&t.jsx("line",{x1:y,y1:q,x2:y,y2:G,stroke:k,strokeWidth:b}),s>2&&t.jsx("line",{x1:w,y1:Q,x2:v,y2:Q,stroke:k,strokeWidth:b}),s>3&&t.jsx("line",{x1:W,y1:$,x2:W,y2:C,stroke:k,strokeWidth:b}),s>4&&t.jsx("circle",{cx:j,cy:H,r:_,stroke:k,fill:"none",strokeWidth:b}),s>5&&t.jsx("line",{x1:F,y1:K,x2:F,y2:Y,stroke:k,strokeWidth:b}),s>6&&t.jsx("line",{x1:h,y1:L,x2:p,y2:A,stroke:k,strokeWidth:b}),s>7&&t.jsx("line",{x1:J,y1:R,x2:ge,y2:T,stroke:k,strokeWidth:b}),s>8&&t.jsx("line",{x1:ee,y1:N,x2:g,y2:te,stroke:k,strokeWidth:b}),s>9&&t.jsx("line",{x1:I,y1:ne,x2:m,y2:oe,stroke:k,strokeWidth:b})]})}function de({gameCubeSize:s=400,screenHeight:U=800,screenWidth:D=800,logoUrl:d,showLogo:u=!0,baseURL:b}={}){const z={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]=a.useState("lobby"),[y,q]=a.useState(""),[G]=a.useState("Normal"),[w,Q]=a.useState(0),[v,W]=a.useState(1),[$,C]=a.useState(""),[j,H]=a.useState([]),[_,F]=a.useState(0),[K,Y]=a.useState(0),[h,L]=a.useState(null),[p,A]=a.useState(null),[J,R]=a.useState(1),[ge,T]=a.useState([]),ee=G==="Easy"?8:G==="Normal"?6:4,N=b||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman`:"/cloud/speakid/games/hangman"),[g,te]=a.useState(!1),[I,ne]=a.useState(!1),[m,oe]=a.useState(!1),[M,k]=a.useState(!1),l=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.8:1,r=M?.9:1,c=n*r;return{headline1:g?Math.max(24,Math.min(30,30*e*c)):Math.max(28,Math.min(32,32*e*r)),headline2:Math.max(20,Math.min(28,24*e*c)),headline3:g?Math.max(14,Math.min(18,16*e*c)):Math.max(20,Math.min(26,24*e*c)),bodyL:Math.max(14,Math.min(20,18*e*c)),bodyM:g?Math.max(12,Math.min(16,14*e*c)):Math.max(14,Math.min(18,16*e*c)),bodyS:g?Math.max(10,Math.min(14,12*e*c)):Math.max(12,Math.min(16,14*e*c)),wordDisplay:Math.max(18,Math.min(32,26*e*c)),button:Math.max(12,Math.min(18,16*e*c))}},[g,p,s,m,M]),ue=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(8,Math.min(12,10*e)):Math.max(12,Math.min(24,16*e))*n*r},[I,p,s,m,M]),o=a.useMemo(()=>{const e=(p||s||1e3)/400,n=m?.65:1,r=M?.85:1;return I?Math.max(3,Math.min(6,5*e)):Math.max(4,Math.min(12,8*e))*n*r},[I,p,s,m,M]),S=a.useMemo(()=>{const e=(p||s||1e3)/400,n=M?.9:1;return Math.max(6,Math.min(10,8*e*n))},[p,s,M]),xe=(e,n)=>e.split("").every(r=>n.includes(r)),fe=(e,n)=>e.split("").map(r=>n.includes(r)?r:"_").join(" "),ye=e=>"abcdefghijklmnopqrstuvwxyz".split("").filter(r=>!e.includes(r)),P=(e,n=[])=>{var Z;if(!e||!z[e]){const B=Object.keys(z)[0];return((Z=z[B])==null?void 0:Z[0])||""}const r=z[e];if(!r||r.length===0)return"";const c=r.filter(B=>!n.includes(B)),E=c.length>0?c:r;if(E.length===0)return"";let X;if(typeof crypto<"u"&&crypto.getRandomValues){const B=new Uint32Array(1);crypto.getRandomValues(B);const le=B[0]/4294967295;X=Math.floor(le*E.length)}else X=Math.floor(Math.random()*E.length);return E[X]},be=()=>{if(!y)return;T([]);const e=P(y,[]);if(!e){f("category");return}C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game")},re=a.useCallback(e=>{if(x!=="game"||h!==null)return;const n=e.toLowerCase();/^[a-z]$/.test(n)&&(H(r=>r.includes(n)?r:[...r,n]),C(r=>(r&&!r.includes(n)&&F(c=>c+1),r)))},[x,h]),se=a.useCallback(e=>{re(e.key)},[re]);a.useEffect(()=>{if(x==="game")return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[x,se]);const ke=$?fe($,j):"",pe=$?xe($,j):!1,me=_>=10,we=ye(j),ie=a.useCallback(()=>{if(!y||v>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)},[y,v,w]);a.useEffect(()=>{if(pe&&h===null){L("win"),Y(n=>n+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>=w){f("result");return}W(e=>e+1),T(e=>{const n=P(y,e);return n?(C(n),[...e,n]):e}),H([]),F(0),L(null)};a.useEffect(()=>{const e=()=>{const n=window.innerWidth,r=window.innerHeight,c=n<768||n===926&&r===428||n===932&&r===430,E=r<700,X=n/r>1.8,Z=n===1024&&r===600,B=c&&n>r,le=n>=1200&&n<=1400;if(te(c),ne(Z),oe(B),k(le),c)A(null),R(1);else if(E)A(null),R(1);else{const je=n-80,Fe=r-80,he=Math.min(je,Fe);let ce;s&&s>=320?ce=Math.min(s,he):ce=Math.min(1e3,he*.9);const Le=Math.max(400,Math.min(1200,ce));A(Le),R(X?.85:1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]);const V=`
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
- `,be=!d&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!d&&g&&(m!=="game"||be),ke={...i.gmCenterScreen,width:"100%",height:"100%",padding:`${y}px`,paddingTop:ae?"60px":`${y}px`,overflow:"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=l.useMemo(()=>{const e=window.innerWidth,n=window.innerHeight;if(d&&e>n||n<700||!ae)return null;const s=c||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:i.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${s}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${s}.png`,alt:"SPEAKID Logo",style:i.gmLogoImg,loading:"lazy"})]})})},[d,ae,c,m]),we=()=>m==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>x("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${o*1.2}px ${o*3}px`,borderRadius:`${w*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:`${o}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:`${N}/sun.png`,alt:"Sun",style:{position:"absolute",left:d?"-10%":"5%",top:"20%",width:"auto",height:d?`${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:`${N}/character.png`,alt:"Hangman character",style:{position:"absolute",right:d?"5%":"10%",bottom:"10%",width:"auto",height:d?`${Math.min(window.innerHeight*.33,200)}px`:`${Math.min((u||r||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):m==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>x("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${w}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,marginTop:`${o*4}px`,position:"relative",zIndex:1},children:Object.keys(B).map(e=>t.jsx("button",{onClick:()=>{q(e),x("rounds")},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${w*2}px`,margin:`${o/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))})]}):m==="rounds"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>x("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${w}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${o*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),me()},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${a.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${w*2}px`,margin:`${o/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))})]}):m==="game"?t.jsxs(t.Fragment,{children:[O,!p&&t.jsx("div",{dangerouslySetInnerHTML:{__html:V}})," ",t.jsxs("div",{style:{...i.gmInfoBox,padding:`${p?o*.6:o*.8}px`,marginBottom:`${p?o*.3:o*.5}px`,maxWidth:`${(u||r)*.9}px`},children:[t.jsxs("h3",{style:{...i.gmHeadline3,fontSize:`${a.headline3}px`,marginBottom:`${o*.5}px`},children:["Category: ",f]}),t.jsxs("p",{style:{...i.gmBodyM,fontSize:`${a.bodyM}px`,marginBottom:"0px"},children:["Round ",S," of ",k]})]}),M&&t.jsxs("p",{style:{...i.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${p?o*.3:o*.5}px`,marginBottom:`${p?o*.5:o}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:M.length})," letters long"]}),t.jsx("div",{style:{margin:`${p?o*.5:o}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Se,{mistakes:_,maxMistakes:ee,size:R?Math.max(80,Math.min(110,(u||r)*.16)):d?p?Math.max(70,Math.min(120,Math.min(window.innerWidth*.25,window.innerHeight*.15))):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:{...i.gmWordDisplay,fontSize:`${Math.max(16,Math.min(24,a.wordDisplay*.9))}px`,margin:`${p?o*.5:o}px 0`,letterSpacing:`${o*.8}px`,minHeight:`${Math.max(16,Math.min(24,a.wordDisplay*.9))*1.2}px`},children:xe||"Loading..."}),t.jsxs("div",{style:{...i.gmInfoBox,padding:`${p?o*.6:o}px`,marginTop:`${p?o*.5:o}px`,marginBottom:`${p?o*.5:o}px`,maxWidth:`${(u||r)*.95}px`},children:[t.jsx("p",{style:{...i.gmBodyS,fontSize:`${a.bodyS}px`,marginBottom:`${o}px`,fontWeight:500},children:"Available letters:"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${o/3}px`,justifyContent:"center",fontSize:`${Math.max(9,Math.min(12,a.bodyS*.75))}px`,fontFamily:'"Onest", system-ui, sans-serif'},children:fe.map(e=>t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:n=>{h===null&&(n.currentTarget.style.backgroundColor="#e5e7eb",n.currentTarget.style.cursor="pointer")},onMouseLeave:n=>{h===null&&(n.currentTarget.style.backgroundColor="#f9f9f9",n.currentTarget.style.cursor="pointer")},style:{padding:`${o/4}px ${o/3}px`,borderRadius:`${w*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${Math.max(o*1.5,(u||r)*.04)}px`,textAlign:"center",display:"inline-block",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${Math.max(9,Math.min(12,a.bodyS*.75))}px`,transition:"background-color 0.2s ease"},children:e},e))})]}),$.length>0&&t.jsx("div",{style:{...i.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,a.bodyS*.85))}px`,marginTop:`${o*.5}px`,marginBottom:"2px"},children:t.jsxs("span",{style:{color:"#6b7280"},children:["Guessed letters: ",t.jsx("strong",{children:$.join(", ")})]})}),h==="win"&&t.jsx("div",{style:{...i.gmStatusWin,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...i.gmStatusLose,fontSize:`${a.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:M})]}),h!==null&&S<k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:ye,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${Math.max(11,Math.min(14,a.button*.85))}px`,padding:`${o*.6}px ${o*1.2}px`,borderRadius:`${w}px`},children:"NEXT"})}),h!==null&&S>=k&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:()=>x("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${a.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${w}px`},children:"View results"})}),h===null&&$.length===0&&t.jsx("p",{style:{...i.gmBodyS,fontSize:`${a.bodyS}px`,marginTop:`${o}px`,marginBottom:`${o}px`},children:"Type a letter on your keyboard"})]}):m==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${a.headline1}px`,marginBottom:`${o*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...i.gmBodyL,fontSize:`${a.bodyL}px`,marginBottom:`${o*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:`${o}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!f||k===0){x("lobby");return}F([]);const e=P(f,[]);e&&(W(e),F([e]),C([]),v(0),z(1),A(0),j(null),x("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${a.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${w}px`,minWidth:"200px"},children:"Play again"}),t.jsx("button",{onClick:()=>x("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${a.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${w}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:d?"100%":u||r||1e3,height:d?"100%":u||r||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:d?0:"20px",background:"#ffffff",boxShadow:d?"none":"0 0 40px rgba(0,0,0,0.1)",margin:d?"0 auto":"unset",position:"relative",transform:`scale(${J})`},children:t.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{style:ke,children:we()})})})})}exports.Game=le;exports.HangmanLobbyGame=le;exports.default=le;
45
+ `,Se=!g&&typeof window<"u"&&window.innerWidth>=768&&window.innerWidth<1024,ae=!g&&u&&(x!=="game"||Se),$e={...i.gmCenterScreen,width:"100%",height:"100%",padding:`${ue}px`,paddingTop:ae?"60px":`${ue}px`,overflow:M?"hidden":"auto",position:"relative",boxSizing:"border-box",background:"transparent"},O=a.useMemo(()=>{const e=window.innerWidth,n=window.innerHeight;if(g&&e>n||n<700||!ae)return null;const r=d||(typeof window<"u"&&window.origin?`${window.origin}/cloud/speakid/games/hangman/logo`:"/cloud/speakid/games/hangman/logo");return t.jsx("div",{style:i.gmLogoFixed,children:t.jsxs("picture",{children:[t.jsx("source",{srcSet:`${r}.svg`,type:"image/svg+xml"}),t.jsx("img",{src:`${r}.png`,alt:"SPEAKID Logo",style:i.gmLogoImg,loading:"lazy"})]})})},[g,ae,d,x]),ve=()=>x==="lobby"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:"HANGMAN"}),t.jsxs("button",{onClick:()=>f("category"),style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*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:`${l.button*1.3}px`,height:`${l.button*1.3}px`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",marginRight:`${o}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:`${N}/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((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}}),t.jsx("img",{src:`${N}/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((p||s||1e3)*.33,300)}px`,maxHeight:"33vh",objectFit:"contain",opacity:.6}})]})]}):x==="category"?t.jsxs(t.Fragment,{children:[O,t.jsx("div",{dangerouslySetInnerHTML:{__html:V}}),t.jsx("button",{onClick:()=>f("lobby"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,marginTop:`${o*4}px`,position:"relative",zIndex:1},children:Object.keys(z).map(e=>t.jsx("button",{onClick:()=>{q(e),f("rounds")},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/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:V}}),t.jsx("button",{onClick:()=>f("category"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#e5e7eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#f9f9f9"},style:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`,position:"absolute",top:"52px",left:"16px",zIndex:10},children:"←"}),t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`,position:"relative",zIndex:1},children:"Choose rounds"}),t.jsx("div",{style:{...i.gmButtonGroup,gap:`${o}px`,marginBottom:`${o*3}px`,position:"relative",zIndex:1},children:[1,3,5].map(e=>t.jsx("button",{onClick:()=>{Q(e),be()},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="#f0f0f0",n.currentTarget.style.borderColor="#1f2937",n.currentTarget.style.transform="scale(1.05)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.borderColor="#e5e7eb",n.currentTarget.style.transform="scale(1)"},style:{fontFamily:'"Onest", system-ui, sans-serif',fontWeight:500,fontSize:`${l.button}px`,padding:`${o*1.2}px ${o*2}px`,borderRadius:`${S*2}px`,margin:`${o/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,!m&&t.jsx("div",{dangerouslySetInnerHTML:{__html:V}})," ",t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o*.8}px`,marginBottom:`${m?o*.3:o*.5}px`,maxWidth:`${(p||s)*.9}px`},children:[t.jsxs("h3",{style:{...i.gmHeadline3,fontSize:`${l.headline3}px`,marginBottom:`${o*.5}px`},children:["Category: ",y]}),t.jsxs("p",{style:{...i.gmBodyM,fontSize:`${l.bodyM}px`,marginBottom:"0px"},children:["Round ",v," of ",w]})]}),$&&t.jsxs("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${m?o*.3:o*.5}px`,marginBottom:`${m?o*.5:o}px`},children:["I am thinking of a word that is ",t.jsx("strong",{children:$.length})," letters long"]}),t.jsx("div",{style:{margin:`${m?o*.5:o}px 0`,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(Te,{mistakes:_,maxMistakes:ee,size:I?Math.max(80,Math.min(110,(p||s)*.16)):g?m?Math.max(70,Math.min(120,Math.min(window.innerWidth*.25,window.innerHeight*.15))):Math.max(100,Math.min(150,Math.min(window.innerWidth*.3,window.innerHeight*.2))):Math.max(100,Math.min(150,(p||s)*.2))})}),t.jsx("div",{style:{...i.gmWordDisplay,fontSize:`${Math.max(16,Math.min(24,l.wordDisplay*.9))}px`,margin:`${m?o*.5:o}px 0`,letterSpacing:`${o*.8}px`,minHeight:`${Math.max(16,Math.min(24,l.wordDisplay*.9))*1.2}px`},children:ke||"Loading..."}),t.jsxs("div",{style:{...i.gmInfoBox,padding:`${m?o*.6:o}px`,marginTop:`${m?o*.5:o}px`,marginBottom:`${m?o*.5:o}px`,maxWidth:`${(p||s)*.95}px`},children:[t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginBottom:`${o}px`,fontWeight:500},children:"Available letters:"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:`${o/3}px`,justifyContent:"center",fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,fontFamily:'"Onest", system-ui, sans-serif'},children:we.map(e=>t.jsx("button",{onClick:()=>re(e),disabled:h!==null,onMouseEnter:n=>{h===null&&(n.currentTarget.style.backgroundColor="#e5e7eb",n.currentTarget.style.cursor="pointer")},onMouseLeave:n=>{h===null&&(n.currentTarget.style.backgroundColor="#f9f9f9",n.currentTarget.style.cursor="pointer")},style:{padding:`${o/4}px ${o/3}px`,borderRadius:`${S*.5}px`,background:"#f9f9f9",color:"#1f2937",border:"1px solid #e5e7eb",minWidth:`${Math.max(o*1.5,(p||s)*.04)}px`,textAlign:"center",display:"inline-block",cursor:h===null?"pointer":"default",fontFamily:'"Onest", system-ui, sans-serif',fontSize:`${Math.max(9,Math.min(12,l.bodyS*.75))}px`,transition:"background-color 0.2s ease"},children:e},e))})]}),j.length>0&&t.jsx("div",{style:{...i.gmGuessedLetters,fontSize:`${Math.max(10,Math.min(12,l.bodyS*.85))}px`,marginTop:`${o*.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:{...i.gmStatusWin,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:"🎉 You won this round!"}),h==="lose"&&t.jsxs("div",{style:{...i.gmStatusLose,fontSize:`${l.bodyL}px`,margin:"2px 0"},children:["The hangman is complete! The word was: ",t.jsx("strong",{children:$})]}),h!==null&&v<w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:Me,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${Math.max(11,Math.min(14,l.button*.85))}px`,padding:`${o*.6}px ${o*1.2}px`,borderRadius:`${S}px`},children:"NEXT"})}),h!==null&&v>=w&&t.jsx("div",{style:{marginTop:"2px",marginBottom:`${o}px`},children:t.jsx("button",{onClick:()=>f("result"),onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*1.5}px`,borderRadius:`${S}px`},children:"View results"})}),h===null&&j.length===0&&t.jsx("p",{style:{...i.gmBodyS,fontSize:`${l.bodyS}px`,marginTop:`${o}px`,marginBottom:`${o}px`},children:"Type a letter on your keyboard"})]}):x==="result"?t.jsxs(t.Fragment,{children:[O,t.jsx("h1",{style:{...i.gmHeadline1,fontSize:`${l.headline1}px`,marginBottom:`${o*2}px`},children:"🎊 Game Finished!"}),t.jsxs("p",{style:{...i.gmBodyL,fontSize:`${l.bodyL}px`,marginBottom:`${o*2}px`},children:["You guessed ",t.jsx("strong",{children:K})," out of ",t.jsx("strong",{children:w})," words correctly."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:`${o}px`,alignItems:"center"},children:[t.jsx("button",{onClick:()=>{if(!y||w===0){f("lobby");return}T([]);const e=P(y,[]);e&&(C(e),T([e]),H([]),F(0),W(1),Y(0),L(null),f("game"))},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#d43a32"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ec4c44"},style:{...i.gmButton,fontSize:`${l.button}px`,padding:`${o}px ${o*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:{...i.gmButton,...i.gmButtonSecondary,fontSize:`${l.button}px`,padding:`${o}px ${o*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%":p||s||1e3,height:g?"100%":p||s||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:`scale(${J})`},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