@mblinkov/whats-missing 20.0.56 → 21.0.1

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.
@@ -0,0 +1,4 @@
1
+ export declare function playSound(url: string, volume?: number): void;
2
+ /** Same correct/wrong sounds as Critter Quiz (CDN in prod, /public/sounds in dev). */
3
+ export declare function resolveSoundsBaseURL(): string;
4
+ export declare function playAnswerSound(result: "correct" | "wrong"): void;
package/dist/themes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type Theme = "animals" | "food" | "toys" | "clothes" | "transport" | "nature" | "home" | "school";
1
+ export type Theme = "animals" | "food" | "toys" | "clothes" | "transport" | "nature" | "home" | "school" | "music" | "sports" | "body" | "weather";
2
2
  export type ImageItem = {
3
3
  src: string;
4
4
  name: string;
@@ -1,12 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("react"),oi=`
2
- @keyframes spin {
3
- from { transform: rotate(0deg); }
4
- to { transform: rotate(360deg); }
5
- }
6
- `;if(typeof document<"u"&&!document.getElementById("spin-keyframes")){const d=document.createElement("style");d.id="spin-keyframes",d.innerHTML=oi,document.head.appendChild(d)}const wi={animation:"spin 1.4s linear infinite"},o={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",transform:"translateY(20px)"},gmHeadline1:{fontWeight:700,fontSize:"clamp(28px, 4vw, 40px)",lineHeight:"110%"},gmHeadline3:{fontWeight:600,fontSize:"18px",lineHeight:"130%"},gmBodyM:{fontWeight:400,fontSize:"16px",lineHeight:"140%"},gmBodyS:{fontWeight:400,fontSize:"14px",lineHeight:"140%",color:"#6b7280"},gmButton:{fontFamily:'"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',fontWeight:600,fontSize:"16px",padding:"10px 16px",borderRadius:"12px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"0 6px 18px rgba(236, 76, 68, .18)",transition:"transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"},gmButtonActive:{background:"#333",color:"#fff"},gmGameLayout:{position:"relative",width:"100%",maxWidth:"none",minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",color:"#1f2937",padding:"16px 8px",margin:"0 auto"},gmGrid:{width:"100%",maxWidth:"none",margin:"0 auto",display:"grid",gridTemplateColumns:"repeat(3, 210px)",gridAutoRows:"210px",gap:"20px",justifyContent:"center"},gmInput:{padding:"6px 10px",borderRadius:"6px",border:"1px solid #ccc",fontSize:"16px",fontFamily:'"Geist", system-ui',width:"160px"},gmTable:{marginTop:"20px",marginBottom:"32px",borderCollapse:"collapse",width:"100%",maxWidth:"520px",tableLayout:"fixed",textAlign:"center"},gmTableCell:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},gmLogoFixed:{position:"absolute",top:"28px",left:"16px",width:"120px",zIndex:10,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"clamp(28px, 5vw, 40px)",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},gmHourglass:{fontSize:"42px",...wi}},di=window.origin+"/cloud/speakid/games/whatsmissing/",M=(d,a)=>d.map(([g,s,...p])=>({src:`${di}${a}/${s.replace(/\s/g,"%20")}.png`,name:s,aliases:p?.length?p:void 0})),ri=[["apple","apple"],["banana","banana"],["bread","bread"],["burger","burger"],["cake","cake"],["carrot","carrot"],["cheese","cheese"],["chicken","chicken"],["chocolate","chocolate"],["corn","corn"],["donut","donut"],["fish","fish"],["fries","fries"],["grapes","grapes"],["ice_cream","ice cream"],["milk","milk"],["orange","orange"],["pear","pear"],["pizza","pizza"],["rice","rice"],["sandwich","sandwich"],["soup","soup"],["strawberry","strawberry"],["tomato","tomato"],["watermelon","watermelon"]],hi=[["bear","bear"],["cat","cat"],["crocodile","crocodile","alligator"],["dolphin","dolphin"],["elephant","elephant"],["fox","fox"],["giraffe","giraffe"],["horse","horse"],["kangaroo","kangaroo"],["lion","lion"],["monkey","monkey"],["owl","owl"],["panda","panda"],["penguin","penguin"],["squirrel","squirrel"],["tiger","tiger"],["tortoise","tortoise","turtle"],["wolf","wolf"],["zebra","zebra"]],si=[["ball","ball"],["balloon","balloon"],["blocks","blocks"],["car","car"],["doll","doll"],["drum","drum"],["guitar","guitar"],["jump_rope","jump rope"],["kite","kite"],["paints","paints"],["plane","plane"],["puzzle","puzzle"],["rocket","rocket"],["scooter","scooter"],["skateboard","skateboard"],["slide","slide"],["teddy_bear","teddy bear"],["yo-yo","yo-yo"],["crayons","crayons"]],ai=[["t-shirt","T-shirt"],["dress","dress"],["hat","hat"],["shoes","shoes"],["socks","socks"],["coat","coat"],["skirt","skirt"],["trousers","trousers"],["jacket","jacket"],["scarf","scarf"],["gloves","gloves"],["shorts","shorts"],["cap","cap"],["boots","boots"],["pyjamas","pyjamas"]],gi=[["car","car"],["bus","bus"],["bike","bike"],["train","train"],["plane","plane"],["boat","boat"],["ship","ship"],["helicopter","helicopter"],["lorry","lorry","truck"],["taxi","taxi"],["rocket","rocket"],["van","van"],["motorbike","motorbike"],["tram","tram"],["submarine","submarine"]],pi=[["sun","sun"],["cloud","cloud"],["rain","rain"],["tree","tree"],["flower","flower"],["grass","grass"],["star","star"],["moon","moon"],["mountain","mountain"],["river","river"],["rainbow","rainbow"],["snowman","snowman"],["snow","snow"],["butterfly","butterfly"],["bird","bird"]],li=[["bed","bed"],["table","table"],["chair","chair"],["door","door"],["window","window"],["lamp","lamp"],["sofa","sofa"],["clock","clock"],["key","key"],["phone","phone"],["tv","TV"],["cup","cup"],["plate","plate"],["mirror","mirror"],["book","book"]],ci=[["book","book"],["pen","pen"],["pencil","pencil"],["bag","bag"],["ruler","ruler"],["rubber","rubber","eraser"],["desk","desk"],["board","board"],["crayon","crayon"],["glue","glue"],["scissors","scissors"],["notebook","notebook"],["pencil_case","pencil case"],["paintbrush","paintbrush"],["backpack","backpack"]],F={food:M(ri,"food"),animals:M(hi,"animals"),toys:M(si,"toys"),clothes:M(ai,"clothes"),transport:M(gi,"transport"),nature:M(pi,"nature"),home:M(li,"home"),school:M(ci,"school")},xi=["animals","food","toys","clothes","transport","nature","home","school"],Hi={animals:"🐶 Animals",food:"🍎 Food",toys:"🧸 Toys",clothes:"👕 Clothes",transport:"🚗 Transport",nature:"🌳 Nature",home:"🏠 Home",school:"📚 School"},Wi=()=>{const d=document.createElement("style");d.id="whats-missing-reset",d.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react");var te=typeof document<"u"?document.currentScript:null;function Oe(i,c=.45){if(!(typeof window>"u"))try{const n=new Audio(i);n.volume=c;const a=()=>{n.currentTime=0,n.play().catch(()=>{})};if(n.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA){a();return}n.addEventListener("canplaythrough",a,{once:!0}),n.addEventListener("error",()=>{},{once:!0}),n.load()}catch{}}const qe="/cloud/speakid/games/critter-quiz/sounds/";function Ve(){return typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:te&&te.tagName.toUpperCase()==="SCRIPT"&&te.src||new URL("whats-missing.cjs.js",document.baseURI).href}<"u"&&!1?`${window.origin}/sounds/`:`${window.origin}${qe}`}function se(i){const c=i==="correct"?"correct.wav":"wrong.wav";Oe(`${Ve()}${c}`)}const Ze='@import"https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap";#whats-missing-root{font-family:Nunito,Fredoka,system-ui,-apple-system,Segoe UI,sans-serif;color:#1f2937;-webkit-font-smoothing:antialiased}#whats-missing-root h1,#whats-missing-root h2,#whats-missing-root p{margin:0}#whats-missing-root button{font:inherit;color:inherit;cursor:pointer}#whats-missing-root .wm-logo{position:absolute;top:28px;left:16px;z-index:30;pointer-events:none}#whats-missing-root .wm-logo img{display:block;height:28px;width:auto;object-fit:contain}#whats-missing-root .wm-lobby{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:24px;padding:40px 48px;box-sizing:border-box}#whats-missing-root .wm-lobbyHero{display:flex;align-items:center;justify-content:center;gap:20px}#whats-missing-root .wm-heroGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:168px;padding:10px;border-radius:18px;overflow:hidden;border:4px solid #fff;box-shadow:0 10px 28px #ec4c442e;background:#fff}#whats-missing-root .wm-heroTile{aspect-ratio:1;border-radius:10px;background:linear-gradient(180deg,#dbeafe,#93c5fd);border:2px solid #f2c4be}#whats-missing-root .wm-heroTile:nth-child(2){background:linear-gradient(180deg,#ffe8e2,#fecaca)}#whats-missing-root .wm-heroTile:nth-child(3){background:linear-gradient(180deg,#d1fae5,#86efac)}#whats-missing-root .wm-heroTileMissing{display:flex;align-items:center;justify-content:center;background:repeating-linear-gradient(45deg,#fff7f5,#fff7f5 6px,#ffe8e2 6px 12px);color:#ec4c44;font-size:28px;font-weight:900;line-height:1}#whats-missing-root .wm-lobbyArrow{width:36px;height:36px;flex-shrink:0;border-radius:50%;background:#ffffffd9;border:2px solid #f2c4be;position:relative}#whats-missing-root .wm-lobbyArrow:after{content:"";position:absolute;top:50%;left:50%;width:10px;height:10px;border-top:3px solid #ec4c44;border-right:3px solid #ec4c44;transform:translate(-60%,-50%) rotate(45deg)}#whats-missing-root .wm-lobbyGuess{display:flex;flex-direction:column;align-items:center;gap:8px}#whats-missing-root .wm-guessCard{min-width:148px;padding:18px 20px 14px;border-radius:18px;background:#ffffffeb;border:3px solid #f2c4be;box-shadow:0 6px 16px #1f29370f;text-align:center}#whats-missing-root .wm-guessPrompt{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#ec4c44}#whats-missing-root .wm-guessLine{margin-top:10px;height:28px;border-bottom:3px dashed #f2c4be;font-size:22px;font-weight:900;color:#1f2937;letter-spacing:.12em}#whats-missing-root .wm-lobbyHead{display:flex;flex-direction:column;align-items:center;gap:12px}#whats-missing-root .wm-brandTitle{font-size:48px;font-weight:900;letter-spacing:-.02em;color:#1f2937;text-align:center;line-height:1.05}#whats-missing-root .wm-brandAccent{color:#ec4c44}#whats-missing-root .wm-lobbySteps{display:flex;align-items:center;gap:20px;margin:0;padding:0;list-style:none}#whats-missing-root .wm-lobbySteps li{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:700;color:#4b5563}#whats-missing-root .wm-stepIcon{width:28px;height:28px;border-radius:8px;flex-shrink:0;border:2px solid #f2c4be;background:#fff;position:relative}#whats-missing-root .wm-stepIconLook{background:linear-gradient(180deg,#dbeafe,#93c5fd)}#whats-missing-root .wm-stepIconLook:after{content:"";position:absolute;inset:6px;border-radius:3px;border:2px solid #fff;box-shadow:inset 0 0 0 1px #1f293726}#whats-missing-root .wm-stepIconGuess{background:#fff7f5}#whats-missing-root .wm-stepIconGuess:after{content:"?";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:900;color:#ec4c44;line-height:1}#whats-missing-root .wm-stepIconWin{background:linear-gradient(180deg,#ffe8e2,#fecaca)}#whats-missing-root .wm-stepIconWin:after{content:"";position:absolute;left:50%;top:50%;width:10px;height:10px;border-radius:50%;background:#ec4c44;transform:translate(-50%,-50%);box-shadow:-6px 0 0 -2px #f9a8a4,6px 0 0 -2px #f9a8a4}#whats-missing-root .wm-roundsRow{display:flex;flex-direction:column;align-items:center;gap:8px}#whats-missing-root .wm-roundsLabel{font-size:14px;font-weight:800;color:#6b7280}#whats-missing-root .wm-roundsPills{display:flex;gap:10px}#whats-missing-root .wm-roundPill{min-width:56px;min-height:44px;padding:0 16px;border-radius:999px;border:3px solid #f2c4be;background:#ffffffe6;color:#4b5563;font-size:20px;font-weight:800;transition:border-color .15s,background .15s,transform .12s,color .15s}#whats-missing-root .wm-roundPill:hover{border-color:#ec4c44;transform:translateY(-1px)}#whats-missing-root .wm-roundPillActive{background:#ec4c44;border-color:#ec4c44;color:#fff;box-shadow:0 4px #c73a34}#whats-missing-root .wm-playBtn,#whats-missing-root .wm-againBtn{min-width:240px;min-height:72px;padding:0 48px;border:none;border-radius:999px;background:#ec4c44;color:#fff;font-size:32px;font-weight:800;letter-spacing:.04em;box-shadow:0 10px #c73a34;transition:transform .12s ease,box-shadow .12s ease}#whats-missing-root .wm-playBtn:hover,#whats-missing-root .wm-againBtn:hover{transform:translateY(-2px);box-shadow:0 12px #c73a34}#whats-missing-root .wm-playBtn:active,#whats-missing-root .wm-againBtn:active{transform:translateY(4px);box-shadow:0 4px #c73a34}#whats-missing-root .wm-topics{display:flex;flex-direction:column;height:100%;padding:28px 48px 32px;gap:14px;box-sizing:border-box}#whats-missing-root .wm-topicsHeader{display:flex;align-items:center;gap:16px;padding-top:44px;flex-shrink:0}#whats-missing-root .wm-topicsBack,#whats-missing-root .wm-ghostBtn{flex-shrink:0;min-height:44px;padding:0 18px;border:3px solid #f2c4be;border-radius:999px;background:#ffffffe6;color:#4b5563;font-size:16px;font-weight:700;transition:border-color .15s,transform .12s,background .15s}#whats-missing-root .wm-topicsBack:hover,#whats-missing-root .wm-ghostBtn:hover{border-color:#ec4c44;background:#fff;transform:translateY(-1px)}#whats-missing-root .wm-topicsTitle{font-size:36px;font-weight:800;color:#1f2937}#whats-missing-root .wm-topicsMeta{margin-left:auto;font-size:16px;font-weight:800;color:#ec4c44;padding:4px 12px;border-radius:999px;background:#ffffffeb;border:2px solid #f2c4be}#whats-missing-root .wm-topicsGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;flex:1;align-content:start;overflow:auto;padding-bottom:4px}#whats-missing-root .wm-topicCard{display:flex;flex-direction:row;align-items:stretch;gap:14px;min-height:88px;padding:0 16px 0 0;overflow:hidden;border:3px solid #f2c4be;border-radius:18px;background:#ffffffd9;text-align:left;transition:border-color .15s,transform .12s,background .15s}#whats-missing-root .wm-topicCardRandom{align-items:center;padding:10px 14px;background:linear-gradient(135deg,#fff7f5,#ffe8e2);border-color:#ec4c44;border-style:dashed}#whats-missing-root .wm-topicCard:hover{border-color:#ec4c44;transform:translateY(-2px);background:#fff}#whats-missing-root .wm-topicPreview{width:110px;flex-shrink:0;align-self:stretch;object-fit:cover;object-position:center;border:none;border-radius:15px 0 0 15px;background:#fff7f5}#whats-missing-root .wm-topicRandomIcon{width:52px;height:52px;flex-shrink:0;border-radius:12px;border:2px solid #f2c4be;background:#fff;position:relative}#whats-missing-root .wm-topicRandomIcon:before,#whats-missing-root .wm-topicRandomIcon:after{content:"";position:absolute;left:50%;top:50%;width:22px;height:4px;border-radius:2px;background:#ec4c44;transform:translate(-50%,-50%)}#whats-missing-root .wm-topicRandomIcon:after{transform:translate(-50%,-50%) rotate(90deg)}#whats-missing-root .wm-topicBody{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-width:0}#whats-missing-root .wm-topicLabel{font-size:18px;font-weight:800;color:#1f2937;line-height:1.2}#whats-missing-root .wm-topicExample{font-size:13px;color:#6b7280;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#whats-missing-root .wm-final{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:14px;padding:48px;box-sizing:border-box}#whats-missing-root .wm-finalTitle{font-size:52px;font-weight:900;color:#ec4c44}#whats-missing-root .wm-finalScore{font-size:26px;font-weight:700;color:#4b5563}#whats-missing-root .wm-finalTeamLabel{font-size:22px;font-weight:800;color:#1f2937;margin-top:4px}#whats-missing-root .wm-trophyRow{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;max-width:960px;margin:8px 0 12px;min-height:140px}#whats-missing-root .wm-trophyCard{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:120px}#whats-missing-root .wm-trophy{width:112px;height:112px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:#ffffffd9;border-radius:24px;border:4px solid #f2c4be;padding:8px}#whats-missing-root .wm-trophy.correct{border-color:#10b981;background:#ecfdf5}#whats-missing-root .wm-trophy.almost{border-color:#f59e0b;background:#fffbeb}#whats-missing-root .wm-trophy.wrong{border-color:#ef4444;background:#fef2f2}#whats-missing-root .wm-trophyMark{font-size:28px;font-weight:900;line-height:1}#whats-missing-root .wm-trophy.correct .wm-trophyMark{color:#059669}#whats-missing-root .wm-trophy.almost .wm-trophyMark{color:#d97706}#whats-missing-root .wm-trophy.wrong .wm-trophyMark{color:#dc2626}#whats-missing-root .wm-trophyWord{font-size:13px;font-weight:800;color:#1f2937;text-align:center;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#whats-missing-root .wm-trophyEmpty{font-size:20px;color:#9ca3af;align-self:center}#whats-missing-root .wm-finalActions{display:flex;align-items:center;gap:14px;margin-top:8px}#whats-missing-root .wm-againBtn{font-size:26px;min-width:260px}#whats-missing-root .wm-play{display:flex;flex-direction:column;height:100%;min-height:0;padding:56px 40px 16px;box-sizing:border-box;gap:10px;position:relative}#whats-missing-root .wm-play--ready{justify-content:center;align-items:center;padding:0;gap:0}#whats-missing-root .wm-play--ready .wm-playStatus{min-height:0}#whats-missing-root .wm-play--ready .wm-playControls{display:none}#whats-missing-root .wm-playStatus{flex-shrink:0;text-align:center;font-size:22px;font-weight:800;color:#4b5563;min-height:32px;line-height:1.2}#whats-missing-root .wm-playStatusReady{color:#ec4c44;font-size:48px;font-weight:900;letter-spacing:.04em}#whats-missing-root .wm-readyBlock{display:flex;flex-direction:column;align-items:center;gap:28px}#whats-missing-root .wm-readyLoad{display:flex;flex-direction:column;align-items:center;gap:18px}#whats-missing-root .wm-readyTiles{display:grid;grid-template-columns:1fr 1fr;gap:6px;width:120px;padding:8px;border-radius:16px;overflow:hidden;border:4px solid #fff;box-shadow:0 10px 28px #ec4c442e;background:#fff}#whats-missing-root .wm-readyTiles .wm-heroTile{border-radius:8px}#whats-missing-root .wm-play--ready .wm-heroTileMissing{animation:wm-ready-pulse .9s ease-in-out infinite}#whats-missing-root .wm-readyBar{width:220px;height:14px;border-radius:999px;background:#fff;border:3px solid #f2c4be;box-shadow:0 4px #f2c4be;overflow:hidden;box-sizing:border-box}#whats-missing-root .wm-readyBarFill{display:block;height:100%;width:0;border-radius:inherit;background:#ec4c44;animation:wm-ready-fill var(--wm-ready-s, 5s) linear forwards}@keyframes wm-ready-fill{0%{width:0}to{width:100%}}@keyframes wm-ready-pulse{0%,to{transform:scale(1)}50%{transform:scale(.92)}}#whats-missing-root .wm-playStatusMemorize{color:#10b981}#whats-missing-root .wm-playSlot{flex:1 1 0;min-height:0;width:100%;display:flex;align-items:center;justify-content:center}#whats-missing-root .wm-playGrid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:16px;width:min(100%,580px);aspect-ratio:1 / 1;max-height:100%}#whats-missing-root .wm-playCard{min-width:0;min-height:0;border-radius:18px;overflow:hidden;background:#fff;border:3px solid #f2c4be;box-shadow:0 8px 22px #ec4c441a;display:flex;align-items:center;justify-content:center}#whats-missing-root .wm-playCard img{width:100%;height:100%;object-fit:cover;object-position:center}#whats-missing-root .wm-playCardCorrect{border-color:#10b981;background:#ecfdf5;box-shadow:0 0 18px #10b98173}#whats-missing-root .wm-playCardWrong{border-color:#ec4c44;background:#fef2f2;box-shadow:0 0 18px #ec4c4459}#whats-missing-root .wm-playControls{flex-shrink:0;min-height:72px;display:flex;align-items:center;justify-content:center}#whats-missing-root .wm-guessRow{display:flex;align-items:center;justify-content:center;gap:12px}#whats-missing-root .wm-guessInput{width:280px;min-height:52px;padding:0 18px;border:3px solid #f2c4be;border-radius:16px;background:#fff;color:#1f2937;font-size:20px;font-weight:700;outline:none;box-sizing:border-box}#whats-missing-root .wm-guessInput:focus{border-color:#ec4c44}#whats-missing-root .wm-guessInput::placeholder{color:#9ca3af;font-weight:600}#whats-missing-root .wm-actionBtn{min-height:52px;min-width:140px;padding:0 28px;border:none;border-radius:999px;background:#ec4c44;color:#fff;font-size:20px;font-weight:800;letter-spacing:.02em;box-shadow:0 6px #c73a34;transition:transform .12s ease,box-shadow .12s ease}#whats-missing-root .wm-actionBtn:hover{transform:translateY(-2px);box-shadow:0 8px #c73a34}#whats-missing-root .wm-actionBtn:active{transform:translateY(3px);box-shadow:0 3px #c73a34}#whats-missing-root .wm-actionBtn:disabled{opacity:.7;cursor:default;transform:none;box-shadow:0 6px #c73a34}@media(prefers-reduced-motion:reduce){#whats-missing-root .wm-playBtn,#whats-missing-root .wm-againBtn,#whats-missing-root .wm-topicCard,#whats-missing-root .wm-roundPill,#whats-missing-root .wm-topicsBack,#whats-missing-root .wm-ghostBtn,#whats-missing-root .wm-actionBtn{transition:none}#whats-missing-root .wm-play--ready .wm-heroTileMissing{animation:none}#whats-missing-root .wm-readyBarFill{animation:none;width:100%}}',Ke=window.origin+"/cloud/speakid/games/whatsmissing/",Qe=i=>Ke,g=(i,c)=>i.map(([n,a,...d])=>({src:`${Qe()}${c}/${a.replace(/\s/g,"%20")}.png`,name:a,aliases:d?.length?d:void 0})),Xe=[["apple","apple"],["banana","banana"],["bread","bread"],["burger","burger"],["cake","cake"],["carrot","carrot"],["cheese","cheese"],["chicken","chicken"],["chocolate","chocolate"],["corn","corn"],["donut","donut"],["fish","fish"],["fries","fries"],["grapes","grapes"],["ice_cream","ice cream"],["milk","milk"],["orange","orange"],["pear","pear"],["pizza","pizza"],["rice","rice"],["sandwich","sandwich"],["soup","soup"],["strawberry","strawberry"],["tomato","tomato"],["watermelon","watermelon"]],Je=[["bear","bear"],["cat","cat"],["crocodile","crocodile","alligator"],["dolphin","dolphin"],["elephant","elephant"],["fox","fox"],["giraffe","giraffe"],["horse","horse"],["kangaroo","kangaroo"],["lion","lion"],["monkey","monkey"],["owl","owl"],["panda","panda"],["penguin","penguin"],["squirrel","squirrel"],["tiger","tiger"],["tortoise","tortoise","turtle"],["wolf","wolf"],["zebra","zebra"]],et=[["ball","ball"],["balloon","balloon"],["blocks","blocks"],["car","car"],["doll","doll"],["drum","drum"],["robot","robot"],["jump_rope","jump rope"],["kite","kite"],["paints","paints"],["plane","plane"],["puzzle","puzzle"],["rocket","rocket"],["scooter","scooter"],["skateboard","skateboard"],["slide","slide"],["teddy_bear","teddy bear"],["yo-yo","yo-yo"],["crayons","crayons"]],tt=[["t-shirt","T-shirt"],["dress","dress"],["hat","hat"],["shoes","shoes"],["socks","socks"],["coat","coat"],["skirt","skirt"],["trousers","trousers"],["jacket","jacket"],["scarf","scarf"],["gloves","gloves"],["shorts","shorts"],["cap","cap"],["boots","boots"],["pyjamas","pyjamas"]],st=[["car","car"],["bus","bus"],["bike","bike"],["train","train"],["plane","plane"],["boat","boat"],["ship","ship"],["helicopter","helicopter"],["lorry","lorry","truck"],["taxi","taxi"],["rocket","rocket"],["van","van"],["motorbike","motorbike"],["tram","tram"],["submarine","submarine"]],ot=[["sun","sun"],["cloud","cloud"],["rain","rain"],["tree","tree"],["flower","flower"],["grass","grass"],["star","star"],["moon","moon"],["mountain","mountain"],["river","river"],["rainbow","rainbow"],["snowman","snowman"],["snow","snow"],["butterfly","butterfly"],["bird","bird"]],it=[["bed","bed"],["table","table"],["chair","chair"],["door","door"],["window","window"],["lamp","lamp"],["sofa","sofa"],["clock","clock"],["key","key"],["phone","phone"],["tv","TV"],["cup","cup"],["plate","plate"],["mirror","mirror"],["book","book"]],nt=[["book","book"],["pen","pen"],["pencil","pencil"],["bag","bag"],["ruler","ruler"],["rubber","rubber","eraser"],["desk","desk"],["board","board"],["crayon","crayon"],["glue","glue"],["scissors","scissors"],["notebook","notebook"],["pencil_case","pencil case"],["paintbrush","paintbrush"],["backpack","backpack"]],rt=[["piano","piano"],["bell","bell","bells"],["radio","radio"],["cd","CD","disc"],["mic","mic","microphone"],["singer","singer"],["dancer","dancer"],["stage","stage"],["band","band"],["ticket","ticket"],["karaoke","karaoke"],["guitar","guitar"],["fan","fan"]],at=[["football","football","soccer"],["basketball","basketball"],["tennis","tennis"],["skiing","skiing","ski"],["swimming","swimming","swim"],["skating","skating","ice skating"],["hockey","hockey","ice hockey"],["volleyball","volleyball"],["golf","golf"],["boxing","boxing"],["running","running","run"],["medal","medal"],["trophy","trophy"],["whistle","whistle"],["helmet","helmet"]],ct=[["head","head"],["eye","eye","eyes"],["ear","ear","ears"],["nose","nose"],["mouth","mouth"],["hand","hand","hands"],["finger","finger","fingers"],["arm","arm","arms"],["leg","leg","legs"],["foot","foot","feet"],["knee","knee","knees"],["hair","hair"],["tooth","tooth","teeth"],["tongue","tongue"],["shoulder","shoulder","shoulders"]],lt=[["umbrella","umbrella"],["lightning","lightning","thunder"],["wind","wind"],["storm","storm"],["fog","fog","mist"],["ice","ice"],["raincoat","raincoat"],["puddle","puddle"],["snowflake","snowflake"],["icicle","icicle"],["thermometer","thermometer"],["tornado","tornado"],["raindrop","raindrop","drop"],["frost","frost"]],S={food:g(Xe,"food"),animals:g(Je,"animals"),toys:g(et,"toys"),clothes:g(tt,"clothes"),transport:g(st,"transport"),nature:g(ot,"nature"),home:g(it,"home"),school:g(nt,"school"),music:g(rt,"music"),sports:g(at,"sports"),body:g(ct,"body"),weather:g(lt,"weather")},oe=["animals","food","toys","clothes","transport","nature","home","school","music","sports","body","weather"],dt={animals:"Animals",food:"Food",toys:"Toys",clothes:"Clothes",transport:"Transport",nature:"Nature",home:"Home",school:"School",music:"Music",sports:"Sports",body:"Body",weather:"Weather"},mt={animals:"cat, dog, bear…",food:"apple, pizza, cake…",toys:"ball, doll, robot…",clothes:"T-shirt, hat, shoes…",transport:"car, bus, plane…",nature:"sun, tree, flower…",home:"bed, table, lamp…",school:"book, pen, bag…",music:"piano, guitar, singer…",sports:"football, skiing, medal…",body:"head, hand, eye…",weather:"umbrella, storm, snowflake…"},pt=()=>{const i=document.createElement("style");i.id="whats-missing-reset",i.textContent=`
7
2
  #whats-missing-root, #whats-missing-root * {
8
3
  box-sizing: border-box;
9
- font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
4
+ font-family: "Nunito", "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
10
5
  }
11
6
  #whats-missing-root img {
12
7
  max-width: 100%;
@@ -29,4 +24,5 @@
29
24
  height: 100% !important;
30
25
  overflow: hidden !important;
31
26
  }
32
- `;const a=document.getElementById("whats-missing-reset");a&&a.remove(),document.head.appendChild(d)};class mi{constructor(a){this.seed=a}next(){return this.seed=(this.seed*1664525+1013904223)%Math.pow(2,32),this.seed/Math.pow(2,32)}nextInt(a){return Math.floor(this.next()*a)}}const ui=(d,a)=>{const g=Array.from({length:d.length+1},()=>Array(a.length+1).fill(0));for(let s=0;s<=d.length;s++)g[s][0]=s;for(let s=0;s<=a.length;s++)g[0][s]=s;for(let s=1;s<=d.length;s++)for(let p=1;p<=a.length;p++)g[s][p]=d[s-1]===a[p-1]?g[s-1][p-1]:Math.min(g[s-1][p-1],g[s][p-1],g[s-1][p])+1;return g[d.length][a.length]},fi=d=>new Promise(a=>{const g=new Image;g.onload=()=>a(g),g.onerror=()=>a(g),g.src=d}),gn=async(d,a)=>{const g=new Map,s=d.map(async p=>{const j=await fi(p);g.set(p,j)});return await Promise.allSettled(s),g};function In({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const p=t.useRef(null);t.useEffect(()=>(Wi(),()=>{document.documentElement.style.overflow="",document.body.style.overflow="";const e=document.getElementById("whats-missing-reset");e&&e.remove(),I.current&&I.current.abort()}),[]);const[j,$]=t.useState(null),[b,A]=t.useState([]),[D,Pn]=t.useState(4),[pn,Q]=t.useState(1),[L,ln]=t.useState(!1),[_,cn]=t.useState(1),[T,zn]=t.useState(null),[v,O]=t.useState("ready"),[xn,Hn]=t.useState(10),[X,nn]=t.useState(10),[en,Wn]=t.useState(20),[Rn,tn]=t.useState(0),[U,on]=t.useState(!1),[Y,mn]=t.useState(""),[C,wn]=t.useState(!1),[dn,un]=t.useState(!1),[fn,G]=t.useState(null),[Mn,rn]=t.useState([]),[Ln,yn]=t.useState([]),[n,Cn]=t.useState(!1),[Bn,V]=t.useState(1),[bn,q]=t.useState(null),[k,En]=t.useState(!1),[l,An]=t.useState(!1),[c,Dn]=t.useState(!1),[x,Gn]=t.useState(!1),[H,Fn]=t.useState(!1),[W,$n]=t.useState(!1),[m,_n]=t.useState(!1),[u,On]=t.useState(!1),[f,Un]=t.useState(!1),[P,Yn]=t.useState(!1),hn=t.useRef(new Set),N=t.useRef(new Map),I=t.useRef(null),B=t.useRef(null);t.useEffect(()=>{s!==void 0?B.current=new mi(s):B.current=null},[s]);const Vn=()=>B.current?B.current.next():Math.random(),Sn=e=>B.current?B.current.nextInt(e):Math.floor(Math.random()*e);t.useEffect(()=>{const e=()=>{const w=g??window.innerWidth,r=a??window.innerHeight,h=w<768||w===926&&r===428||w===932&&r===430,y=r<700,z=w/r>1.8,S=w===768&&r===1024,vn=w===1024&&r===768,Z=w===820&&r===1180,R=w===1180&&r===820,E=w===540&&r===720,Qn=w===720&&r===540,Xn=w===1024&&r===1366,ni=w===1366&&r===1024,ii=w>=1200&&r>=600&&!h;if(En(ii),An(S),Dn(vn),Gn(Z),Fn(R),$n(E),_n(Qn),On(Xn),Un(ni),Yn(z),Cn(h),h)q(d&&d>=320?d:null),V(1);else if(y)q(d&&d>=400?d:null),V(1);else if(z){const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(.85)}else{const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[g,a,d]);const sn=e=>[...e].sort(()=>Vn()-.5).slice(0,6),qn=e=>{I.current&&I.current.abort(),I.current=new AbortController;const r=F[e].map(h=>h.src);gn(r,I.current.signal).then(h=>{r.forEach(y=>{hn.current.add(y),h.has(y)&&N.current.set(y,h.get(y))})}).catch(()=>{})},jn=()=>{if(!j)return;const e=sn(F[j]);A(e),ln(!0),on(!1),cn(1),tn(0),rn([]),yn([]);const w=e.map(r=>r.src);gn(w,I.current?.signal).then(r=>{w.forEach(h=>{hn.current.add(h),r.has(h)&&N.current.set(h,r.get(h))})}).catch(()=>{}),kn(e,[],!0)},kn=(e=b,w=Ln,r=!1)=>{const h=sn(e.length?e:F[j]);let y=Sn(h.length),z=h[y].name,S=0;for(;w.includes(z)&&S<20;)y=Sn(h.length),z=h[y].name,S++;if(A(h),zn(y),yn([...w,z]),wn(!1),mn(""),Wn(20),G(null),j&&!r){const Z=sn(F[j].filter(R=>!w.includes(R.name))).map(R=>R.src);gn(Z,I.current?.signal).then(R=>{Z.forEach(E=>{hn.current.add(E),R.has(E)&&N.current.set(E,R.get(E))})}).catch(()=>{})}r?(O("ready"),Hn(10),nn(10)):(O("memorize"),nn(10))};t.useEffect(()=>{if(!(!L||U||C)){if(v==="ready")if(xn<=0)O("memorize");else{const e=setTimeout(()=>Hn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="memorize")if(X<=0)O("guess");else{const e=setTimeout(()=>nn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="guess"){if(en<=0){wn(!0),G("wrong");const w=b[T].name,r=b[T].aliases,h=[w,...r||[]].join(", ");rn(y=>[...y,{round:_,answer:Y,correct:h,result:"wrong"}]);return}const e=setTimeout(()=>Wn(w=>w-1),1e3);return()=>clearTimeout(e)}}},[v,xn,X,en,L,U,C,b,T,_,Y]);const Nn=()=>{if(T===null||dn)return;const e=b[T].name,w=b[T].aliases,r=Y.toLowerCase().trim();let h="wrong";const y=[e,...w||[]].map(S=>S.toLowerCase()),z=[e,...w||[]].join(", ");y.includes(r)?(tn(S=>S+1),G("correct"),h="correct"):y.some(S=>ui(r,S)===1)?(tn(S=>S+.5),G("almost"),h="almost"):(G("wrong"),h="wrong"),rn(S=>[...S,{round:_,answer:r,correct:z,result:h}]),un(!0),setTimeout(()=>{un(!1),wn(!0)},600)},Zn=()=>_<D?(cn(e=>e+1),kn()):on(!0),Kn=()=>{I.current&&I.current.abort(),ln(!1),on(!1),$(null),Q(2)},Jn=t.useMemo(()=>i.jsx("div",{style:{...o.gmLogoFixed,position:"absolute",top:28,left:16,zIndex:30},children:i.jsxs("picture",{children:[i.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),i.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:o.gmLogoImg,loading:"lazy"})]})}),[]);return i.jsxs("div",{ref:p,style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",transition:"background 0.3s ease",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:[Jn,i.jsx("div",{style:{width:n?"100%":bn||d||1e3,height:n?"100%":bn||d||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:0,background:"transparent",boxShadow:"none",margin:"0 auto",position:"relative",transform:`scale(${Bn})`},children:i.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:i.jsxs("div",{id:"whats-missing-root",style:{position:"relative",width:"100%",height:"100%"},children:[!j&&!L&&pn===1&&i.jsxs("div",{style:{...o.gmCenterScreen,transform:"none"},children:[i.jsx("h1",{style:o.gmHeadline1,children:"WHAT'S MISSING?"}),i.jsxs("div",{style:{marginTop:24},children:[i.jsx("p",{style:o.gmBodyS,children:"Choose number of rounds:"}),i.jsx("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:8},children:[3,4,5].map(e=>i.jsx("button",{style:{...o.gmButton,...D===e?o.gmButtonActive:{},padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"14px 28px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"13px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"48px":"64px"},onClick:()=>Pn(e),children:e},e))})]}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"10px 20px":"14px 30px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"15px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"132px":"160px"},onClick:()=>Q(2),children:"Play"})]}),!j&&!L&&pn===2&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("p",{style:o.gmBodyM,children:"Select a theme:"}),i.jsxs("p",{style:o.gmBodyS,children:["Rounds: ",D]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:n?"repeat(2, 1fr)":"repeat(4, 1fr)",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px":"12px",maxWidth:n?280:420,margin:"0 auto"},children:xi.map(e=>i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"10px 16px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"14px"},onClick:()=>{$(e),qn(e)},children:Hi[e]},e))}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:()=>Q(1),children:"Back"})]}),j&&!L&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsxs("h1",{style:o.gmHeadline1,children:["Theme selected: ",j]}),i.jsxs("p",{style:o.gmBodyM,children:["Rounds: ",D]}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:jn,children:"▶ Start game"})]}),U&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("h1",{style:{...o.gmHeadline1,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline1.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline1.marginBottom},children:"Results"}),i.jsxs("h2",{style:{...o.gmHeadline3,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline3.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline3.marginBottom},children:["Your score: ",Rn," / ",D]}),i.jsx("p",{style:{...o.gmBodyM,color:"#10b981",marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"12px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmBodyM.marginBottom},children:"Yahoo! You did it! 🍬✨"}),i.jsxs("table",{style:{...o.gmTable,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"20px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"4px":"32px"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Round"}),i.jsx("th",{children:"Your Answer"}),i.jsx("th",{children:"Correct"}),i.jsx("th",{children:"Result"})]})}),i.jsx("tbody",{children:Mn.map((e,w)=>i.jsxs("tr",{children:[i.jsx("td",{style:o.gmTableCell,children:e.round}),i.jsx("td",{style:o.gmTableCell,children:e.answer||"—"}),i.jsx("td",{style:o.gmTableCell,children:e.correct}),i.jsx("td",{style:o.gmTableCell,children:e.result==="correct"?"✔ Correct":e.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},w))})]}),i.jsxs("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"2px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k?"12px":"24px"},children:[i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:jn,children:"🔁 Play again"}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:Kn,children:"⬅️ Choose theme"})]})]}),L&&!U&&i.jsxs("div",{style:o.gmGameLayout,children:[i.jsxs("div",{style:{minHeight:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"45px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"50px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"60px":"160px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"15px":"40px"},children:[v==="ready"&&i.jsxs(i.Fragment,{children:[i.jsx("h1",{style:{...o.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),i.jsx("div",{style:o.gmHourglass,children:"⏳"})]}),v==="memorize"&&i.jsxs("p",{style:{...o.gmBodyM,color:"#10b981"},children:["MEMORIZE (",X,")"]}),v==="guess"&&!C&&i.jsxs("p",{style:o.gmBodyM,children:["⏳ Time left: ",en,"s"]})]}),v!=="ready"&&i.jsx("div",{style:{...o.gmGrid,...P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?{width:"100%"}:{},gridTemplateColumns:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667?"repeat(3, 1fr)":n?"repeat(2, 1fr)":window.innerHeight<700?"repeat(3, 1fr)":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"repeat(3, 130px)":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"repeat(3, 150px)":"repeat(3, 210px)",gridAutoRows:n&&window.innerWidth>window.innerHeight?"120px":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"100px":n?"150px":window.innerHeight<700?"140px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"240px":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"130px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"150px":"210px",gap:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"12px":n||window.innerHeight<700?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"24px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"12px":"20px",justifyItems:"center",maxWidth:n&&window.innerWidth>window.innerHeight?"90%":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"95%":"100%",padding:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"20px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"10px":"16px"},children:b.map((e,w)=>{const r=T===w&&v==="guess"&&!C;return i.jsx("div",{style:{width:"100%",height:"100%",borderRadius:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px":"12px",overflow:"hidden",backgroundColor:"#ffffff",boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 1px 4px rgba(0,0,0,0.1)":"0 4px 12px rgba(0,0,0,0.15)",transition:"all 0.3s ease",cursor:"pointer",...fn==="correct"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #10b981":"0 0 20px #10b981",transform:"scale(1.03)"}:{},...fn==="wrong"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #ef4444":"0 0 20px #ef4444",transform:"scale(1.03)"}:{}},children:!r&&(()=>{const h=N.current.get(e.src),y=h?.complete&&h.src?h.src:e.src;return i.jsx("img",{src:y,alt:e.name,fetchPriority:"high",loading:"eager",decoding:"async",style:{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center"}},`${e.src}-${h?.complete?"loaded":"pending"}`)})()},w)})}),i.jsxs("div",{style:{marginTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"1px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"4px":"16px",height:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"40px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"50px":"80px"},children:[v==="guess"&&!C&&i.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",minWidth:0,gap:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"3px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"6px":"12px",width:"100%",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"270px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"400px":"300px"},children:i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",placeholder:"Type the missing word",value:Y,onChange:e=>mn(e.target.value),style:{...o.gmInput,flex:"1 1 0",minWidth:0,width:"auto",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"170px":(window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700,"250px"),padding:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"5px 6px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 12px":"12px 16px",boxSizing:"border-box",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428?"10px":window.innerWidth===896&&window.innerHeight===414?"11px":window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"}}),i.jsx("button",{style:{...o.gmButton,marginLeft:0,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px",minWidth:n&&window.innerWidth<=375&&window.innerHeight<=667?"45px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"55px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"80px":"100px",flexShrink:0},onClick:Nn,disabled:dn,children:dn?"...":"Check"})]})}),C&&i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"},onClick:Zn,children:"Next round"})]})]})]})})})]})}const K=1280,J=720;function yi(d,a){const g=Math.min(d,a);return d<=768?Math.max(280,d-20):Math.max(400,Math.min(1200,g-40))}function Tn({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const[p,j]=t.useState(()=>({width:typeof window<"u"?window.innerWidth:K,height:typeof window<"u"?window.innerHeight:J}));t.useEffect(()=>{const b=()=>{j({width:window.innerWidth,height:window.innerHeight})};b(),window.addEventListener("resize",b),window.addEventListener("orientationchange",b);const A=new ResizeObserver(b);return A.observe(document.documentElement),()=>{window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),A.disconnect()}},[]);const $=t.useMemo(()=>Math.min(p.width/K,p.height/J),[p.width,p.height]);return i.jsx("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:i.jsx("div",{style:{position:"absolute",left:"50%",top:"50%",width:`${K}px`,height:`${J}px`,transform:`translate(-50%, -50%) scale(${$})`,transformOrigin:"center center"},children:i.jsx("div",{style:{width:`${K}px`,height:`${J}px`,position:"relative",overflow:"hidden"},children:i.jsx(In,{gameCubeSize:d??yi(p.width,p.height),screenWidth:g??p.width,screenHeight:a??p.height,seed:s})})})})}exports.AdaptiveGameShell=Tn;exports.Game=Tn;exports.RawGame=In;exports.themes=F;
27
+ ${Ze}
28
+ `;const c=document.getElementById("whats-missing-reset");c&&c.remove(),document.head.appendChild(i)};class ht{constructor(c){this.seed=c}next(){return this.seed=(this.seed*1664525+1013904223)%Math.pow(2,32),this.seed/Math.pow(2,32)}nextInt(c){return Math.floor(this.next()*c)}}const wt=(i,c)=>{const n=Array.from({length:i.length+1},()=>Array(c.length+1).fill(0));for(let a=0;a<=i.length;a++)n[a][0]=a;for(let a=0;a<=c.length;a++)n[0][a]=a;for(let a=1;a<=i.length;a++)for(let d=1;d<=c.length;d++)n[a][d]=i[a-1]===c[d-1]?n[a-1][d-1]:Math.min(n[a-1][d-1],n[a][d-1],n[a-1][d])+1;return n[i.length][c.length]},gt=i=>new Promise(c=>{const n=new Image;n.onload=()=>c(n),n.onerror=()=>c(n),n.src=i}),ie=async(i,c)=>{const n=new Map,a=i.map(async d=>{const u=await gt(d);n.set(d,u)});return await Promise.allSettled(a),n};function xe({gameCubeSize:i,screenHeight:c,screenWidth:n,seed:a}){const d=s.useRef(null);s.useEffect(()=>(pt(),()=>{document.documentElement.style.overflow="",document.body.style.overflow="";const t=document.getElementById("whats-missing-reset");t&&t.remove(),x.current&&x.current.abort()}),[]);const[u,T]=s.useState(null),[h,I]=s.useState([]),[P,ye]=s.useState(4),[ne,W]=s.useState(1),[N,re]=s.useState(!1),[M,ae]=s.useState(1),[b,ke]=s.useState(null),[f,R]=s.useState("ready"),[_,ce]=s.useState(5),[U,Y]=s.useState(6),[F,le]=s.useState(20),[je,O]=s.useState(0),[L,q]=s.useState(!1),[E,de]=s.useState(""),[k,V]=s.useState(!1),[C,me]=s.useState(!1),[pe,z]=s.useState(null),[he,Z]=s.useState([]),[ve,we]=s.useState([]),[ut,Se]=s.useState(!1),[xt,B]=s.useState(1),[bt,A]=s.useState(null),[yt,Ie]=s.useState(!1),[kt,Ne]=s.useState(!1),[jt,ze]=s.useState(!1),[vt,Te]=s.useState(!1),[St,Pe]=s.useState(!1),[It,Me]=s.useState(!1),[Nt,Re]=s.useState(!1),[zt,Le]=s.useState(!1),[Tt,Ee]=s.useState(!1),[Pt,Ce]=s.useState(!1),K=s.useRef(new Set),G=s.useRef(new Map),x=s.useRef(null),j=s.useRef(null);s.useEffect(()=>{a!==void 0?j.current=new ht(a):j.current=null},[a]);const Be=()=>j.current?j.current.next():Math.random(),Q=t=>j.current?j.current.nextInt(t):Math.floor(Math.random()*t);s.useEffect(()=>{const t=()=>{const o=n??window.innerWidth,r=c??window.innerHeight,l=o<768||o===926&&r===428||o===932&&r===430,m=r<700,p=o/r>1.8,w=o===768&&r===1024,ue=o===1024&&r===768,H=o===820&&r===1180,y=o===1180&&r===820,v=o===540&&r===720,$e=o===720&&r===540,We=o===1024&&r===1366,_e=o===1366&&r===1024,Ue=o>=1200&&r>=600&&!l;if(Ie(Ue),Ne(w),ze(ue),Te(H),Pe(y),Me(v),Re($e),Le(We),Ee(_e),Ce(p),Se(l),l)A(i&&i>=320?i:null),B(1);else if(m)A(i&&i>=400?i:null),B(1);else if(p){const ee=i?Math.max(400,Math.min(1200,i)):Math.min(1e3,Math.min(o,r)*.9);A(ee),B(1)}else{const ee=i?Math.max(400,Math.min(1200,i)):Math.min(1e3,Math.min(o,r)*.9);A(ee),B(1)}};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[n,c,i]);const X=t=>[...t].sort(()=>Be()-.5).slice(0,4),Ae=t=>{x.current&&x.current.abort(),x.current=new AbortController;const r=S[t].map(l=>l.src);ie(r,x.current.signal).then(l=>{r.forEach(m=>{K.current.add(m),l.has(m)&&G.current.set(m,l.get(m))})}).catch(()=>{})},J=t=>{const o=t??u;if(!o)return;t&&T(t),Ae(o);const r=X(S[o]);I(r),re(!0),q(!1),ae(1),O(0),Z([]),we([]);const l=r.map(m=>m.src);ie(l,x.current?.signal).then(m=>{l.forEach(p=>{K.current.add(p),m.has(p)&&G.current.set(p,m.get(p))})}).catch(()=>{}),ge(r,[],!0)},ge=(t=h,o=ve,r=!1)=>{const l=X(t.length?t:S[u]);let m=Q(l.length),p=l[m].name,w=0;for(;o.includes(p)&&w<20;)m=Q(l.length),p=l[m].name,w++;if(I(l),ke(m),we([...o,p]),V(!1),de(""),le(20),z(null),u&&!r){const H=X(S[u].filter(y=>!o.includes(y.name))).map(y=>y.src);ie(H,x.current?.signal).then(y=>{H.forEach(v=>{K.current.add(v),y.has(v)&&G.current.set(v,y.get(v))})}).catch(()=>{})}r?(R("ready"),ce(5),Y(6)):(R("memorize"),Y(6))};s.useEffect(()=>{if(!(!N||L||k)){if(f==="ready")if(_<=0)R("memorize");else{const t=setTimeout(()=>ce(o=>o-1),1e3);return()=>clearTimeout(t)}if(f==="memorize")if(U<=0)R("guess");else{const t=setTimeout(()=>Y(o=>o-1),1e3);return()=>clearTimeout(t)}if(f==="guess"){if(F<=0){V(!0),z("wrong");const o=h[b].name,r=h[b].aliases,l=[o,...r||[]].join(", ");Z(m=>[...m,{round:M,answer:E,correct:l,result:"wrong"}]);return}const t=setTimeout(()=>le(o=>o-1),1e3);return()=>clearTimeout(t)}}},[f,_,U,F,N,L,k,h,b,M,E]);const fe=()=>{if(b===null||C)return;const t=h[b].name,o=h[b].aliases,r=E.toLowerCase().trim();let l="wrong";const m=[t,...o||[]].map(w=>w.toLowerCase()),p=[t,...o||[]].join(", ");m.includes(r)?(O(w=>w+1),z("correct"),l="correct",se("correct")):m.some(w=>wt(r,w)===1)?(O(w=>w+.5),z("almost"),l="almost",se("correct")):(z("wrong"),l="wrong",se("wrong")),Z(w=>[...w,{round:M,answer:r,correct:p,result:l}]),me(!0),setTimeout(()=>{me(!1),V(!0)},600)},Ge=()=>M<P?(ae(t=>t+1),ge()):q(!0),He=()=>{x.current&&x.current.abort(),re(!1),q(!1),T(null),W(2)},De=s.useMemo(()=>e.jsx("div",{className:"wm-logo",children:e.jsxs("picture",{children:[e.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),e.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID",loading:"lazy",draggable:!1})]})}),[]);return e.jsx("div",{ref:d,style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"radial-gradient(ellipse 80% 60% at 20% 10%, rgba(236, 76, 68, 0.12), transparent 55%), radial-gradient(ellipse 70% 50% at 90% 80%, rgba(123, 200, 164, 0.18), transparent 50%), linear-gradient(160deg, #fff7f5 0%, #ffe8e2 45%, #fff4ec 100%)",transition:"background 0.3s ease",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:0,background:"transparent",boxShadow:"none",margin:"0 auto",position:"relative",transform:"none"},children:e.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxs("div",{id:"whats-missing-root",style:{position:"relative",width:"100%",height:"100%"},children:[De,!u&&!N&&ne===1&&e.jsxs("div",{className:"wm-lobby",children:[e.jsxs("div",{className:"wm-lobbyHero","aria-label":"Look at the pictures, guess what's missing",children:[e.jsxs("div",{className:"wm-heroGrid","aria-hidden":!0,children:[e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile wm-heroTileMissing",children:"?"})]}),e.jsx("div",{className:"wm-lobbyArrow","aria-hidden":!0}),e.jsx("div",{className:"wm-lobbyGuess",children:e.jsxs("div",{className:"wm-guessCard",children:[e.jsx("div",{className:"wm-guessPrompt",children:"Guess"}),e.jsx("div",{className:"wm-guessLine",children:"cat"})]})})]}),e.jsxs("div",{className:"wm-lobbyHead",children:[e.jsxs("h1",{className:"wm-brandTitle",children:["What's ",e.jsx("span",{className:"wm-brandAccent",children:"Missing"}),"?"]}),e.jsxs("ol",{className:"wm-lobbySteps",children:[e.jsxs("li",{children:[e.jsx("span",{className:"wm-stepIcon wm-stepIconLook","aria-hidden":!0}),"Look"]}),e.jsxs("li",{children:[e.jsx("span",{className:"wm-stepIcon wm-stepIconGuess","aria-hidden":!0}),"Guess"]}),e.jsxs("li",{children:[e.jsx("span",{className:"wm-stepIcon wm-stepIconWin","aria-hidden":!0}),"Win"]})]})]}),e.jsxs("div",{className:"wm-roundsRow",children:[e.jsx("p",{className:"wm-roundsLabel",children:"Rounds"}),e.jsx("div",{className:"wm-roundsPills",children:[3,4,5].map(t=>e.jsx("button",{type:"button",className:`wm-roundPill${P===t?" wm-roundPillActive":""}`,onClick:()=>ye(t),children:t},t))})]}),e.jsx("button",{type:"button",className:"wm-playBtn",onClick:()=>W(2),children:"PLAY"})]}),!u&&!N&&ne===2&&e.jsxs("div",{className:"wm-topics",children:[e.jsxs("div",{className:"wm-topicsHeader",children:[e.jsx("button",{type:"button",className:"wm-topicsBack",onClick:()=>W(1),children:"Back"}),e.jsx("h2",{className:"wm-topicsTitle",children:"Choose a theme"}),e.jsxs("span",{className:"wm-topicsMeta",children:[P," rounds"]})]}),e.jsxs("button",{type:"button",className:"wm-topicCard wm-topicCardRandom",onClick:()=>J(oe[Q(oe.length)]),children:[e.jsx("span",{className:"wm-topicRandomIcon","aria-hidden":!0}),e.jsxs("div",{className:"wm-topicBody",children:[e.jsx("span",{className:"wm-topicLabel",children:"Random theme"}),e.jsx("span",{className:"wm-topicExample",children:"Surprise me!"})]})]}),e.jsx("div",{className:"wm-topicsGrid",children:oe.map(t=>e.jsxs("button",{type:"button",className:"wm-topicCard",onClick:()=>J(t),children:[e.jsx("img",{className:"wm-topicPreview",src:S[t][0]?.src,alt:"",draggable:!1,onError:o=>{o.currentTarget.style.visibility="hidden"}}),e.jsxs("div",{className:"wm-topicBody",children:[e.jsx("span",{className:"wm-topicLabel",children:dt[t]}),e.jsx("span",{className:"wm-topicExample",children:mt[t]})]})]},t))})]}),L&&e.jsxs("div",{className:"wm-final",children:[e.jsx("h2",{className:"wm-finalTitle",children:"Great job!"}),e.jsxs("p",{className:"wm-finalScore",children:[je," / ",P," correct"]}),e.jsx("p",{className:"wm-finalTeamLabel",children:"Your round"}),e.jsx("div",{className:"wm-trophyRow",children:he.length===0?e.jsx("p",{className:"wm-trophyEmpty",children:"Play a round to see results"}):he.map(t=>e.jsxs("div",{className:"wm-trophyCard",children:[e.jsxs("div",{className:`wm-trophy ${t.result}`,children:[e.jsx("span",{className:"wm-trophyMark",children:t.result==="correct"?"✔":t.result==="almost"?"◐":"✘"}),e.jsx("span",{className:"wm-trophyWord",children:t.correct.split(",")[0]})]}),e.jsxs("span",{className:"wm-trophyName",children:["Round ",t.round]})]},t.round))}),e.jsxs("div",{className:"wm-finalActions",children:[e.jsx("button",{type:"button",className:"wm-againBtn",onClick:()=>J(),children:"Play again"}),e.jsx("button",{type:"button",className:"wm-ghostBtn",onClick:He,children:"Choose theme"})]})]}),N&&!L&&e.jsxs("div",{className:`wm-play${f==="ready"?" wm-play--ready":""}`,children:[e.jsxs("div",{className:"wm-playStatus",children:[f==="ready"&&e.jsxs("div",{className:"wm-readyBlock",style:{"--wm-ready-s":`${_}s`},children:[e.jsx("p",{className:"wm-playStatusReady",children:"GET READY"}),e.jsxs("div",{className:"wm-readyLoad","aria-hidden":!0,children:[e.jsxs("div",{className:"wm-readyTiles",children:[e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile"}),e.jsx("span",{className:"wm-heroTile wm-heroTileMissing",children:"?"})]}),e.jsx("div",{className:"wm-readyBar",children:e.jsx("span",{className:"wm-readyBarFill"})})]})]}),f==="memorize"&&e.jsxs("p",{className:"wm-playStatusMemorize",children:["MEMORIZE ",U]}),f==="guess"&&!k&&e.jsxs("p",{children:["Time left: ",F,"s"]})]}),f!=="ready"&&e.jsx("div",{className:"wm-playSlot",children:e.jsx("div",{className:"wm-playGrid",children:h.map((t,o)=>{const r=b===o&&f==="guess"&&!k,l=G.current.get(t.src),m=l?.complete&&l.src?l.src:t.src,p=["wm-playCard",pe==="correct"&&b===o?"wm-playCardCorrect":"",pe==="wrong"&&b===o?"wm-playCardWrong":""].filter(Boolean).join(" ");return e.jsx("div",{className:p,children:!r&&e.jsx("img",{src:m,alt:t.name,fetchPriority:"high",loading:"eager",decoding:"async",draggable:!1},`${t.src}-${l?.complete?"loaded":"pending"}`)},o)})})}),e.jsxs("div",{className:"wm-playControls",children:[f==="guess"&&!k&&e.jsxs("div",{className:"wm-guessRow",children:[e.jsx("input",{className:"wm-guessInput",type:"text",placeholder:"Type the missing word",value:E,onChange:t=>de(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!C&&fe()}}),e.jsx("button",{type:"button",className:"wm-actionBtn",onClick:fe,disabled:C,children:C?"...":"Check"})]}),k&&e.jsx("button",{type:"button",className:"wm-actionBtn",onClick:Ge,children:"Next round"})]})]})]})})})})}const D=1280,$=720;function ft(i,c){const n=Math.min(i,c);return i<=768?Math.max(280,i-20):Math.max(400,Math.min(1200,n-40))}function be({gameCubeSize:i,screenHeight:c,screenWidth:n,seed:a}){const[d,u]=s.useState(()=>({width:typeof window<"u"?window.innerWidth:D,height:typeof window<"u"?window.innerHeight:$}));s.useEffect(()=>{const h=()=>{u({width:window.innerWidth,height:window.innerHeight})};h(),window.addEventListener("resize",h),window.addEventListener("orientationchange",h);const I=new ResizeObserver(h);return I.observe(document.documentElement),()=>{window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),I.disconnect()}},[]);const T=s.useMemo(()=>Math.min(d.width/D,d.height/$),[d.width,d.height]);return e.jsx("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:e.jsx("div",{style:{position:"absolute",left:"50%",top:"50%",width:`${D}px`,height:`${$}px`,transform:`translate(-50%, -50%) scale(${T})`,transformOrigin:"center center"},children:e.jsx("div",{style:{width:`${D}px`,height:`${$}px`,position:"relative",overflow:"hidden"},children:e.jsx(xe,{gameCubeSize:i??ft(d.width,d.height),screenWidth:n??d.width,screenHeight:c??d.height,seed:a})})})})}exports.AdaptiveGameShell=be;exports.Game=be;exports.RawGame=xe;exports.themes=S;