"use strict";(()=>{var e={};e.id=8333,e.ids=[8333],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")},39491:e=>{e.exports=require("assert")},6113:e=>{e.exports=require("crypto")},82361:e=>{e.exports=require("events")},57147:e=>{e.exports=require("fs")},13685:e=>{e.exports=require("http")},85158:e=>{e.exports=require("http2")},95687:e=>{e.exports=require("https")},22037:e=>{e.exports=require("os")},71017:e=>{e.exports=require("path")},12781:e=>{e.exports=require("stream")},76224:e=>{e.exports=require("tty")},57310:e=>{e.exports=require("url")},73837:e=>{e.exports=require("util")},59796:e=>{e.exports=require("zlib")},50337:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>w,patchFetch:()=>S,requestAsyncStorage:()=>m,routeModule:()=>y,serverHooks:()=>q,staticGenerationAsyncStorage:()=>f});var s={};t.r(s),t.d(s,{POST:()=>h});var o=t(49303),a=t(88716),n=t(60670),i=t(87070),l=t(5984),u=t(71017),p=t.n(u),c=t(57147),d=t.n(c);let g=p().resolve(process.cwd(),"public"),x=p().join(g,"assets","scss","dashboards");async function h(e){try{let{user_object:r,fileName:t=!1}=await e.json();if(t){let e="dashboard 999".replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),r=p().join(x,`${e}.json`);if(!d().existsSync(r))return i.NextResponse.json({error:`No data found for query: ${query}`},{status:404});let t=d().readFileSync(r,"utf-8"),s=t.trim().length>0?JSON.parse(t):[];return i.NextResponse.json(s)}try{return await (0,l.lK)([r],"dashboard_999",x),i.NextResponse.json({message:"success"})}catch(e){return i.NextResponse.json({error:"Saving Error!",message:e},{status:400})}}catch(e){return i.NextResponse.json({error:"Server Error",message:e},{status:500})}}let y=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/logs/route",pathname:"/api/logs",filename:"route",bundlePath:"app/api/logs/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\logs\\route.js",nextConfigOutput:"",userland:s}),{requestAsyncStorage:m,staticGenerationAsyncStorage:f,serverHooks:q}=y,w="/api/logs/route";function S(){return(0,n.patchFetch)({serverHooks:q,staticGenerationAsyncStorage:f})}},5984:(e,r,t)=>{t.d(r,{ax:()=>u,l8:()=>p,lK:()=>l});var s=t(24263),o=t(57147),a=t.n(o),n=t(71017),i=t.n(n);let l=async(e,r,t)=>{try{a().existsSync(t)||a().mkdirSync(t,{recursive:!0});let s=r.replace(/[^a-zA-Z0-9]/g,"_"),o=i().join(t,`${s}.json`);a().writeFileSync(o,JSON.stringify(e,null,2),"utf-8")}catch(e){console.error("❌ Error saving data:",e.message)}},u=(e,r,t,s)=>{try{let o=r.replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),n=t.replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),l=i().join(i().resolve(process.cwd(),".."),"data",n),u=i().join(l,`${o}.json`),p=[];if(a().existsSync(l)||a().mkdirSync(l,{recursive:!0}),a().existsSync(u)){let r=a().statSync(u),t=new Date(r.mtime);if((new Date-t)/36e5>2)p=[e];else{let r=a().readFileSync(u,"utf-8");r.trim().length>0&&(p=JSON.parse(r)),p.push(e)}}else p=s?[e,...p]:[e];a().writeFileSync(u,JSON.stringify(p,null,2))}catch(e){console.error("❌ Error writing file:",e.message)}};async function p(e,r,t,o,a,n){if(e.length){let i=((e,r=4)=>{let t=[];for(;e>=r;)t.push(r),e-=r;return e>0&&t.push(e),t})(e.length,4);if(i.length)for(let l=0;l<i.length;l++){let i=4*l,p=(l+1)*4,c=e.slice(i,p);await Promise.all(c.map(async e=>{try{let i=(await s.Z.post("http://localhost:3000/api/website_data_scraper",{url:e,query:r,validity:t,country:o},{signal:a})).data;u(i,r,n)}catch(e){s.Z.isCancel(e)?console.log("Request canceled"):"CanceledError"===e.name?console.log("Request was aborted"):console.log("site: error")}}))}}}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,6577,1053,8552],()=>t(50337));module.exports=s})();