"use strict";(()=>{vare={};e.id=9918,e.ids=[9918],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},30976:(e,r,t)=>{t.r(r),t.d(r,{config:()=>y,default:()=>E,routeModule:()=>g});vars={};t.r(s),t.d(s,{default:()=>_});varn=t(89947),a=t(2706),i=t(96762),o=t(51348),l=t.n(o),c=t(77538),u=t.n(c),d=t(6420),p=t.n(d),f=t(33873),S=t.n(f);letm=t(29021);asyncfunction_(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=awaitp()(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});let{folder:s}=e.body;try{asyncfunctionn({path:e}){try{letr=m.readdirSync(e);for(lett=0;t<r.length;t++){lets=r[t];if(!s.match(/\..{3,4}$/)){awaitn({path:e+s+"/"});continue}leta=e.replace(/.*user-images\/user-\d+\/|.*jsonData\/dbSchemas\/users\/user-\d+\/media\//,"").replace(/\/+$/,""),i=awaitl()(`SELECT * FROM user_media WHERE folder=? && media_url LIKE '%${s}'`,[a]);i&&i[0]&&awaitl()("DELETE FROM user_media WHERE id = ?",[i[0].id]);try{m.unlinkSync(e+s)}catch(r){try{m.rmdirSync(e+s)}catch(e){}}}m.rmdirSync(e)}catch(e){console.log("File cleaning error =>",e.message)}}lete=process.env.DSQL_STATIC_SERVER_DIR;if(!e)throwconsole.log("Static File ENV not Found!"),Error("No Static Path!");leta=S().join(e,`images/user-images/user-${t.id}/`),i=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/media/`,o=a+(s?s.replace(/\.| /g,"")+"/":""),c=i+(s?s.replace(/\.| /g,"")+"/":"");awaitn({path:o}),awaitn({path:c}),r.json({success:!0})}catch(e){u()({component:"/api/deleteMediaFolder/main-catch-error",message:e.message,user:t}),r.json({success:!1})}}letE=(0,i.M)(s,"default"),y=(0,i.M)(s,"config"),g=newn.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/deleteMediaFolder",pathname:"/api/deleteMediaFolder",bundlePath:"",filename:""},userland:s})},77538:(e,r,t)=>{lets=t(29021),{IncomingMessage:n}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:n,req:a}){leti=newDate,o=(()=>{if(!a)returnnull;try{lete=a.headers["x-forwarded-for"],r=a.headers["x-real-ip"],t=a.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],n=t||s||r||a.socket.remoteAddress;if(!n)returnnull;returnString(n)}catch(e){returnnull}})();try{letn=`🚀 SERVER ERROR ===========================