"use strict";(()=>{var a={};a.id=244,a.ids=[244],a.modules={14217:a=>{a.exports=require("cheerio")},19362:a=>{a.exports=require("@kamilmielnik/trie")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},31097:a=>{a.exports=require("follow-redirects")},33873:a=>{a.exports=require("path")},42029:a=>{a.exports=require("unzipper")},55124:a=>{a.exports=require("winston")},55511:a=>{a.exports=require("crypto")},55650:(a,b,c)=>{c.d(b,{J:()=>g});var d=c(76095);let e=(a,b)=>{let{isEmpty:c,tile:e,x:f,y:g}=a;return!(f<0)&&!(f>=b.boardWidth)&&!(g<0)&&!(g>=b.boardHeight)&&(!c||null===e)&&(null===e||!!(0,d.Q)(e.character))},f=(a,b)=>{if(a.length!==b.boardWidth)return!1;for(let c of a)if(!e(c,b))return!1;return!0},g=(a,b)=>{if(a.length!==b.boardHeight)return!1;for(let c of a)if(!f(c,b))return!1;return h(a,b)},h=(a,b)=>{for(let c of a.flat().filter(a=>a&&a.tile&&b.isTwoCharacterTilePrefix(a.tile.character)))for(let d of b.twoCharacterTiles){let b=a[c.y+1]?.[c.x],e=a[c.y]?.[c.x+1],f=c.y+1<a.length&&!!b,g=c.x+1<a[0].length&&!!e,h=f&&b.tile&&b.tile.character===d[1],i=g&&e.tile&&e.tile.character===d[1],j=h||i;if(c.tile&&d.startsWith(c.tile.character)&&j)return!1}return!0}},66179:(a,b,c)=>{c.r(b),c.d(b,{config:()=>t,default:()=>s,handler:()=>v});var d={};c.r(d),c.d(d,{default:()=>o});var e=c(61223),f=c(74600),g=c(4409),h=c(46440),i=c(16812),j=c(77715),k=c(57519),l=c(29562),m=c(75494),n=c(55650);let o=async(a,b)=>{let c=(0,m.T)(a);try{let{board:d,game:e,locale:f}=(a=>{let{board:b,game:c,locale:d}=a.body;if(!(0,l.isLocale)(d))throw Error('Invalid "locale" parameter');if(!(0,l.isGame)(c))throw Error('Invalid "game" parameter');if(!(0,i.hasConfig)(c,d))throw Error(`No game "${c}" in "${d}"`);let e=(0,i.getConfig)(c,d);if(!(0,l.isBoardJson)(b)||!(0,n.J)(b,e))throw Error('Invalid "board" parameter');return{board:l.Board.fromJson(b),config:e,game:c,locale:d}})(a);k.logger.info("verify - request",{meta:c,payload:{board:d.toString(),boardBlanksCount:d.getBlanksCount(),boardTilesCount:d.getTilesCount(),game:e,locale:f}});let g=await j.dictionaries.get(f),h=d.getWords().sort((a,b)=>a.localeCompare(b,f)),m=h.filter(a=>!g.has(a)),o=h.filter(a=>g.has(a));b.status(200).send({invalidWords:m,validWords:o})}catch(d){let a=d instanceof Error?d.message:"Unknown error";k.logger.error("verify - error",{error:d,meta:c}),b.status(500).send({error:"Server error",message:a})}};var p=c(49275),q=c(30879),r=c(53373);let s=(0,h.M)(d,"default"),t=(0,h.M)(d,"config"),u=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/verify",pathname:"/api/verify",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function v(a,b,c){c.requestMeta&&(0,r.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,r.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/verify",f=await u.prepare(a,b,{srcPage:d});if(!f){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:g,params:h,prerenderManifest:i,routerServerContext:j}=f;try{let c,e=a.method||"GET",f=(0,p.getTracer)(),k=f.getActiveScopeSpan(),l=!!(null==j?void 0:j.isWrappedByNextServer),m=u.instrumentationOnRequestError.bind(u),n=async k=>u.render(a,b,{query:{...g,...h},params:h,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:i.preview,propagateError:!1,dev:u.isDev,page:"/api/verify",internalRevalidate:null==j?void 0:j.revalidate,onError:(...b)=>m(a,...b)}).finally(()=>{if(!k)return;k.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=f.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==q.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=a.get("next.route");if(g){let a=`${e} ${g}`;k.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),k.updateName(a),c&&c!==k&&(c.setAttribute("http.route",g),c.updateName(a))}else k.updateName(`${e} ${d}`)});l&&k?await n(k):(c=f.getActiveScopeSpan(),await f.withPropagatedContext(a.headers,()=>f.trace(q.BaseServerSpan.handleRequest,{spanName:`${e} ${d}`,kind:p.SpanKind.SERVER,attributes:{"http.method":e,"http.target":a.url}},n),void 0,!l))}catch(a){if(u.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},66605:a=>{a.exports=require("transliteration")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},76095:(a,b,c)=>{c.d(b,{Q:()=>d});let d=a=>0!==a.length&&a.length<=2},79551:a=>{a.exports=require("url")}};var b=require("../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[671,392,812],()=>b(b.s=66179));module.exports=c})();