(()=>{var e={};e.id=9901,e.ids=[9901],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},25785:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>v,routeModule:()=>m,serverHooks:()=>x,workAsyncStorage:()=>f,workUnitAsyncStorage:()=>h});var s={};r.r(s),r.d(s,{GET:()=>u});var a=r(96559),i=r(48088),n=r(37719),o=r(32190),l=r(29021),p=r.n(l),c=r(33873),d=r.n(c);async function u(){try{let e=function(){let e,t,r,s=d().join(process.cwd(),"prisma","schema.prisma"),a=p().readFileSync(s,"utf-8"),i=[],n=[],o=[],l=/model\s+(\w+)\s*{([^}]+)}/g;for(;null!==(e=l.exec(a));){let t=e[1];t.startsWith("//")||""===t.trim()||o.push(t)}let c=/model\s+(\w+)\s*{([^}]+)}/g;for(;null!==(t=c.exec(a));){let e=t[1],r=t[2];if(e.startsWith("//")||""===e.trim())continue;let s=[];for(let e of r.split("\n").filter(e=>e.trim())){let t=e.trim();if(t.startsWith("//")||""===t||t.startsWith("@@"))continue;let r=t.split("//")[0].trim(),a=r.split(/\s+/).filter(e=>e.trim());if(a.length>=2){let e,t=a[0],i=a[1];if(t.startsWith("@@"))continue;let n=i.endsWith("?");n&&(i=i.slice(0,-1));let l=i.endsWith("[]");l&&(i=i.slice(0,-2));let p=r.includes("@id"),c=r.includes("@unique"),d=r.match(/@default\(([^)]+)\)/),u=d?d[1]:void 0,m=r.match(/@relation\([^)]*\)/);if(m){let t=m[0],r=t.match(/fields:\s*\[([^\]]+)\]/),s=t.match(/references:\s*\[([^\]]+)\]/),a=t.match(/onDelete:\s*(\w+)/);r&&s?e={model:s[1].replace(/"/g,""),field:r[1].replace(/"/g,""),onDelete:a?a[1]:void 0}:o.includes(i.replace("?","").replace("[]",""))&&(e={model:i.replace("?","").replace("[]",""),field:"id",onDelete:void 0})}else{let t=i.replace("?","").replace("[]","");o.includes(t)&&(e={model:t,field:"id",onDelete:void 0})}s.push({name:t,type:i,isOptional:n,isArray:l,isId:p,isUnique:c,defaultValue:u,relation:e})}}let a=r.match(/@@map\("([^"]+)"\)/),n=a?a[1]:void 0;i.push({name:e,fields:s,tableName:n})}let u=/enum\s+(\w+)\s*{([^}]+)}/g;for(;null!==(r=u.exec(a));){let e=r[1],t=r[2].split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//")).map(e=>e.replace(",",""));n.push({name:e,values:t})}return{models:i,enums:n}}(),t=function(e){let t=[];for(let r of e)for(let s of r.fields)if(s.relation&&e.find(e=>e.name===s.relation.model)){let e="one-to-many";s.isArray?e="many-to-many":s.isOptional&&(e="one-to-one"),t.push({from:r.name,to:s.relation.model,type:e,fromField:s.name,toField:s.relation.field||"id"})}return t}(e.models);return o.NextResponse.json({schema:e,relations:t})}catch(e){return console.error("Database schema parsing error:",e),o.NextResponse.json({error:"Schema parse edilemedi"},{status:500})}}let m=new a.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/database/schema/route",pathname:"/api/database/schema",filename:"route",bundlePath:"app/api/database/schema/route"},resolvedPagePath:"/Users/mustafaseyhan/Project/PazarAnalist/src/app/api/database/schema/route.ts",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:f,workUnitAsyncStorage:h,serverHooks:x}=m;function v(){return(0,n.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:h})}},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},96487:()=>{}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[4447,580],()=>r(25785));module.exports=s})();