"use strict";(()=>{var e={};e.id=8702,e.ids=[8702],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")},88104:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>x,patchFetch:()=>h,requestAsyncStorage:()=>p,routeModule:()=>c,serverHooks:()=>w,staticGenerationAsyncStorage:()=>m});var a={};t.r(a),t.d(a,{POST:()=>d});var n=t(49303),i=t(88716),o=t(60670),s=t(87070),u=t(56681),l=t.n(u);async function d(e){let r;try{let{url:t}=await e.json();if(!t)return s.NextResponse.json({error:"URL is required"},{status:400});r=await l().chromium.launch();let a=await r.newPage();await a.route("**/*",e=>{["image","stylesheet","font"].includes(e.request().resourceType())?e.abort():e.continue()}),await a.goto(t,{waitUntil:"domcontentloaded",timeout:6e4}),await a.waitForTimeout(4e3);let n=await a.evaluate(()=>{let e=document?.querySelector("h1")?.innerText||"N/A",r=document.querySelector("p.sc-3b1eb120-16.kfAyvr.d-md-flex.d-none.align-items-start span.no-wrap")?.innerText||"",t=r?.match(/\b[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[Z]{1}[0-9A-Z]{1}\b/g)||[],a=document.querySelector(".sc-c9f6ebb-0.mXCqz.mb-3.d-none.d-md-block.p-3"),n=a?.querySelector('a[target="_blank"][rel="nofollow noreferrer"]')?.href||"",i=a?.querySelectorAll('p[color="#5E7384"]')||[],o=i[0]?.innerText||"",s=4===i.length?i[3]?.innerText:3===i.length?i[2]?.innerText:i[1]?.innerText||"";return{fullTitle:e,gst_number:t,proprietor:o,complete_address:s,website:n}});return await r.close(),s.NextResponse.json({...n,url:t})}catch(e){return console.error("❌ Scraping Error:",e),s.NextResponse.json({error:"Failed to scrape website"},{status:500})}finally{await r.close()}}let c=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/tradeindia_detail_scraper/route",pathname:"/api/tradeindia_detail_scraper",filename:"route",bundlePath:"app/api/tradeindia_detail_scraper/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\tradeindia_detail_scraper\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:p,staticGenerationAsyncStorage:m,serverHooks:w}=c,x="/api/tradeindia_detail_scraper/route";function h(){return(0,o.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:m})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972],()=>t(88104));module.exports=a})();