module.exports=[933919,(e,t,s)=>{t.exports=e.x("@prisma/client-9249dd53ac5b6a44",()=>require("@prisma/client-9249dd53ac5b6a44"))},660526,(e,t,s)=>{t.exports=e.x("node:os",()=>require("node:os"))},843793,e=>{"use strict";var t=e.i(933919);let s=globalThis.prisma??new t.PrismaClient({log:[]});process.on("SIGTERM",()=>{s.$disconnect().catch(()=>{})}),process.on("SIGINT",()=>{s.$disconnect().catch(()=>{})}),e.s(["db",0,s])},192520,e=>{"use strict";let t;var s=e.i(750227),r=e.i(660526),i=e.i(902157);function n(){return t||(t=process.env.TOWER_DATA_DIR||(0,s.join)((0,r.homedir)(),".tower"),(0,i.existsSync)(t)||(0,i.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,s.join)(n(),"assistant");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,s.join)(n(),"backups");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,s.join)(n(),"extensions");return(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,i.readFileSync)((0,s.join)(n(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,s.join)(n(),"storage");return(0,i.existsSync)(t)||(0,i.mkdirSync)(t,{recursive:!0}),t},"getTowerDbPath",0,function(){let e;return(0,s.join)((e=(0,s.join)(n(),"database"),(0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,n])},540193,e=>{"use strict";var t=e.i(750227),s=e.i(902157),r=e.i(192520),i=e.i(843793);function n(e,s){let i=(0,r.getStorageDir)(),n=t.resolve(i,"assets",e,s),c=t.resolve(i,"assets")+t.sep;return n.startsWith(c)?{resolved:n,error:null}:{resolved:null,error:"Invalid path"}}async function c(e,t){let{resolved:r}=n(e,t);if(r&&(0,s.existsSync)(r))return r;let c=await i.db.projectAsset.findFirst({where:{projectId:e,filename:t},select:{path:!0},orderBy:{createdAt:"desc"}});return c?.path&&(0,s.existsSync)(c.path)?c.path:null}async function a(e){return null!==await i.db.projectAsset.findFirst({where:{path:e},select:{id:!0}})}e.s(["MIME_MAP",0,{".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".json":"application/json"},"isRegisteredAssetPath",0,a,"resolveAssetFile",0,c,"resolveAssetPath",0,n])},487083,e=>{"use strict";var t=e.i(540193);e.s(["isRegisteredAssetPath",()=>t.isRegisteredAssetPath],487083)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0dy~osn._.js.map