"use strict";exports.id=8485,exports.ids=[8485],exports.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},73872:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{A:()=>l});var i=r(8732);r(82015);var n=r(96089),s=r(75979),d=e([s]);function l({slugText:e,justIcon:t,noIcon:r,title:a,outlined:d,extraClasses:l}){return(0,i.jsxs)("div",{className:(0,s.twMerge)("button small-text hover:!bg-transparent",d?" outlined gray bg-white":" ghost light-gray",l),onClick:t=>{navigator.clipboard.writeText(e).then(()=>{alert(`Copied: "${e}"`)})},style:d?void 0:{padding:0},children:[!r&&(0,i.jsx)(n.A,{size:d?15:20}),!t&&(0,i.jsx)("span",{className:"text-slate-500 dark:text-slate-300",children:a||"Copy Slug"})]})}s=(d.then?(await d)():d)[0],a()}catch(e){a(e)}})},57168:(e,t,r)=>{r.a(e,async(e,a)=>{try{r.d(t,{A:()=>o});var i=r(8732),n=r(73872),s=r(2459),d=r(75979),l=e([n,d]);function o({server:e,noLoadBalance:t}){return(0,i.jsxs)("div",{className:"stack w-full",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(s.A,{size:15,opacity:.5}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:e.host}),t?(0,i.jsx)(i.Fragment,{}):e.loadBalanced?(0,i.jsx)("span",{className:"info green small",children:"Load Balanced"}):(0,i.jsx)("button",{children:"Add to Load Balancer"})]})]}),(0,i.jsx)("div",{className:(0,d.twMerge)("stack border-0 border-l border-solid border-s-slate-200 dark:border-white/20","pl-6 ml-2 -mt-4 pt-2 w-full gap-0"),children:(0,i.jsx)("ul",{className:"p-0 m-0 pl-4",children:e.users?.map((e,t)=>i.jsx(c,{user:e},t))})})]})}function c({user:e}){return(0,i.jsx)("li",{className:(0,d.twMerge)("w-full"),children:(0,i.jsxs)("div",{className:"stack gap-0",children:[(0,i.jsxs)("span",{children:["user: ",(0,i.jsx)("b",{children:e.name})]}),(0,i.jsxs)("span",{children:["pass:"," ",(0,i.jsx)("b",{children:(0,i.jsx)(n.A,{slugText:e.password,title:"********",extraClasses:"inline",noIcon:!0})})]})]})})}[n,d]=l.then?(await l)():l,a()}catch(e){a(e)}})},24934:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(29021),i=r.n(a),n=r(60374),s=r(33873),d=r.n(s);function l(){let{userDirPath:e}=function(e){let t=process.env.DSQL_APP_DIR,r=process.env.DSQL_DB_SCHEMA_DIR,a=".tmp";if(!t)throw Error("Please provide the `DSQL_APP_DIR` env variable.");if(!r)throw Error("Please provide the `DSQL_DB_SCHEMA_DIR` env variable.");let i=d().join(t,"package-shared"),n=d().join(i,"types/dsql.ts"),s=d().join(r,"main.json"),l=d().join(i,"data/defaultFields.json"),o=d().join(r,"users"),c=e?.user?.id?d().join(o,`user-${e.user.id}`):e?.userId?d().join(o,`user-${e.userId}`):void 0,y=c?d().join(c,"main.json"):void 0,h=c?d().join(c,"media"):void 0,p=c?d().join(c,"export"):void 0,k=p?d().join(p,"sql"):void 0,A=k?d().join(k,a):void 0,x=A?d().join(A,"schema.json"):void 0,u="db-export.zip",v=k?d().join(k,u):void 0,f="db-export.zip",g=k?d().join(k,f):void 0;return{schemasDir:r,userDirPath:c,mainShemaJSONFilePath:s,mainDbTypeDefFile:n,tempDirName:a,defaultTableFieldsJSONFilePath:l,usersSchemaDir:o,userSchemaMainJSONFilePath:y,userPrivateMediaDir:h,userPrivateExportsDir:p,userPrivateSQLExportsDir:k,userPrivateTempSQLExportsDir:A,userPrivateTempJSONSchemaFilePath:x,userPrivateDbExportZipFileName:u,userPrivateDbExportZipFilePath:v,userPrivateDbImportZipFileName:f,userPrivateDbImportZipFilePath:g,dbNginxLoadBalancerConfigFile:d().join(t,"docker/mariadb/load-balancer/config/template/nginx.conf")}}({userId:process.env.DSQL_SU_USER_ID||"1"}),t=`${e}/servers.json`;return{dir:e,path:t}}function o(){try{!function(){try{let e=l();if(!i().existsSync(e.path)){let t={host:String(process.env.DSQL_DB_TARGET_IP_ADDRESS),port:3306,primary:!0,loadBalanced:!0,users:[{host:String(process.env.DSQL_DB_HOST),name:"root",password:process.env.DSQL_MARIADB_ROOT_PASSWORD||"password"}]};i().writeFileSync(e.path,JSON.stringify([t]))}}catch(e){return console.log(`Error checking servers ${e.message}`),!1}}();let e=l();return n.A.parse(i().readFileSync(e.path,"utf-8"))}catch(e){console.log(`Error getting servers ${e.message}`);return}}},23293:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},92441:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},52530:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},67105:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]])},96089:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},26628:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]])},34637:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},29743:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("FileKey2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]])},34479:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},10643:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},66916:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},20427:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},83158:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},62011:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},66918:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},2459:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80006:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]])},25294:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},58150:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(82544).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},60374:(e,t,r)=>{r.d(t,{A:()=>a});let a={parse:function(e,t){if(e){if("object"==typeof e)return e;if("string"==typeof e)try{return JSON.parse(e,t)}catch(e){return}}},stringify:function(e,t,r){try{return JSON.stringify(e,t||void 0,r)}catch(e){return}}}},9455:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}});var r=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}({})}};