"use strict";(()=>{var e={};e.id=9880,e.ids=[9880],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")},24448:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>w,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>h});var a={};r.r(a),r.d(a,{POST:()=>c});var o=r(49303),n=r(88716),i=r(60670),s=r(87070),l=r(56681),u=r.n(l);async function c(e){try{let{query:t,url:r,headless:a}=await e.json();if(!t)return s.NextResponse.json({error:"URL is required"},{status:400});let o=await u().chromium.launch({headless:a}),n=await o.newContext({userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119 Safari/537.36",viewport:{width:1280,height:720}}),i=await n.newPage();await i.goto(`https://www.bing.com/search?q=${t} phone and email`,{waitUntil:"domcontentloaded",timeout:6e4}),await i.waitForTimeout(4e3);let l=await i.evaluate(()=>{let e=document.querySelectorAll("#b_results li")[0]?.querySelector("p")?.innerText||"",t=document.querySelectorAll("#b_results li")[1]?.querySelector("p")?.innerText||"",r=document.querySelectorAll("#b_results li")[2]?.querySelector("p")?.innerText||"",a=document.querySelector("#d_ans .b_vPanel")?.textContent.trim()||"",o=document.querySelector('div[aria-label="Phone"] a')?.innerText||"",n=document.querySelector('#b_context div[role="group"] a[href^="tel:"]')?.textContent.trim()||"",i=`${e} ${t} ${r} ${a}`,s=i.match(/(?:\+91[\-\s]?|0)?[6-9]\d{9}/g)||[],l=s.length?s.map(e=>e.replace(/[\s()\-\+]/g,"")):[],u=i.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g)||[];return{phone_one:l.length?l[0]:"",phone_two:o.replace(/[\s()\-\+]/g,""),phone_three:n.replace(/[\s()\-\+]/g,""),email:u}});return await o.close(),s.NextResponse.json({...l,url:r})}catch(e){return console.error("❌ Scraping Error:",e),s.NextResponse.json({error:"Failed to scrape website"},{status:500})}}let p=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/bing_contact/route",pathname:"/api/bing_contact",filename:"route",bundlePath:"app/api/bing_contact/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\bing_contact\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:d,staticGenerationAsyncStorage:h,serverHooks:m}=p,g="/api/bing_contact/route";function w(){return(0,i.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:h})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972],()=>r(24448));module.exports=a})();