"use strict";(()=>{var e={};e.id=6534,e.ids=[6534],e.modules={76102:e=>{e.exports=require("@moduletrace/datasquirel/dist/client")},39383:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/actions/users/user-auth")},65967:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/ejson")},93726:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/numberfy")},30889:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/slugify")},27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},24709:(e,r,t)=>{t.r(r),t.d(r,{config:()=>g,default:()=>E,routeModule:()=>m});var n={};t.r(n),t.d(n,{default:()=>y});var s=t(89947),a=t(2706),o=t(96762),i=t(29021),u=t.n(i),c=t(33873),d=t.n(c),l=t(69842),p=t(27825),f=t.n(p);function _(e,r,t){if(!e)return"";if("number"==typeof e||"boolean"==typeof e)return e;if("string"==typeof e&&!e?.toString()?.match(/./))return"";if("object"==typeof e&&!Array.isArray(e))return S(e,r);if("object"==typeof e&&Array.isArray(e))return A(e,r);let n=e;return t&&(n=e.toString().replace(t,"")),r||(n=e.toString().replace(/\n|\r|\n\r|\r\n/g,"").replace(/ /g,"")),n=n.replace(/(?<!\\)\'/g,"\\'").replace(/(?<!\\)\`/g,"\\`").replace(/\/\*\*\//g,"").replace(/select |insert |drop |delete |alter |create |exec | union | or | like | concat|LOAD_FILE|ASCII| COLLATE | HAVING | information_schema|DECLARE |\#|WAITFOR |delay |BENCHMARK |\/\*.*\*\//gi,"\\$&")}function S(e,r){let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(!n){delete t[e];return}"string"==typeof n||"number"==typeof n?t[e]=_(n,r):"object"!=typeof n||Array.isArray(n)?"object"==typeof n&&Array.isArray(n)&&(t[e]=A(n,r)):t[e]=S(n,r)}),t}function A(e,r){let t=f().cloneDeep(e);return t.forEach((e,n)=>{if(!e){t.splice(n,1);return}"string"==typeof e||"number"==typeof e?t[n]=_(e,r):"object"!=typeof e||Array.isArray(e)?"object"==typeof e&&Array.isArray(e)&&(t[n]=A(e,r)):t[n]=S(e,r)}),t}async function y(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let{user:t,appData:n}=await (0,l.A)(e,r,!0);if(!t)return r.json({success:!1,msg:"Unauthorized"});let{name:s}=_(e.body),a=process.env.DSQL_STATIC_SERVER_DIR;if(!a)return console.log("Static File ENV not Found!"),r.json({success:!1,msg:"No Static File Path"});let o=d().join(a,`images/user-images/user-${t.id}/`)+s;if(u().existsSync(o))return r.json({success:!1});u().mkdirSync(o),r.json({success:!0})}let E=(0,o.M)(n,"default"),g=(0,o.M)(n,"config"),m=new s.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/addNewMediaFolder",pathname:"/api/addNewMediaFolder",bundlePath:"",filename:""},userland:n})},55153:(e,r,t)=>{t.d(r,{On:()=>s.a,_n:()=>o}),t(76102);var n=t(65967),s=t.n(n);t(30889);var a=t(93726);let o=t.n(a)()},69842:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(39383),s=t.n(n),a=t(55153);async function o(e,r,t,n){let o=s()({req:e,level:t?"deep":void 0}),i={DSQL_REMOTE_SQL_HOST:process.env.DSQL_REMOTE_SQL_HOST,DSQL_SU_USER_ID:process.env.DSQL_SU_USER_ID,DSQL_HOST_ENV:process.env.DSQL_HOST_ENV,DSQL_HOST:process.env.DSQL_HOST,DSQL_STATIC_HOST:process.env.DSQL_STATIC_HOST,DSQL_GOOGLE_CLIENT_ID:process.env.DSQL_GOOGLE_CLIENT_ID,DSQL_TINY_MCE_API_KEY:process.env.DSQL_TINY_MCE_API_KEY};return n&&o.payload?.id&&(0,a._n)(process.env.DSQL_SU_USER_ID)!==o.payload.id?{user:null,appData:i}:{user:o.payload,appData:i}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return t}});var t=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,t)=>{e.exports=t(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var t=r(r.s=24709);module.exports=t})();