"use strict";(()=>{var e={};e.id=9309,e.ids=[9309],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},56681:e=>{e.exports=require("playwright")},63743:(e,t,o)=>{o.r(t),o.d(t,{originalPathname:()=>m,patchFetch:()=>w,requestAsyncStorage:()=>c,routeModule:()=>u,serverHooks:()=>h,staticGenerationAsyncStorage:()=>l});var r={};o.r(r),o.d(r,{POST:()=>d});var a=o(49303),n=o(88716),i=o(60670),s=o(87070),p=o(56681);async function d(e){try{let{query:t,url:o}=await e.json(),r=await p.chromium.connectOverCDP("http://localhost:9222"),a=r.contexts()[0].pages()[0];await a.goto(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`,{waitUntil:"domcontentloaded",timeout:6e4}),await a.waitForTimeout(3e3);let n=await a.evaluate(()=>{try{let e=document.querySelector('button[data-tooltip="Copy phone number"] div.fontBodyMedium')?.innerText||document.querySelector(".W4Efsd .W4Efsd span.UsdlK")?.innerText||"",t=document.querySelector('a[data-tooltip="Open website"] div.fontBodyMedium')?.innerText||"",o=document.querySelector('button[data-tooltip="Copy address"] div.fontBodyMedium')?.innerText||"";return{phone:e?e?.replace(/\D/g,"").replace(/^0/,""):"N/A",website:t?`https://${t}`:"N/A",address:o||"N/A"}}catch(e){console.log("error")}});return await r.close(),s.NextResponse.json({phone:n.phone,website:n.website,address:n.address,url:o})}catch(e){return s.NextResponse.json({error:e})}}let u=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/getMapPhone/route",pathname:"/api/getMapPhone",filename:"route",bundlePath:"app/api/getMapPhone/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\getMapPhone\\route.js",nextConfigOutput:"",userland:r}),{requestAsyncStorage:c,staticGenerationAsyncStorage:l,serverHooks:h}=u,m="/api/getMapPhone/route";function w(){return(0,i.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:l})}}};var t=require("../../../webpack-runtime.js");t.C(e);var o=e=>t(t.s=e),r=t.X(0,[8948,5972],()=>o(63743));module.exports=r})();